Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@visactor/vrender-kits

Package Overview
Dependencies
Maintainers
15
Versions
491
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@visactor/vrender-kits - npm Package Compare versions

Comparing version 0.11.0-alpha.1 to 0.11.0-alpha.2

2

dist/index.min.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("reflect-metadata"),require("@visactor/vrender"),require("inversify")):"function"==typeof define&&define.amd?define(["exports","reflect-metadata","@visactor/vrender","inversify"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).VRender=e.VRender||{},e.VRender.Kits={}),null,e.vrender,e.inversify)}(this,(function(e,t,a,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(n=r.key,i=void 0,"symbol"==typeof(i=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var r=a.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(n,"string"))?i:String(i)),r)}var n,i}function o(e,t,a){return t&&s(e.prototype,t),a&&s(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function f(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=h(e);if(t){var n=h(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return f(this,a)}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var r,n,i,s,o=[],l=!0,h=!1;try{if(i=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;l=!1}else for(;!(l=(r=i.call(a)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){h=!0,n=e}finally{try{if(!l&&null!=a.return&&(s=a.return(),Object(s)!==s))return}finally{if(h)throw n}}return o}}(e,t)||v(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){if(e){if("string"==typeof e)return g(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}function y(e,t){var a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=v(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f: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.")}var i,s=!0,o=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==a.return||a.return()}finally{if(o)throw i}}}}function m(e,t,a,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,a):r;if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,a,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(o=(s<3?i(o):s>3?i(t,a,o):i(t,a))||o);return s>3&&o&&Object.defineProperty(t,a,o),o}function b(e,t){return function(a,r){t(a,r,e)}}function k(e,t){if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function M(e,t,a){if(e&&e.length){var r=p(t,2),n=r[0],i=r[1],s=Math.PI/180*a,o=Math.cos(s),l=Math.sin(s);e.forEach((function(e){var t=p(e,2),a=t[0],r=t[1];e[0]=(a-n)*o-(r-i)*l+n,e[1]=(a-n)*l+(r-i)*o+i}))}}function S(e){var t=e[0],a=e[1];return Math.sqrt(Math.pow(t[0]-a[0],2)+Math.pow(t[1]-a[1],2))}function x(e,t){var a=t.hachureAngle+90,r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);var n=[0,0];if(a){var i,s=y(e);try{for(s.s();!(i=s.n()).done;){M(i.value,n,a)}}catch(e){s.e(e)}finally{s.f()}}var o=function(e,t){var a,r=[],n=y(e);try{for(n.s();!(a=n.n()).done;){var i=d(a.value);i[0].join(",")!==i[i.length-1].join(",")&&i.push([i[0][0],i[0][1]]),i.length>2&&r.push(i)}}catch(e){n.e(e)}finally{n.f()}var s=[];t=Math.max(t,.1);for(var o=[],l=0,h=r;l<h.length;l++)for(var u=h[l],f=0;f<u.length-1;f++){var c=u[f],p=u[f+1];if(c[1]!==p[1]){var v=Math.min(c[1],p[1]);o.push({ymin:v,ymax:Math.max(c[1],p[1]),x:v===c[1]?c[0]:p[0],islope:(p[0]-c[0])/(p[1]-c[1])})}}if(o.sort((function(e,t){return e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax)})),!o.length)return s;for(var g=[],m=o[0].ymin;g.length||o.length;){if(o.length){for(var b=-1,k=0;k<o.length&&!(o[k].ymin>m);k++)b=k;o.splice(0,b+1).forEach((function(e){g.push({s:m,edge:e})}))}if(g=g.filter((function(e){return!(e.edge.ymax<=m)})),g.sort((function(e,t){return e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x)})),g.length>1)for(var M=0;M<g.length;M+=2){var S=M+1;if(S>=g.length)break;var x=g[M].edge,O=g[S].edge;s.push([[Math.round(x.x),m],[Math.round(O.x),m]])}m+=t,g.forEach((function(e){e.edge.x=e.edge.x+t*e.edge.islope}))}return s}(e,r);if(a){var l,h=y(e);try{for(h.s();!(l=h.n()).done;){M(l.value,n,-a)}}catch(e){h.e(e)}finally{h.f()}!function(e,t,a){var r=[];e.forEach((function(e){return r.push.apply(r,d(e))})),M(r,t,a)}(o,n,-a)}return o}var O=function(){function e(t){i(this,e),this.helper=t}return o(e,[{key:"fillPolygons",value:function(e,t){return this._fillPolygons(e,t)}},{key:"_fillPolygons",value:function(e,t){var a=x(e,t);return{type:"fillSketch",ops:this.renderLines(a,t)}}},{key:"renderLines",value:function(e,t){var a,r=[],n=y(e);try{for(n.s();!(a=n.n()).done;){var i=a.value;r.push.apply(r,d(this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],t)))}}catch(e){n.e(e)}finally{n.f()}return r}}]),e}(),w=function(e){l(a,e);var t=c(a);function a(){return i(this,a),t.apply(this,arguments)}return o(a,[{key:"fillPolygons",value:function(e,t){var a=t.hachureGap;a<0&&(a=4*t.strokeWidth),a=Math.max(a,.1);var r,n=x(e,Object.assign({},t,{hachureGap:a})),i=Math.PI/180*t.hachureAngle,s=[],o=.5*a*Math.cos(i),l=.5*a*Math.sin(i),h=y(n);try{for(h.s();!(r=h.n()).done;){var u=p(r.value,2),f=u[0],c=u[1];S([f,c])&&s.push([[f[0]-o,f[1]+l],d(c)],[[f[0]+o,f[1]-l],d(c)])}}catch(e){h.e(e)}finally{h.f()}return{type:"fillSketch",ops:this.renderLines(s,t)}}}]),a}(O),P=function(e){l(a,e);var t=c(a);function a(){return i(this,a),t.apply(this,arguments)}return o(a,[{key:"fillPolygons",value:function(e,t){var a=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),n=this._fillPolygons(e,r);return a.ops=a.ops.concat(n.ops),a}}]),a}(O),D=function(){function e(t){i(this,e),this.helper=t}return o(e,[{key:"fillPolygons",value:function(e,t){var a=x(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(a,t)}},{key:"dotsOnLines",value:function(e,t){var a=[],r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);var n=t.fillWeight;n<0&&(n=t.strokeWidth/2);var i,s=r/4,o=y(e);try{for(o.s();!(i=o.n()).done;)for(var l=i.value,h=S(l),u=h/r,f=Math.ceil(u)-1,c=h-f*r,p=(l[0][0]+l[1][0])/2-r/4,v=Math.min(l[0][1],l[1][1]),g=0;g<f;g++){var m=v+c+g*r,b=p-s+2*Math.random()*s,k=m-s+2*Math.random()*s,M=this.helper.ellipse(b,k,n,n,t);a.push.apply(a,d(M.ops))}}catch(e){o.e(e)}finally{o.f()}return{type:"fillSketch",ops:a}}}]),e}(),R=function(){function e(t){i(this,e),this.helper=t}return o(e,[{key:"fillPolygons",value:function(e,t){var a=x(e,t);return{type:"fillSketch",ops:this.dashedLine(a,t)}}},{key:"dashedLine",value:function(e,t){var a=this,r=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,n=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,i=[];return e.forEach((function(e){var s=S(e),o=Math.floor(s/(r+n)),l=(s+n-o*(r+n))/2,h=e[0],u=e[1];h[0]>u[0]&&(h=e[1],u=e[0]);for(var f=Math.atan((u[1]-h[1])/(u[0]-h[0])),c=0;c<o;c++){var p=c*(r+n),v=p+r,g=[h[0]+p*Math.cos(f)+l*Math.cos(f),h[1]+p*Math.sin(f)+l*Math.sin(f)],y=[h[0]+v*Math.cos(f)+l*Math.cos(f),h[1]+v*Math.sin(f)+l*Math.sin(f)];i.push.apply(i,d(a.helper.doubleLineOps(g[0],g[1],y[0],y[1],t)))}})),i}}]),e}(),T=function(){function e(t){i(this,e),this.helper=t}return o(e,[{key:"fillPolygons",value:function(e,t){var a=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?a:t.zigzagOffset,n=x(e,t=Object.assign({},t,{hachureGap:a+r}));return{type:"fillSketch",ops:this.zigzagLines(n,r,t)}}},{key:"zigzagLines",value:function(e,t,a){var r=this,n=[];return e.forEach((function(e){var i=S(e),s=Math.round(i/(2*t)),o=e[0],l=e[1];o[0]>l[0]&&(o=e[1],l=e[0]);for(var h=Math.atan((l[1]-o[1])/(l[0]-o[0])),u=0;u<s;u++){var f=2*u*t,c=2*(u+1)*t,p=Math.sqrt(2*Math.pow(t,2)),v=[o[0]+f*Math.cos(h),o[1]+f*Math.sin(h)],g=[o[0]+c*Math.cos(h),o[1]+c*Math.sin(h)],y=[v[0]+p*Math.cos(h+Math.PI/4),v[1]+p*Math.sin(h+Math.PI/4)];n.push.apply(n,d(r.helper.doubleLineOps(v[0],v[1],y[0],y[1],a)).concat(d(r.helper.doubleLineOps(y[0],y[1],g[0],g[1],a))))}})),n}}]),e}(),C={},L=function(){function e(t){i(this,e),this.seed=t}return o(e,[{key:"next",value:function(){return this.seed?(Math.pow(2,31)-1&(this.seed=Math.imul(48271,this.seed)))/Math.pow(2,31):Math.random()}}]),e}(),z={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function W(e,t){return e.type===t}function G(e){for(var t=[],a=function(e){for(var t=new Array;""!==e;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:0,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:1,text:"".concat(parseFloat(RegExp.$1))},e=e.substr(RegExp.$1.length)}return t[t.length]={type:2,text:""},t}(e),r="BOD",n=0,i=a[n];!W(i,2);){var s=0,o=[];if("BOD"===r){if("M"!==i.text&&"m"!==i.text)return G("M0,0"+e);n++,s=z[i.text],r=i.text}else W(i,1)?s=z[r]:(n++,s=z[i.text],r=i.text);if(!(n+s<a.length))throw new Error("Path data ended short");for(var l=n;l<n+s;l++){var h=a[l];if(!W(h,1))throw new Error("Param not a number: "+r+","+h.text);o[o.length]=+h.text}if("number"!=typeof z[r])throw new Error("Bad segment: "+r);var u={key:r,data:o};t.push(u),i=a[n+=s],"M"===r&&(r="L"),"m"===r&&(r="l")}return t}function F(e){var t,a,r,n,i=0,s=0,o=0,l=0,h=[],u=y(e);try{for(u.s();!(n=u.n()).done;){var f=n.value,c=f.key,v=f.data;switch(c){case"M":h.push({key:"M",data:d(v)}),t=p(v,2),i=t[0],s=t[1],o=(a=p(v,2))[0],l=a[1];break;case"m":i+=v[0],s+=v[1],h.push({key:"M",data:[i,s]}),o=i,l=s;break;case"L":h.push({key:"L",data:d(v)}),r=p(v,2),i=r[0],s=r[1];break;case"l":i+=v[0],s+=v[1],h.push({key:"L",data:[i,s]});break;case"C":h.push({key:"C",data:d(v)}),i=v[4],s=v[5];break;case"c":var g=v.map((function(e,t){return t%2?e+s:e+i}));h.push({key:"C",data:g}),i=g[4],s=g[5];break;case"Q":h.push({key:"Q",data:d(v)}),i=v[2],s=v[3];break;case"q":var m=v.map((function(e,t){return t%2?e+s:e+i}));h.push({key:"Q",data:m}),i=m[2],s=m[3];break;case"A":h.push({key:"A",data:d(v)}),i=v[5],s=v[6];break;case"a":i+=v[5],s+=v[6],h.push({key:"A",data:[v[0],v[1],v[2],v[3],v[4],i,s]});break;case"H":h.push({key:"H",data:d(v)}),i=v[0];break;case"h":i+=v[0],h.push({key:"H",data:[i]});break;case"V":h.push({key:"V",data:d(v)}),s=v[0];break;case"v":s+=v[0],h.push({key:"V",data:[s]});break;case"S":h.push({key:"S",data:d(v)}),i=v[2],s=v[3];break;case"s":var b=v.map((function(e,t){return t%2?e+s:e+i}));h.push({key:"S",data:b}),i=b[2],s=b[3];break;case"T":h.push({key:"T",data:d(v)}),i=v[0],s=v[1];break;case"t":i+=v[0],s+=v[1],h.push({key:"T",data:[i,s]});break;case"Z":case"z":h.push({key:"Z",data:[]}),i=o,s=l}}}catch(e){u.e(e)}finally{u.f()}return h}function A(e){var t,a,r,n,i=[],s="",o=0,l=0,h=0,u=0,f=0,c=0,v=y(e);try{for(v.s();!(n=v.n()).done;){var g=n.value,m=g.key,b=g.data;switch(m){case"M":i.push({key:"M",data:d(b)}),o=(t=p(b,2))[0],l=t[1],h=(a=p(b,2))[0],u=a[1];break;case"C":i.push({key:"C",data:d(b)}),o=b[4],l=b[5],f=b[2],c=b[3];break;case"L":i.push({key:"L",data:d(b)}),o=(r=p(b,2))[0],l=r[1];break;case"H":o=b[0],i.push({key:"L",data:[o,l]});break;case"V":l=b[0],i.push({key:"L",data:[o,l]});break;case"S":var k=0,M=0;"C"===s||"S"===s?(k=o+(o-f),M=l+(l-c)):(k=o,M=l),i.push({key:"C",data:[k,M].concat(d(b))}),f=b[0],c=b[1],o=b[2],l=b[3];break;case"T":var S=p(b,2),x=S[0],O=S[1],w=0,P=0;"Q"===s||"T"===s?(w=o+(o-f),P=l+(l-c)):(w=o,P=l);var D=o+2*(w-o)/3,R=l+2*(P-l)/3,T=x+2*(w-x)/3,C=O+2*(P-O)/3;i.push({key:"C",data:[D,R,T,C,x,O]}),f=w,c=P,o=x,l=O;break;case"Q":var L=p(b,4),z=L[0],W=L[1],G=L[2],F=L[3],A=o+2*(z-o)/3,j=l+2*(W-l)/3,I=G+2*(z-G)/3,E=F+2*(W-F)/3;i.push({key:"C",data:[A,j,I,E,G,F]}),f=z,c=W,o=G,l=F;break;case"A":var V=Math.abs(b[0]),q=Math.abs(b[1]),B=b[2],Y=b[3],Z=b[4],H=b[5],Q=b[6];0===V||0===q?(i.push({key:"C",data:[o,l,H,Q,H,Q]}),o=H,l=Q):o===H&&l===Q||(_(o,l,H,Q,V,q,B,Y,Z).forEach((function(e){i.push({key:"C",data:e})})),o=H,l=Q);break;case"Z":i.push({key:"Z",data:[]}),o=h,l=u}s=m}}catch(e){v.e(e)}finally{v.f()}return i}function j(e,t,a){return[e*Math.cos(a)-t*Math.sin(a),e*Math.sin(a)+t*Math.cos(a)]}function _(e,t,a,r,n,i,s,o,l,h){var u,f=(u=s,Math.PI*u/180),c=[],d=0,v=0,g=0,y=0;if(h){var m=p(h,4);d=m[0],v=m[1],g=m[2],y=m[3]}else{var b,k;e=(b=p(j(e,t,-f),2))[0],t=b[1];var M=(e-(a=(k=p(j(a,r,-f),2))[0]))/2,S=(t-(r=k[1]))/2,x=M*M/(n*n)+S*S/(i*i);x>1&&(n*=x=Math.sqrt(x),i*=x);var O=n*n,w=i*i,P=O*w-O*S*S-w*M*M,D=O*S*S+w*M*M,R=(o===l?-1:1)*Math.sqrt(Math.abs(P/D));g=R*n*S/i+(e+a)/2,y=R*-i*M/n+(t+r)/2,d=Math.asin(parseFloat(((t-y)/i).toFixed(9))),v=Math.asin(parseFloat(((r-y)/i).toFixed(9))),e<g&&(d=Math.PI-d),a<g&&(v=Math.PI-v),d<0&&(d=2*Math.PI+d),v<0&&(v=2*Math.PI+v),l&&d>v&&(d-=2*Math.PI),!l&&v>d&&(v-=2*Math.PI)}var T=v-d;if(Math.abs(T)>120*Math.PI/180){var C=v,L=a,z=r;v=l&&v>d?d+120*Math.PI/180*1:d+120*Math.PI/180*-1,c=_(a=g+n*Math.cos(v),r=y+i*Math.sin(v),L,z,n,i,s,0,l,[v,C,g,y])}T=v-d;var W=Math.cos(d),G=Math.sin(d),F=Math.cos(v),A=Math.sin(v),I=Math.tan(T/4),E=4/3*n*I,V=4/3*i*I,q=[e,t],B=[e+E*G,t-V*W],Y=[a+E*A,r-V*F],Z=[a,r];if(B[0]=2*q[0]-B[0],B[1]=2*q[1]-B[1],h)return[B,Y,Z].concat(c);c=[B,Y,Z].concat(c);for(var H=[],Q=0;Q<c.length;Q+=3){var N=j(c[Q][0],c[Q][1],f),U=j(c[Q+1][0],c[Q+1][1],f),$=j(c[Q+2][0],c[Q+2][1],f);H.push([N[0],N[1],U[0],U[1],$[0],$[1]])}return H}var I={randOffset:function(e,t){return U(e,t)},randOffsetWithRange:function(e,t,a){return N(e,t,a)},ellipse:function(e,t,a,r,n){return B(e,t,n,q(a,r,n)).opset},doubleLineOps:function(e,t,a,r,n){return $(e,t,a,r,n,!0)}};function E(e,t,a,r,n){return{type:"path",ops:$(e,t,a,r,n)}}function V(e,t,a){var r=(e||[]).length;if(r>2){for(var n=[],i=0;i<r-1;i++)n.push.apply(n,d($(e[i][0],e[i][1],e[i+1][0],e[i+1][1],a)));return t&&n.push.apply(n,d($(e[r-1][0],e[r-1][1],e[0][0],e[0][1],a))),{type:"path",ops:n}}return 2===r?E(e[0][0],e[0][1],e[1][0],e[1][1],a):{type:"path",ops:[]}}function q(e,t,a){var r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),n=Math.ceil(Math.max(a.curveStepCount,a.curveStepCount/Math.sqrt(200)*r)),i=2*Math.PI/n,s=Math.abs(e/2),o=Math.abs(t/2),l=1-a.curveFitting;return{increment:i,rx:s+=U(s*l,a),ry:o+=U(o*l,a)}}function B(e,t,a,r){var n=p(ee(r.increment,e,t,r.rx,r.ry,1,r.increment*N(.1,N(.4,1,a),a),a),2),i=n[0],s=n[1],o=J(i,null,a);if(!a.disableMultiStroke&&0!==a.roughness){var l=J(p(ee(r.increment,e,t,r.rx,r.ry,1.5,0,a),1)[0],null,a);o=o.concat(l)}return{estimatedPoints:s,opset:{type:"path",ops:o}}}function Y(e,t,a,r,n,i,s,o,l){var h=e,u=t,f=Math.abs(a/2),c=Math.abs(r/2);f+=U(.01*f,l),c+=U(.01*c,l);for(var p=n,v=i;p<0;)p+=2*Math.PI,v+=2*Math.PI;v-p>2*Math.PI&&(p=0,v=2*Math.PI);var g=2*Math.PI/l.curveStepCount,y=Math.min(g/2,(v-p)/2),m=te(y,h,u,f,c,p,v,1,l);if(!l.disableMultiStroke){var b=te(y,h,u,f,c,p,v,1.5,l);m.push.apply(m,d(b))}return s&&(o?m.push.apply(m,d($(h,u,h+f*Math.cos(p),u+c*Math.sin(p),l)).concat(d($(h,u,h+f*Math.cos(v),u+c*Math.sin(v),l)))):m.push({op:"lineTo",data:[h,u]},{op:"lineTo",data:[h+f*Math.cos(p),u+c*Math.sin(p)]})),{type:"path",ops:m}}function Z(e,t){var a,r=[],n=y(e);try{for(n.s();!(a=n.n()).done;){var i=a.value;if(i.length){var s=t.maxRandomnessOffset||0,o=i.length;if(o>2){r.push({op:"move",data:[i[0][0]+U(s,t),i[0][1]+U(s,t)]});for(var l=1;l<o;l++)r.push({op:"lineTo",data:[i[l][0]+U(s,t),i[l][1]+U(s,t)]})}}}}catch(e){n.e(e)}finally{n.f()}return{type:"fillPath",ops:r}}function H(e,t){return function(e,t){var a=e.fillStyle||"hachure";if(!C[a])switch(a){case"zigzag":C[a]||(C[a]=new w(t));break;case"cross-hatch":C[a]||(C[a]=new P(t));break;case"dots":C[a]||(C[a]=new D(t));break;case"dashed":C[a]||(C[a]=new R(t));break;case"zigzag-line":C[a]||(C[a]=new T(t));break;default:C[a="hachure"]||(C[a]=new O(t))}return C[a]}(t,I).fillPolygons(e,t)}function Q(e){return e.randomizer||(e.randomizer=new L(e.seed||0)),e.randomizer.next()}function N(e,t,a){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return a.roughness*r*(Q(a)*(t-e)+e)}function U(e,t){return N(-e,e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)}function $(e,t,a,r,n){var i=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?n.disableMultiStrokeFill:n.disableMultiStroke,s=X(e,t,a,r,n,!0,!1);if(i)return s;var o=X(e,t,a,r,n,!0,!0);return s.concat(o)}function X(e,t,a,r,n,i,s){var o,l=Math.pow(e-a,2)+Math.pow(t-r,2),h=Math.sqrt(l);o=h<200?1:h>500?.4:-.0016668*h+1.233334;var u=n.maxRandomnessOffset||0;u*u*100>l&&(u=h/10);var f=u/2,c=.2+.2*Q(n),p=n.bowing*n.maxRandomnessOffset*(r-t)/200,d=n.bowing*n.maxRandomnessOffset*(e-a)/200;p=U(p,n,o),d=U(d,n,o);var v=[],g=function(){return U(f,n,o)},y=function(){return U(u,n,o)},m=n.preserveVertices;return i&&(s?v.push({op:"move",data:[e+(m?0:g()),t+(m?0:g())]}):v.push({op:"move",data:[e+(m?0:U(u,n,o)),t+(m?0:U(u,n,o))]})),s?v.push({op:"bcurveTo",data:[p+e+(a-e)*c+g(),d+t+(r-t)*c+g(),p+e+2*(a-e)*c+g(),d+t+2*(r-t)*c+g(),a+(m?0:g()),r+(m?0:g())]}):v.push({op:"bcurveTo",data:[p+e+(a-e)*c+y(),d+t+(r-t)*c+y(),p+e+2*(a-e)*c+y(),d+t+2*(r-t)*c+y(),a+(m?0:y()),r+(m?0:y())]}),v}function K(e,t,a){var r=[];r.push([e[0][0]+U(t,a),e[0][1]+U(t,a)]),r.push([e[0][0]+U(t,a),e[0][1]+U(t,a)]);for(var n=1;n<e.length;n++)r.push([e[n][0]+U(t,a),e[n][1]+U(t,a)]),n===e.length-1&&r.push([e[n][0]+U(t,a),e[n][1]+U(t,a)]);return J(r,null,a)}function J(e,t,a){var r=e.length,n=[];if(r>3){var i=[],s=1-a.curveTightness;n.push({op:"move",data:[e[1][0],e[1][1]]});for(var o=1;o+2<r;o++){var l=e[o];i[0]=[l[0],l[1]],i[1]=[l[0]+(s*e[o+1][0]-s*e[o-1][0])/6,l[1]+(s*e[o+1][1]-s*e[o-1][1])/6],i[2]=[e[o+1][0]+(s*e[o][0]-s*e[o+2][0])/6,e[o+1][1]+(s*e[o][1]-s*e[o+2][1])/6],i[3]=[e[o+1][0],e[o+1][1]],n.push({op:"bcurveTo",data:[i[1][0],i[1][1],i[2][0],i[2][1],i[3][0],i[3][1]]})}if(t&&2===t.length){var h=a.maxRandomnessOffset;n.push({op:"lineTo",data:[t[0]+U(h,a),t[1]+U(h,a)]})}}else 3===r?(n.push({op:"move",data:[e[1][0],e[1][1]]}),n.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):2===r&&n.push.apply(n,d($(e[0][0],e[0][1],e[1][0],e[1][1],a)));return n}function ee(e,t,a,r,n,i,s,o){var l=[],h=[];if(0===o.roughness){e/=4,h.push([t+r*Math.cos(-e),a+n*Math.sin(-e)]);for(var u=0;u<=2*Math.PI;u+=e){var f=[t+r*Math.cos(u),a+n*Math.sin(u)];l.push(f),h.push(f)}h.push([t+r*Math.cos(0),a+n*Math.sin(0)]),h.push([t+r*Math.cos(e),a+n*Math.sin(e)])}else{var c=U(.5,o)-Math.PI/2;h.push([U(i,o)+t+.9*r*Math.cos(c-e),U(i,o)+a+.9*n*Math.sin(c-e)]);for(var p=2*Math.PI+c-.01,d=c;d<p;d+=e){var v=[U(i,o)+t+r*Math.cos(d),U(i,o)+a+n*Math.sin(d)];l.push(v),h.push(v)}h.push([U(i,o)+t+r*Math.cos(c+2*Math.PI+.5*s),U(i,o)+a+n*Math.sin(c+2*Math.PI+.5*s)]),h.push([U(i,o)+t+.98*r*Math.cos(c+s),U(i,o)+a+.98*n*Math.sin(c+s)]),h.push([U(i,o)+t+.9*r*Math.cos(c+.5*s),U(i,o)+a+.9*n*Math.sin(c+.5*s)])}return[h,l]}function te(e,t,a,r,n,i,s,o,l){var h=i+U(.1,l),u=[];u.push([U(o,l)+t+.9*r*Math.cos(h-e),U(o,l)+a+.9*n*Math.sin(h-e)]);for(var f=h;f<=s;f+=e)u.push([U(o,l)+t+r*Math.cos(f),U(o,l)+a+n*Math.sin(f)]);return u.push([t+r*Math.cos(s),a+n*Math.sin(s)]),u.push([t+r*Math.cos(s),a+n*Math.sin(s)]),J(u,null,l)}function ae(e){return d(e)}function re(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function ne(e,t,a){var r=re(t,a);if(0===r)return re(e,t);var n=((e[0]-t[0])*(a[0]-t[0])+(e[1]-t[1])*(a[1]-t[1]))/r;return re(e,ie(t,a,n=Math.max(0,Math.min(1,n))))}function ie(e,t,a){return[e[0]+(t[0]-e[0])*a,e[1]+(t[1]-e[1])*a]}function se(e,t,a,r){var n,i,s=r||[];if(function(e,t){var a=e[t+0],r=e[t+1],n=e[t+2],i=e[t+3],s=3*r[0]-2*a[0]-i[0];s*=s;var o=3*r[1]-2*a[1]-i[1];o*=o;var l=3*n[0]-2*i[0]-a[0];l*=l;var h=3*n[1]-2*i[1]-a[1];return s<l&&(s=l),o<(h*=h)&&(o=h),s+o}(e,t)<a){var o=e[t+0];s.length?(n=s[s.length-1],i=o,Math.sqrt(re(n,i))>1&&s.push(o)):s.push(o),s.push(e[t+3])}else{var l=.5,h=e[t+0],u=e[t+1],f=e[t+2],c=e[t+3],p=ie(h,u,l),d=ie(u,f,l),v=ie(f,c,l),g=ie(p,d,l),y=ie(d,v,l),m=ie(g,y,l);se([h,p,g,m],0,a,s),se([m,y,v,c],0,a,s)}return s}function oe(e,t){return le(e,0,e.length,t)}function le(e,t,a,r,n){for(var i=n||[],s=e[t],o=e[a-1],l=0,h=1,u=t+1;u<a-1;++u){var f=ne(e[u],s,o);f>l&&(l=f,h=u)}return Math.sqrt(l)>r?(le(e,t,h+1,r,i),le(e,h,a,r,i)):(i.length||i.push(s),i.push(o)),i}function he(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15,a=arguments.length>2?arguments[2]:void 0,r=[],n=(e.length-1)/3,i=0;i<n;i++)se(e,3*i,t,r);return a&&a>0?le(r,0,r.length,a):r}var ue="none",fe=function(){function e(t){i(this,e),this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}return o(e,[{key:"_o",value:function(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}},{key:"_d",value:function(e,t,a){return{shape:e,sets:t||[],options:a||this.defaultOptions}}},{key:"line",value:function(e,t,a,r,n){var i=this._o(n);return this._d("line",[E(e,t,a,r,i)],i)}},{key:"rectangle",value:function(e,t,a,r,n){var i=this._o(n),s=[],o=function(e,t,a,r,n){return function(e,t){return V(e,!0,t)}([[e,t],[e+a,t],[e+a,t+r],[e,t+r]],n)}(e,t,a,r,i);if(i.fill){var l=[[e,t],[e+a,t],[e+a,t+r],[e,t+r]];"solid"===i.fillStyle?s.push(Z([l],i)):s.push(H([l],i))}return i.stroke!==ue&&s.push(o),this._d("rectangle",s,i)}},{key:"ellipse",value:function(e,t,a,r,n){var i=this._o(n),s=[],o=q(a,r,i),l=B(e,t,i,o);if(i.fill)if("solid"===i.fillStyle){var h=B(e,t,i,o).opset;h.type="fillPath",s.push(h)}else s.push(H([l.estimatedPoints],i));return i.stroke!==ue&&s.push(l.opset),this._d("ellipse",s,i)}},{key:"circle",value:function(e,t,a,r){var n=this.ellipse(e,t,a,a,r);return n.shape="circle",n}},{key:"linearPath",value:function(e,t){var a=this._o(t);return this._d("linearPath",[V(e,!1,a)],a)}},{key:"arc",value:function(e,t,a,r,n,i){var s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o=arguments.length>7?arguments[7]:void 0,l=this._o(o),h=[],u=Y(e,t,a,r,n,i,s,!0,l);if(s&&l.fill)if("solid"===l.fillStyle){var f=Object.assign({},l);f.disableMultiStroke=!0;var c=Y(e,t,a,r,n,i,!0,!1,f);c.type="fillPath",h.push(c)}else h.push(function(e,t,a,r,n,i,s){var o=e,l=t,h=Math.abs(a/2),u=Math.abs(r/2);h+=U(.01*h,s),u+=U(.01*u,s);for(var f=n,c=i;f<0;)f+=2*Math.PI,c+=2*Math.PI;c-f>2*Math.PI&&(f=0,c=2*Math.PI);for(var p=(c-f)/s.curveStepCount,d=[],v=f;v<=c;v+=p)d.push([o+h*Math.cos(v),l+u*Math.sin(v)]);return d.push([o+h*Math.cos(c),l+u*Math.sin(c)]),d.push([o,l]),H([d],s)}(e,t,a,r,n,i,l));return l.stroke!==ue&&h.push(u),this._d("arc",h,l)}},{key:"curve",value:function(e,t){var a=this._o(t),r=[],n=function(e,t){var a=K(e,1*(1+.2*t.roughness),t);if(!t.disableMultiStroke){var r=K(e,1.5*(1+.22*t.roughness),function(e){var t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}(t));a=a.concat(r)}return{type:"path",ops:a}}(e,a);if(a.fill&&a.fill!==ue&&e.length>=3){var i=he(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=e.length;if(a<3)throw new Error("A curve must have at least three points.");var r=[];if(3===a)r.push(ae(e[0]),ae(e[1]),ae(e[2]),ae(e[2]));else{var n=[];n.push(e[0],e[0]);for(var i=1;i<e.length;i++)n.push(e[i]),i===e.length-1&&n.push(e[i]);var s=[],o=1-t;r.push(ae(n[0]));for(var l=1;l+2<n.length;l++){var h=n[l];s[0]=[h[0],h[1]],s[1]=[h[0]+(o*n[l+1][0]-o*n[l-1][0])/6,h[1]+(o*n[l+1][1]-o*n[l-1][1])/6],s[2]=[n[l+1][0]+(o*n[l][0]-o*n[l+2][0])/6,n[l+1][1]+(o*n[l][1]-o*n[l+2][1])/6],s[3]=[n[l+1][0],n[l+1][1]],r.push(s[1],s[2],s[3])}}return r}(e),10,(1+a.roughness)/2);"solid"===a.fillStyle?r.push(Z([i],a)):r.push(H([i],a))}return a.stroke!==ue&&r.push(n),this._d("curve",r,a)}},{key:"polygon",value:function(e,t){var a=this._o(t),r=[],n=V(e,!0,a);return a.fill&&("solid"===a.fillStyle?r.push(Z([e],a)):r.push(H([e],a))),a.stroke!==ue&&r.push(n),this._d("polygon",r,a)}},{key:"path",value:function(e,t){var a=this._o(t),r=[];if(!e)return this._d("path",r,a);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");var n=a.fill&&"transparent"!==a.fill&&a.fill!==ue,i=a.stroke!==ue,s=!!(a.simplification&&a.simplification<1),o=function(e,t,a){var r,n=A(F(G(e))),i=[],s=[],o=[0,0],l=[],h=function(){var e;l.length>=4&&(e=s).push.apply(e,d(he(l,1))),l=[]},u=function(){h(),s.length&&(i.push(s),s=[])},f=y(n);try{for(f.s();!(r=f.n()).done;){var c=r.value,p=c.key,v=c.data;switch(p){case"M":u(),o=[v[0],v[1]],s.push(o);break;case"L":h(),s.push([v[0],v[1]]);break;case"C":if(!l.length){var g=s.length?s[s.length-1]:o;l.push([g[0],g[1]])}l.push([v[0],v[1]]),l.push([v[2],v[3]]),l.push([v[4],v[5]]);break;case"Z":h(),s.push([o[0],o[1]])}}}catch(e){f.e(e)}finally{f.f()}if(u(),!a)return i;for(var m=[],b=0,k=i;b<k.length;b++){var M=oe(k[b],a);M.length&&m.push(M)}return m}(e,0,s?4-4*a.simplification:(1+a.roughness)/2);return n&&("solid"===a.fillStyle?r.push(Z(o,a)):r.push(H(o,a))),i&&(s?o.forEach((function(e){r.push(V(e,!1,a))})):r.push(function(e,t){var a,r=A(F(G(e))),n=[],i=[0,0],s=[0,0],o=y(r);try{var l=function(){var e=a.value,r=e.key,o=e.data;switch(r){case"M":var l=1*(t.maxRandomnessOffset||0),h=t.preserveVertices;n.push({op:"move",data:o.map((function(e){return e+(h?0:U(l,t))}))}),s=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push.apply(n,d($(s[0],s[1],o[0],o[1],t))),s=[o[0],o[1]];break;case"C":var u=p(o,6),f=u[0],c=u[1],v=u[2],g=u[3],y=u[4],m=u[5];n.push.apply(n,d(function(e,t,a,r,n,i,s,o){for(var l=[],h=[o.maxRandomnessOffset||1,(o.maxRandomnessOffset||1)+.3],u=[0,0],f=o.disableMultiStroke?1:2,c=o.preserveVertices,p=0;p<f;p++)0===p?l.push({op:"move",data:[s[0],s[1]]}):l.push({op:"move",data:[s[0]+(c?0:U(h[0],o)),s[1]+(c?0:U(h[0],o))]}),u=c?[n,i]:[n+U(h[p],o),i+U(h[p],o)],l.push({op:"bcurveTo",data:[e+U(h[p],o),t+U(h[p],o),a+U(h[p],o),r+U(h[p],o),u[0],u[1]]});return l}(f,c,v,g,y,m,s,t))),s=[y,m];break;case"Z":n.push.apply(n,d($(s[0],s[1],i[0],i[1],t))),s=[i[0],i[1]]}};for(o.s();!(a=o.n()).done;)l()}catch(e){o.e(e)}finally{o.f()}return{type:"path",ops:n}}(e,a))),this._d("path",r,a)}},{key:"opsToPath",value:function(e,t){var a,r="",n=y(e.ops);try{for(n.s();!(a=n.n()).done;){var i=a.value,s="number"==typeof t&&t>=0?i.data.map((function(e){return+e.toFixed(t)})):i.data;switch(i.op){case"move":r+="M".concat(s[0]," ").concat(s[1]," ");break;case"bcurveTo":r+="C".concat(s[0]," ").concat(s[1],", ").concat(s[2]," ").concat(s[3],", ").concat(s[4]," ").concat(s[5]," ");break;case"lineTo":r+="L".concat(s[0]," ").concat(s[1]," ")}}}catch(e){n.e(e)}finally{n.f()}return r.trim()}},{key:"toPaths",value:function(e){var t,a=e.sets||[],r=e.options||this.defaultOptions,n=[],i=y(a);try{for(i.s();!(t=i.n()).done;){var s=t.value,o=null;switch(s.type){case"path":o={d:this.opsToPath(s),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:ue};break;case"fillPath":o={d:this.opsToPath(s),stroke:ue,strokeWidth:0,fill:r.fill||ue};break;case"fillSketch":o=this.fillSketch(s,r)}o&&n.push(o)}}catch(e){i.e(e)}finally{i.f()}return n}},{key:"fillSketch",value:function(e,t){var a=t.fillWeight;return a<0&&(a=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||ue,strokeWidth:a,fill:ue}}}],[{key:"newSeed",value:function(){return Math.floor(Math.random()*Math.pow(2,31))}}]),e}(),ce=function(){function e(t,a){i(this,e),this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new fe(a)}return o(e,[{key:"draw",value:function(e){var t,a=e.sets||[],r=e.options||this.getDefaultOptions(),n=this.ctx,i=e.options.fixedDecimalPlaceDigits,s=y(a);try{for(s.s();!(t=s.n()).done;){var o=t.value;switch(o.type){case"path":n.save(),n.strokeStyle="none"===r.stroke?"transparent":r.stroke,n.lineWidth=r.strokeWidth,r.strokeLineDash&&n.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(n.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(n,o,i),n.restore();break;case"fillPath":n.save(),n.fillStyle=r.fill||"";var l="curve"===e.shape||"polygon"===e.shape||"path"===e.shape?"evenodd":"nonzero";this._drawToContext(n,o,i,l),n.restore();break;case"fillSketch":this.fillSketch(n,o,r)}}}catch(e){s.e(e)}finally{s.f()}}},{key:"fillSketch",value:function(e,t,a){var r=a.fillWeight;r<0&&(r=a.strokeWidth/2),e.save(),a.fillLineDash&&e.setLineDash(a.fillLineDash),a.fillLineDashOffset&&(e.lineDashOffset=a.fillLineDashOffset),e.strokeStyle=a.fill||"",e.lineWidth=r,this._drawToContext(e,t,a.fixedDecimalPlaceDigits),e.restore()}},{key:"_drawToContext",value:function(e,t,a){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"nonzero";e.beginPath();var n,i=y(t.ops);try{for(i.s();!(n=i.n()).done;){var s=n.value,o="number"==typeof a&&a>=0?s.data.map((function(e){return+e.toFixed(a)})):s.data;switch(s.op){case"move":e.moveTo(o[0],o[1]);break;case"bcurveTo":e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":e.lineTo(o[0],o[1])}}}catch(e){i.e(e)}finally{i.f()}"fillPath"===t.type?e.fill(r):e.stroke()}},{key:"generator",get:function(){return this.gen}},{key:"getDefaultOptions",value:function(){return this.gen.defaultOptions}},{key:"line",value:function(e,t,a,r,n){var i=this.gen.line(e,t,a,r,n);return this.draw(i),i}},{key:"rectangle",value:function(e,t,a,r,n){var i=this.gen.rectangle(e,t,a,r,n);return this.draw(i),i}},{key:"ellipse",value:function(e,t,a,r,n){var i=this.gen.ellipse(e,t,a,r,n);return this.draw(i),i}},{key:"circle",value:function(e,t,a,r){var n=this.gen.circle(e,t,a,r);return this.draw(n),n}},{key:"linearPath",value:function(e,t){var a=this.gen.linearPath(e,t);return this.draw(a),a}},{key:"polygon",value:function(e,t){var a=this.gen.polygon(e,t);return this.draw(a),a}},{key:"arc",value:function(e,t,a,r,n,i){var s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o=arguments.length>7?arguments[7]:void 0,l=this.gen.arc(e,t,a,r,n,i,s,o);return this.draw(l),l}},{key:"curve",value:function(e,t){var a=this.gen.curve(e,t);return this.draw(a),a}},{key:"path",value:function(e,t){var a=this.gen.path(e,t);return this.draw(a),a}}]),e}(),pe=function(e,t){return new ce(e,t)};const de={maxRandomnessOffset:3,roughness:1,bowing:1,curveFitting:.95,curveTightness:void 0,curveStepCount:9,fillStyle:"hachure",fillWeight:void 0,hachureAngle:60,hachureGap:6,simplification:0,dashOffset:void 0,dashGap:void 0,zigzagOffset:void 0,seed:1,fillLineDash:void 0,fillLineDashOffset:void 0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!0,fixedDecimalPlaceDigits:void 0};let ve=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="arc",this.numberType=a.ARC_NUMBER_TYPE}draw(e,t,r,n){const{context:i}=r;if(!i)return;const s=i.canvas.nativeCanvas,o=pe(s);i.highPerformanceSave();const l=a.getTheme(e).arc;let{x:h=l.x,y:u=l.y}=e.attribute;if(e.transMatrix.onlyTranslate()){const{dx:t=l.dx,dy:a=l.dy}=e.attribute;h+=t,u+=a,i.setTransformForCurrent()}else h=0,u=0,i.transformFromMatrix(e.transMatrix,!0);const f=new a.CustomPath2D,{fill:c=l.fill,stroke:p=l.stroke,lineWidth:d=l.lineWidth,outerRadius:v=l.outerRadius,innerRadius:g=l.innerRadius,maxRandomnessOffset:y=de.maxRandomnessOffset,roughness:m=de.roughness,bowing:b=de.bowing,curveFitting:k=de.curveFitting,curveTightness:M=de.curveTightness,curveStepCount:S=de.curveStepCount,fillStyle:x=de.fillStyle,fillWeight:O=de.fillWeight,hachureAngle:w=de.hachureAngle,hachureGap:P=de.hachureGap,simplification:D=de.simplification,dashOffset:R=de.dashOffset,dashGap:T=de.dashGap,zigzagOffset:C=de.zigzagOffset,seed:L=de.seed,fillLineDash:z=de.fillLineDash,fillLineDashOffset:W=de.fillLineDashOffset,disableMultiStroke:G=de.disableMultiStroke,disableMultiStrokeFill:F=de.disableMultiStrokeFill,preserveVertices:A=de.preserveVertices,fixedDecimalPlaceDigits:j=de.fixedDecimalPlaceDigits}=e.attribute;a.drawArcPath(e,f,h,u,v,g),o.path(f.toString(),{fill:c||void 0,stroke:p||void 0,strokeWidth:d,maxRandomnessOffset:y,roughness:m,bowing:b,curveFitting:k,curveTightness:M,curveStepCount:S,fillStyle:x,fillWeight:O,hachureAngle:w,hachureGap:P,simplification:D,dashOffset:R,dashGap:T,zigzagOffset:C,seed:L,fillLineDash:z,fillLineDashOffset:W,disableMultiStroke:G,disableMultiStrokeFill:F,preserveVertices:A,fixedDecimalPlaceDigits:j}),i.highPerformanceRestore()}drawShape(e,t,a,r,n,i,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,n,i,s,o)}};ve=m([r.injectable(),b(0,r.inject(a.DefaultCanvasArcRender)),k("design:paramtypes",[Object])],ve);let ge=class extends a.DefaultCanvasAreaRender{style="rough";drawSegmentItem(e,t,r,n,i,s,o,l,h,u,f,c){if(c)return super.drawSegmentItem(e,t,r,n,i,s,o,l,h,u,f,c);e.highPerformanceSave();const p=e.canvas.nativeCanvas,d=pe(p,{}),v=new a.CustomPath2D;a.drawAreaSegments(v,t,o,{offsetX:l,offsetY:h});const{maxRandomnessOffset:g=de.maxRandomnessOffset,roughness:y=de.roughness,bowing:m=de.bowing,curveFitting:b=de.curveFitting,curveTightness:k=de.curveTightness,curveStepCount:M=de.curveStepCount,fillStyle:S=de.fillStyle,fillWeight:x=de.fillWeight,hachureAngle:O=de.hachureAngle,hachureGap:w=de.hachureGap,simplification:P=de.simplification,dashOffset:D=de.dashOffset,dashGap:R=de.dashGap,zigzagOffset:T=de.zigzagOffset,seed:C=de.seed,fillLineDash:L=de.fillLineDash,fillLineDashOffset:z=de.fillLineDashOffset,disableMultiStroke:W=de.disableMultiStroke,disableMultiStrokeFill:G=de.disableMultiStrokeFill,preserveVertices:F=de.preserveVertices,fixedDecimalPlaceDigits:A=de.fixedDecimalPlaceDigits}=i;let{fill:j,stroke:_,lineWidth:I}=i;return Array.isArray(s)?s.forEach((e=>{j=j??e.fill,_=_??e.stroke,I=I??e.lineWidth})):(j=j??s.fill,_=_??s.stroke,I=I??s.lineWidth),d.path(v.toString(),{fill:r?j:void 0,strokeWidth:I,maxRandomnessOffset:g,roughness:y,bowing:m,curveFitting:b,curveTightness:k,curveStepCount:M,fillStyle:S,fillWeight:x,hachureAngle:O,hachureGap:w,simplification:P,dashOffset:D,dashGap:R,zigzagOffset:T,seed:C,fillLineDash:L,fillLineDashOffset:z,disableMultiStroke:W,disableMultiStrokeFill:G,preserveVertices:F,fixedDecimalPlaceDigits:A}),e.highPerformanceRestore(),!1}};ge=m([r.injectable()],ge);let ye=class{canvasRenderer;style="rough";constructor(e){this.canvasRenderer=e,this.type="circle",this.numberType=a.CIRCLE_NUMBER_TYPE}draw(e,t,r,n){const{context:i}=r;if(!i)return;const s=i.canvas.nativeCanvas,o=pe(s,{}),l=a.getTheme(e).circle;let{x:h=l.x,y:u=l.y}=e.attribute;e.transMatrix.onlyTranslate()?i.onlyTranslate()||i.clearMatrix():(h=0,u=0,i.transformFromMatrix(e.transMatrix,!0));const{radius:f=l.radius,fill:c=l.fill,stroke:p=l.stroke,lineWidth:d=l.lineWidth}=e.attribute;o.circle(h,u,f,{fill:c||void 0,stroke:p||void 0,strokeWidth:d,fillStyle:"zigzag",roughness:.5})}drawShape(e,t,a,r,n,i,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,n,i,s,o)}};ye=m([r.injectable(),b(0,r.inject(a.DefaultCanvasCircleRender)),k("design:paramtypes",[Object])],ye);let me=class extends a.DefaultCanvasLineRender{style="rough";drawSegmentItem(e,t,r,n,i,s,o,l,h,u,f,c,p,d,v){if(d||v)return super.drawSegmentItem(e,t,r,n,i,s,o,l,h,u,f,c,p,d,v);e.highPerformanceSave();const g=e.canvas.nativeCanvas,y=pe(g,{}),m=new a.CustomPath2D;a.drawSegments(e.camera?e:e.nativeContext,t,h,u,{offsetX:f,offsetY:c});const{maxRandomnessOffset:b=de.maxRandomnessOffset,roughness:k=de.roughness,bowing:M=de.bowing,curveFitting:S=de.curveFitting,curveTightness:x=de.curveTightness,curveStepCount:O=de.curveStepCount,fillStyle:w=de.fillStyle,fillWeight:P=de.fillWeight,hachureAngle:D=de.hachureAngle,hachureGap:R=de.hachureGap,simplification:T=de.simplification,dashOffset:C=de.dashOffset,dashGap:L=de.dashGap,zigzagOffset:z=de.zigzagOffset,seed:W=de.seed,fillLineDash:G=de.fillLineDash,fillLineDashOffset:F=de.fillLineDashOffset,disableMultiStroke:A=de.disableMultiStroke,disableMultiStrokeFill:j=de.disableMultiStrokeFill,preserveVertices:_=de.preserveVertices,fixedDecimalPlaceDigits:I=de.fixedDecimalPlaceDigits}=o;let{fill:E,stroke:V,lineWidth:q}=o;return Array.isArray(l)?l.forEach((e=>{E=E??e.fill,V=V??e.stroke,q=q??e.lineWidth})):(E=E??l.fill,V=V??l.stroke,q=q??l.lineWidth),y.path(m.toString(),{fill:r?E:void 0,stroke:n?V:void 0,strokeWidth:q,maxRandomnessOffset:b,roughness:k,bowing:M,curveFitting:S,curveTightness:x,curveStepCount:O,fillStyle:w,fillWeight:P,hachureAngle:D,hachureGap:R,simplification:T,dashOffset:C,dashGap:L,zigzagOffset:z,seed:W,fillLineDash:G,fillLineDashOffset:F,disableMultiStroke:A,disableMultiStrokeFill:j,preserveVertices:_,fixedDecimalPlaceDigits:I}),e.highPerformanceRestore(),!1}};me=m([r.injectable()],me);let be=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="path",this.numberType=a.PATH_NUMBER_TYPE}draw(e,t,r,n){const{context:i}=r;if(!i)return;const s=i.canvas.nativeCanvas,o=pe(s,{});i.highPerformanceSave();const l=a.getTheme(e).path;i.transformFromMatrix(e.transMatrix,!0);const{fill:h=l.fill,stroke:u=l.stroke,lineWidth:f=l.lineWidth,path:c=l.path,maxRandomnessOffset:p=de.maxRandomnessOffset,roughness:d=de.roughness,bowing:v=de.bowing,curveFitting:g=de.curveFitting,curveTightness:y=de.curveTightness,curveStepCount:m=de.curveStepCount,fillStyle:b=de.fillStyle,fillWeight:k=de.fillWeight,hachureAngle:M=de.hachureAngle,hachureGap:S=de.hachureGap,simplification:x=de.simplification,dashOffset:O=de.dashOffset,dashGap:w=de.dashGap,zigzagOffset:P=de.zigzagOffset,seed:D=de.seed,fillLineDash:R=de.fillLineDash,fillLineDashOffset:T=de.fillLineDashOffset,disableMultiStroke:C=de.disableMultiStroke,disableMultiStrokeFill:L=de.disableMultiStrokeFill,preserveVertices:z=de.preserveVertices,fixedDecimalPlaceDigits:W=de.fixedDecimalPlaceDigits}=e.attribute;"string"==typeof c&&o.path(c,{fill:h||void 0,stroke:u||void 0,strokeWidth:f,maxRandomnessOffset:p,roughness:d,bowing:v,curveFitting:g,curveTightness:y,curveStepCount:m,fillStyle:b,fillWeight:k,hachureAngle:M,hachureGap:S,simplification:x,dashOffset:O,dashGap:w,zigzagOffset:P,seed:D,fillLineDash:R,fillLineDashOffset:T,disableMultiStroke:C,disableMultiStrokeFill:L,preserveVertices:z,fixedDecimalPlaceDigits:W}),i.highPerformanceRestore()}drawShape(e,t,a,r,n,i,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,n,i,s,o)}};be=m([r.injectable(),b(0,r.inject(a.DefaultCanvasPathRender)),k("design:paramtypes",[Object])],be);let ke=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="rect",this.numberType=a.RECT_NUMBER_TYPE}draw(e,t,r,n){const{context:i}=r;if(!i)return;const s=i.canvas.nativeCanvas,o=pe(s);i.highPerformanceSave();const l=a.getTheme(e).rect;let{x:h=l.x,y:u=l.y}=e.attribute;if(e.transMatrix.onlyTranslate()){const{dx:t=l.dx,dy:a=l.dy}=e.attribute;h+=t,u+=a,i.setTransformForCurrent()}else h=0,u=0,i.transformFromMatrix(e.transMatrix,!0);const{fill:f=l.fill,stroke:c=l.stroke,fillColor:p=l.fill,strokeColor:d=l.stroke,width:v=l.width,height:g=l.height,lineWidth:y=l.lineWidth,maxRandomnessOffset:m=de.maxRandomnessOffset,roughness:b=de.roughness,bowing:k=de.bowing,curveFitting:M=de.curveFitting,curveTightness:S=de.curveTightness,curveStepCount:x=de.curveStepCount,fillStyle:O=de.fillStyle,fillWeight:w=de.fillWeight,hachureAngle:P=de.hachureAngle,hachureGap:D=de.hachureGap,simplification:R=de.simplification,dashOffset:T=de.dashOffset,dashGap:C=de.dashGap,zigzagOffset:L=de.zigzagOffset,seed:z=de.seed,fillLineDash:W=de.fillLineDash,fillLineDashOffset:G=de.fillLineDashOffset,disableMultiStroke:F=de.disableMultiStroke,disableMultiStrokeFill:A=de.disableMultiStrokeFill,preserveVertices:j=de.preserveVertices,fixedDecimalPlaceDigits:_=de.fixedDecimalPlaceDigits}=e.attribute;o.rectangle(h,u,v,g,{fill:f?p:void 0,stroke:c?d:void 0,strokeWidth:y,maxRandomnessOffset:m,roughness:b,bowing:k,curveFitting:M,curveTightness:S,curveStepCount:x,fillStyle:O,fillWeight:w,hachureAngle:P,hachureGap:D,simplification:R,dashOffset:T,dashGap:C,zigzagOffset:L,seed:z,fillLineDash:W,fillLineDashOffset:G,disableMultiStroke:F,disableMultiStrokeFill:A,preserveVertices:j,fixedDecimalPlaceDigits:_}),i.highPerformanceRestore()}drawShape(e,t,a,r,n,i,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,n,i,s,o)}};ke=m([r.injectable(),b(0,r.inject(a.DefaultCanvasRectRender)),k("design:paramtypes",[Object])],ke);let Me=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="symbol",this.numberType=a.SYMBOL_NUMBER_TYPE}draw(e,t,r,n){const{context:i}=r;if(!i)return;const s=i.canvas.nativeCanvas,o=pe(s);i.highPerformanceSave();const l=a.getTheme(e).symbol;let{x:h=l.x,y:u=l.y}=e.attribute;if(e.transMatrix.onlyTranslate()){const{dx:t=l.dx,dy:a=l.dy}=e.attribute;h+=t,u+=a,i.setTransformForCurrent()}else h=0,u=0,i.transformFromMatrix(e.transMatrix,!0);const f=e.getParsedPath();if(!f)return;const{fill:c=l.fill,stroke:p=l.stroke,fillColor:d=l.fill,strokeColor:v=l.stroke,size:g=l.size,lineWidth:y=l.lineWidth,maxRandomnessOffset:m=de.maxRandomnessOffset,roughness:b=de.roughness,bowing:k=de.bowing,curveFitting:M=de.curveFitting,curveTightness:S=de.curveTightness,curveStepCount:x=de.curveStepCount,fillStyle:O=de.fillStyle,fillWeight:w=de.fillWeight,hachureAngle:P=de.hachureAngle,hachureGap:D=de.hachureGap,simplification:R=de.simplification,dashOffset:T=de.dashOffset,dashGap:C=de.dashGap,zigzagOffset:L=de.zigzagOffset,seed:z=de.seed,fillLineDash:W=de.fillLineDash,fillLineDashOffset:G=de.fillLineDashOffset,disableMultiStroke:F=de.disableMultiStroke,disableMultiStrokeFill:A=de.disableMultiStrokeFill,preserveVertices:j=de.preserveVertices,fixedDecimalPlaceDigits:_=de.fixedDecimalPlaceDigits}=e.attribute,I=new a.CustomPath2D;f.draw(I,g,h,u)&&I.closePath(),o.path(I.toString(),{fill:c?d:void 0,stroke:p?v:void 0,strokeWidth:y,maxRandomnessOffset:m,roughness:b,bowing:k,curveFitting:M,curveTightness:S,curveStepCount:x,fillStyle:O,fillWeight:w,hachureAngle:P,hachureGap:D,simplification:R,dashOffset:T,dashGap:C,zigzagOffset:L,seed:z,fillLineDash:W,fillLineDashOffset:G,disableMultiStroke:F,disableMultiStrokeFill:A,preserveVertices:j,fixedDecimalPlaceDigits:_}),i.highPerformanceRestore()}drawShape(e,t,a,r,n,i,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,n,i,s,o)}};Me=m([r.injectable(),b(0,r.inject(a.DefaultCanvasSymbolRender)),k("design:paramtypes",[Object])],Me);const Se=new r.ContainerModule(((e,t,r,n)=>{e(ye).toSelf().inSingletonScope(),e(a.GraphicRender).to(ye),e(ke).toSelf().inSingletonScope(),e(a.GraphicRender).to(ke),e(be).toSelf().inSingletonScope(),e(a.GraphicRender).to(be),e(Me).toSelf().inSingletonScope(),e(a.GraphicRender).to(Me),e(me).toSelf().inSingletonScope(),e(a.GraphicRender).to(me),e(ge).toSelf().inSingletonScope(),e(a.GraphicRender).to(ge),e(ve).toSelf().inSingletonScope(),e(a.GraphicRender).to(ve)}));e.roughModule=Se}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("reflect-metadata"),require("@visactor/vrender"),require("inversify")):"function"==typeof define&&define.amd?define(["exports","reflect-metadata","@visactor/vrender","inversify"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).VRender=e.VRender||{},e.VRender.Kits={}),e.reflectMetadata,e.VRender,e.inversify)}(this,(function(e,t,a,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(n=r.key,i=void 0,"symbol"==typeof(i=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var r=a.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(n,"string"))?i:String(i)),r)}var n,i}function o(e,t,a){return t&&s(e.prototype,t),a&&s(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function f(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=h(e);if(t){var n=h(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return f(this,a)}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var r,n,i,s,o=[],l=!0,h=!1;try{if(i=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;l=!1}else for(;!(l=(r=i.call(a)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){h=!0,n=e}finally{try{if(!l&&null!=a.return&&(s=a.return(),Object(s)!==s))return}finally{if(h)throw n}}return o}}(e,t)||v(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){if(e){if("string"==typeof e)return g(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}function y(e,t){var a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=v(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f: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.")}var i,s=!0,o=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==a.return||a.return()}finally{if(o)throw i}}}}function m(e,t,a,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,a):r;if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,a,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(o=(s<3?i(o):s>3?i(t,a,o):i(t,a))||o);return s>3&&o&&Object.defineProperty(t,a,o),o}function b(e,t){return function(a,r){t(a,r,e)}}function k(e,t){if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function M(e,t,a){if(e&&e.length){var r=p(t,2),n=r[0],i=r[1],s=Math.PI/180*a,o=Math.cos(s),l=Math.sin(s);e.forEach((function(e){var t=p(e,2),a=t[0],r=t[1];e[0]=(a-n)*o-(r-i)*l+n,e[1]=(a-n)*l+(r-i)*o+i}))}}function S(e){var t=e[0],a=e[1];return Math.sqrt(Math.pow(t[0]-a[0],2)+Math.pow(t[1]-a[1],2))}function x(e,t){var a=t.hachureAngle+90,r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);var n=[0,0];if(a){var i,s=y(e);try{for(s.s();!(i=s.n()).done;){M(i.value,n,a)}}catch(e){s.e(e)}finally{s.f()}}var o=function(e,t){var a,r=[],n=y(e);try{for(n.s();!(a=n.n()).done;){var i=d(a.value);i[0].join(",")!==i[i.length-1].join(",")&&i.push([i[0][0],i[0][1]]),i.length>2&&r.push(i)}}catch(e){n.e(e)}finally{n.f()}var s=[];t=Math.max(t,.1);for(var o=[],l=0,h=r;l<h.length;l++)for(var u=h[l],f=0;f<u.length-1;f++){var c=u[f],p=u[f+1];if(c[1]!==p[1]){var v=Math.min(c[1],p[1]);o.push({ymin:v,ymax:Math.max(c[1],p[1]),x:v===c[1]?c[0]:p[0],islope:(p[0]-c[0])/(p[1]-c[1])})}}if(o.sort((function(e,t){return e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax)})),!o.length)return s;for(var g=[],m=o[0].ymin;g.length||o.length;){if(o.length){for(var b=-1,k=0;k<o.length&&!(o[k].ymin>m);k++)b=k;o.splice(0,b+1).forEach((function(e){g.push({s:m,edge:e})}))}if(g=g.filter((function(e){return!(e.edge.ymax<=m)})),g.sort((function(e,t){return e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x)})),g.length>1)for(var M=0;M<g.length;M+=2){var S=M+1;if(S>=g.length)break;var x=g[M].edge,O=g[S].edge;s.push([[Math.round(x.x),m],[Math.round(O.x),m]])}m+=t,g.forEach((function(e){e.edge.x=e.edge.x+t*e.edge.islope}))}return s}(e,r);if(a){var l,h=y(e);try{for(h.s();!(l=h.n()).done;){M(l.value,n,-a)}}catch(e){h.e(e)}finally{h.f()}!function(e,t,a){var r=[];e.forEach((function(e){return r.push.apply(r,d(e))})),M(r,t,a)}(o,n,-a)}return o}var O=function(){function e(t){i(this,e),this.helper=t}return o(e,[{key:"fillPolygons",value:function(e,t){return this._fillPolygons(e,t)}},{key:"_fillPolygons",value:function(e,t){var a=x(e,t);return{type:"fillSketch",ops:this.renderLines(a,t)}}},{key:"renderLines",value:function(e,t){var a,r=[],n=y(e);try{for(n.s();!(a=n.n()).done;){var i=a.value;r.push.apply(r,d(this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],t)))}}catch(e){n.e(e)}finally{n.f()}return r}}]),e}(),w=function(e){l(a,e);var t=c(a);function a(){return i(this,a),t.apply(this,arguments)}return o(a,[{key:"fillPolygons",value:function(e,t){var a=t.hachureGap;a<0&&(a=4*t.strokeWidth),a=Math.max(a,.1);var r,n=x(e,Object.assign({},t,{hachureGap:a})),i=Math.PI/180*t.hachureAngle,s=[],o=.5*a*Math.cos(i),l=.5*a*Math.sin(i),h=y(n);try{for(h.s();!(r=h.n()).done;){var u=p(r.value,2),f=u[0],c=u[1];S([f,c])&&s.push([[f[0]-o,f[1]+l],d(c)],[[f[0]+o,f[1]-l],d(c)])}}catch(e){h.e(e)}finally{h.f()}return{type:"fillSketch",ops:this.renderLines(s,t)}}}]),a}(O),P=function(e){l(a,e);var t=c(a);function a(){return i(this,a),t.apply(this,arguments)}return o(a,[{key:"fillPolygons",value:function(e,t){var a=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),n=this._fillPolygons(e,r);return a.ops=a.ops.concat(n.ops),a}}]),a}(O),D=function(){function e(t){i(this,e),this.helper=t}return o(e,[{key:"fillPolygons",value:function(e,t){var a=x(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(a,t)}},{key:"dotsOnLines",value:function(e,t){var a=[],r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);var n=t.fillWeight;n<0&&(n=t.strokeWidth/2);var i,s=r/4,o=y(e);try{for(o.s();!(i=o.n()).done;)for(var l=i.value,h=S(l),u=h/r,f=Math.ceil(u)-1,c=h-f*r,p=(l[0][0]+l[1][0])/2-r/4,v=Math.min(l[0][1],l[1][1]),g=0;g<f;g++){var m=v+c+g*r,b=p-s+2*Math.random()*s,k=m-s+2*Math.random()*s,M=this.helper.ellipse(b,k,n,n,t);a.push.apply(a,d(M.ops))}}catch(e){o.e(e)}finally{o.f()}return{type:"fillSketch",ops:a}}}]),e}(),R=function(){function e(t){i(this,e),this.helper=t}return o(e,[{key:"fillPolygons",value:function(e,t){var a=x(e,t);return{type:"fillSketch",ops:this.dashedLine(a,t)}}},{key:"dashedLine",value:function(e,t){var a=this,r=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,n=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,i=[];return e.forEach((function(e){var s=S(e),o=Math.floor(s/(r+n)),l=(s+n-o*(r+n))/2,h=e[0],u=e[1];h[0]>u[0]&&(h=e[1],u=e[0]);for(var f=Math.atan((u[1]-h[1])/(u[0]-h[0])),c=0;c<o;c++){var p=c*(r+n),v=p+r,g=[h[0]+p*Math.cos(f)+l*Math.cos(f),h[1]+p*Math.sin(f)+l*Math.sin(f)],y=[h[0]+v*Math.cos(f)+l*Math.cos(f),h[1]+v*Math.sin(f)+l*Math.sin(f)];i.push.apply(i,d(a.helper.doubleLineOps(g[0],g[1],y[0],y[1],t)))}})),i}}]),e}(),T=function(){function e(t){i(this,e),this.helper=t}return o(e,[{key:"fillPolygons",value:function(e,t){var a=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?a:t.zigzagOffset,n=x(e,t=Object.assign({},t,{hachureGap:a+r}));return{type:"fillSketch",ops:this.zigzagLines(n,r,t)}}},{key:"zigzagLines",value:function(e,t,a){var r=this,n=[];return e.forEach((function(e){var i=S(e),s=Math.round(i/(2*t)),o=e[0],l=e[1];o[0]>l[0]&&(o=e[1],l=e[0]);for(var h=Math.atan((l[1]-o[1])/(l[0]-o[0])),u=0;u<s;u++){var f=2*u*t,c=2*(u+1)*t,p=Math.sqrt(2*Math.pow(t,2)),v=[o[0]+f*Math.cos(h),o[1]+f*Math.sin(h)],g=[o[0]+c*Math.cos(h),o[1]+c*Math.sin(h)],y=[v[0]+p*Math.cos(h+Math.PI/4),v[1]+p*Math.sin(h+Math.PI/4)];n.push.apply(n,d(r.helper.doubleLineOps(v[0],v[1],y[0],y[1],a)).concat(d(r.helper.doubleLineOps(y[0],y[1],g[0],g[1],a))))}})),n}}]),e}(),C={},L=function(){function e(t){i(this,e),this.seed=t}return o(e,[{key:"next",value:function(){return this.seed?(Math.pow(2,31)-1&(this.seed=Math.imul(48271,this.seed)))/Math.pow(2,31):Math.random()}}]),e}(),z={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function W(e,t){return e.type===t}function G(e){for(var t=[],a=function(e){for(var t=new Array;""!==e;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:0,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:1,text:"".concat(parseFloat(RegExp.$1))},e=e.substr(RegExp.$1.length)}return t[t.length]={type:2,text:""},t}(e),r="BOD",n=0,i=a[n];!W(i,2);){var s=0,o=[];if("BOD"===r){if("M"!==i.text&&"m"!==i.text)return G("M0,0"+e);n++,s=z[i.text],r=i.text}else W(i,1)?s=z[r]:(n++,s=z[i.text],r=i.text);if(!(n+s<a.length))throw new Error("Path data ended short");for(var l=n;l<n+s;l++){var h=a[l];if(!W(h,1))throw new Error("Param not a number: "+r+","+h.text);o[o.length]=+h.text}if("number"!=typeof z[r])throw new Error("Bad segment: "+r);var u={key:r,data:o};t.push(u),i=a[n+=s],"M"===r&&(r="L"),"m"===r&&(r="l")}return t}function F(e){var t,a,r,n,i=0,s=0,o=0,l=0,h=[],u=y(e);try{for(u.s();!(n=u.n()).done;){var f=n.value,c=f.key,v=f.data;switch(c){case"M":h.push({key:"M",data:d(v)}),t=p(v,2),i=t[0],s=t[1],o=(a=p(v,2))[0],l=a[1];break;case"m":i+=v[0],s+=v[1],h.push({key:"M",data:[i,s]}),o=i,l=s;break;case"L":h.push({key:"L",data:d(v)}),r=p(v,2),i=r[0],s=r[1];break;case"l":i+=v[0],s+=v[1],h.push({key:"L",data:[i,s]});break;case"C":h.push({key:"C",data:d(v)}),i=v[4],s=v[5];break;case"c":var g=v.map((function(e,t){return t%2?e+s:e+i}));h.push({key:"C",data:g}),i=g[4],s=g[5];break;case"Q":h.push({key:"Q",data:d(v)}),i=v[2],s=v[3];break;case"q":var m=v.map((function(e,t){return t%2?e+s:e+i}));h.push({key:"Q",data:m}),i=m[2],s=m[3];break;case"A":h.push({key:"A",data:d(v)}),i=v[5],s=v[6];break;case"a":i+=v[5],s+=v[6],h.push({key:"A",data:[v[0],v[1],v[2],v[3],v[4],i,s]});break;case"H":h.push({key:"H",data:d(v)}),i=v[0];break;case"h":i+=v[0],h.push({key:"H",data:[i]});break;case"V":h.push({key:"V",data:d(v)}),s=v[0];break;case"v":s+=v[0],h.push({key:"V",data:[s]});break;case"S":h.push({key:"S",data:d(v)}),i=v[2],s=v[3];break;case"s":var b=v.map((function(e,t){return t%2?e+s:e+i}));h.push({key:"S",data:b}),i=b[2],s=b[3];break;case"T":h.push({key:"T",data:d(v)}),i=v[0],s=v[1];break;case"t":i+=v[0],s+=v[1],h.push({key:"T",data:[i,s]});break;case"Z":case"z":h.push({key:"Z",data:[]}),i=o,s=l}}}catch(e){u.e(e)}finally{u.f()}return h}function A(e){var t,a,r,n,i=[],s="",o=0,l=0,h=0,u=0,f=0,c=0,v=y(e);try{for(v.s();!(n=v.n()).done;){var g=n.value,m=g.key,b=g.data;switch(m){case"M":i.push({key:"M",data:d(b)}),o=(t=p(b,2))[0],l=t[1],h=(a=p(b,2))[0],u=a[1];break;case"C":i.push({key:"C",data:d(b)}),o=b[4],l=b[5],f=b[2],c=b[3];break;case"L":i.push({key:"L",data:d(b)}),o=(r=p(b,2))[0],l=r[1];break;case"H":o=b[0],i.push({key:"L",data:[o,l]});break;case"V":l=b[0],i.push({key:"L",data:[o,l]});break;case"S":var k=0,M=0;"C"===s||"S"===s?(k=o+(o-f),M=l+(l-c)):(k=o,M=l),i.push({key:"C",data:[k,M].concat(d(b))}),f=b[0],c=b[1],o=b[2],l=b[3];break;case"T":var S=p(b,2),x=S[0],O=S[1],w=0,P=0;"Q"===s||"T"===s?(w=o+(o-f),P=l+(l-c)):(w=o,P=l);var D=o+2*(w-o)/3,R=l+2*(P-l)/3,T=x+2*(w-x)/3,C=O+2*(P-O)/3;i.push({key:"C",data:[D,R,T,C,x,O]}),f=w,c=P,o=x,l=O;break;case"Q":var L=p(b,4),z=L[0],W=L[1],G=L[2],F=L[3],A=o+2*(z-o)/3,j=l+2*(W-l)/3,I=G+2*(z-G)/3,E=F+2*(W-F)/3;i.push({key:"C",data:[A,j,I,E,G,F]}),f=z,c=W,o=G,l=F;break;case"A":var V=Math.abs(b[0]),q=Math.abs(b[1]),B=b[2],Y=b[3],Z=b[4],H=b[5],Q=b[6];0===V||0===q?(i.push({key:"C",data:[o,l,H,Q,H,Q]}),o=H,l=Q):o===H&&l===Q||(_(o,l,H,Q,V,q,B,Y,Z).forEach((function(e){i.push({key:"C",data:e})})),o=H,l=Q);break;case"Z":i.push({key:"Z",data:[]}),o=h,l=u}s=m}}catch(e){v.e(e)}finally{v.f()}return i}function j(e,t,a){return[e*Math.cos(a)-t*Math.sin(a),e*Math.sin(a)+t*Math.cos(a)]}function _(e,t,a,r,n,i,s,o,l,h){var u,f=(u=s,Math.PI*u/180),c=[],d=0,v=0,g=0,y=0;if(h){var m=p(h,4);d=m[0],v=m[1],g=m[2],y=m[3]}else{var b,k;e=(b=p(j(e,t,-f),2))[0],t=b[1];var M=(e-(a=(k=p(j(a,r,-f),2))[0]))/2,S=(t-(r=k[1]))/2,x=M*M/(n*n)+S*S/(i*i);x>1&&(n*=x=Math.sqrt(x),i*=x);var O=n*n,w=i*i,P=O*w-O*S*S-w*M*M,D=O*S*S+w*M*M,R=(o===l?-1:1)*Math.sqrt(Math.abs(P/D));g=R*n*S/i+(e+a)/2,y=R*-i*M/n+(t+r)/2,d=Math.asin(parseFloat(((t-y)/i).toFixed(9))),v=Math.asin(parseFloat(((r-y)/i).toFixed(9))),e<g&&(d=Math.PI-d),a<g&&(v=Math.PI-v),d<0&&(d=2*Math.PI+d),v<0&&(v=2*Math.PI+v),l&&d>v&&(d-=2*Math.PI),!l&&v>d&&(v-=2*Math.PI)}var T=v-d;if(Math.abs(T)>120*Math.PI/180){var C=v,L=a,z=r;v=l&&v>d?d+120*Math.PI/180*1:d+120*Math.PI/180*-1,c=_(a=g+n*Math.cos(v),r=y+i*Math.sin(v),L,z,n,i,s,0,l,[v,C,g,y])}T=v-d;var W=Math.cos(d),G=Math.sin(d),F=Math.cos(v),A=Math.sin(v),I=Math.tan(T/4),E=4/3*n*I,V=4/3*i*I,q=[e,t],B=[e+E*G,t-V*W],Y=[a+E*A,r-V*F],Z=[a,r];if(B[0]=2*q[0]-B[0],B[1]=2*q[1]-B[1],h)return[B,Y,Z].concat(c);c=[B,Y,Z].concat(c);for(var H=[],Q=0;Q<c.length;Q+=3){var N=j(c[Q][0],c[Q][1],f),U=j(c[Q+1][0],c[Q+1][1],f),$=j(c[Q+2][0],c[Q+2][1],f);H.push([N[0],N[1],U[0],U[1],$[0],$[1]])}return H}var I={randOffset:function(e,t){return U(e,t)},randOffsetWithRange:function(e,t,a){return N(e,t,a)},ellipse:function(e,t,a,r,n){return B(e,t,n,q(a,r,n)).opset},doubleLineOps:function(e,t,a,r,n){return $(e,t,a,r,n,!0)}};function E(e,t,a,r,n){return{type:"path",ops:$(e,t,a,r,n)}}function V(e,t,a){var r=(e||[]).length;if(r>2){for(var n=[],i=0;i<r-1;i++)n.push.apply(n,d($(e[i][0],e[i][1],e[i+1][0],e[i+1][1],a)));return t&&n.push.apply(n,d($(e[r-1][0],e[r-1][1],e[0][0],e[0][1],a))),{type:"path",ops:n}}return 2===r?E(e[0][0],e[0][1],e[1][0],e[1][1],a):{type:"path",ops:[]}}function q(e,t,a){var r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),n=Math.ceil(Math.max(a.curveStepCount,a.curveStepCount/Math.sqrt(200)*r)),i=2*Math.PI/n,s=Math.abs(e/2),o=Math.abs(t/2),l=1-a.curveFitting;return{increment:i,rx:s+=U(s*l,a),ry:o+=U(o*l,a)}}function B(e,t,a,r){var n=p(ee(r.increment,e,t,r.rx,r.ry,1,r.increment*N(.1,N(.4,1,a),a),a),2),i=n[0],s=n[1],o=J(i,null,a);if(!a.disableMultiStroke&&0!==a.roughness){var l=J(p(ee(r.increment,e,t,r.rx,r.ry,1.5,0,a),1)[0],null,a);o=o.concat(l)}return{estimatedPoints:s,opset:{type:"path",ops:o}}}function Y(e,t,a,r,n,i,s,o,l){var h=e,u=t,f=Math.abs(a/2),c=Math.abs(r/2);f+=U(.01*f,l),c+=U(.01*c,l);for(var p=n,v=i;p<0;)p+=2*Math.PI,v+=2*Math.PI;v-p>2*Math.PI&&(p=0,v=2*Math.PI);var g=2*Math.PI/l.curveStepCount,y=Math.min(g/2,(v-p)/2),m=te(y,h,u,f,c,p,v,1,l);if(!l.disableMultiStroke){var b=te(y,h,u,f,c,p,v,1.5,l);m.push.apply(m,d(b))}return s&&(o?m.push.apply(m,d($(h,u,h+f*Math.cos(p),u+c*Math.sin(p),l)).concat(d($(h,u,h+f*Math.cos(v),u+c*Math.sin(v),l)))):m.push({op:"lineTo",data:[h,u]},{op:"lineTo",data:[h+f*Math.cos(p),u+c*Math.sin(p)]})),{type:"path",ops:m}}function Z(e,t){var a,r=[],n=y(e);try{for(n.s();!(a=n.n()).done;){var i=a.value;if(i.length){var s=t.maxRandomnessOffset||0,o=i.length;if(o>2){r.push({op:"move",data:[i[0][0]+U(s,t),i[0][1]+U(s,t)]});for(var l=1;l<o;l++)r.push({op:"lineTo",data:[i[l][0]+U(s,t),i[l][1]+U(s,t)]})}}}}catch(e){n.e(e)}finally{n.f()}return{type:"fillPath",ops:r}}function H(e,t){return function(e,t){var a=e.fillStyle||"hachure";if(!C[a])switch(a){case"zigzag":C[a]||(C[a]=new w(t));break;case"cross-hatch":C[a]||(C[a]=new P(t));break;case"dots":C[a]||(C[a]=new D(t));break;case"dashed":C[a]||(C[a]=new R(t));break;case"zigzag-line":C[a]||(C[a]=new T(t));break;default:C[a="hachure"]||(C[a]=new O(t))}return C[a]}(t,I).fillPolygons(e,t)}function Q(e){return e.randomizer||(e.randomizer=new L(e.seed||0)),e.randomizer.next()}function N(e,t,a){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return a.roughness*r*(Q(a)*(t-e)+e)}function U(e,t){return N(-e,e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)}function $(e,t,a,r,n){var i=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?n.disableMultiStrokeFill:n.disableMultiStroke,s=X(e,t,a,r,n,!0,!1);if(i)return s;var o=X(e,t,a,r,n,!0,!0);return s.concat(o)}function X(e,t,a,r,n,i,s){var o,l=Math.pow(e-a,2)+Math.pow(t-r,2),h=Math.sqrt(l);o=h<200?1:h>500?.4:-.0016668*h+1.233334;var u=n.maxRandomnessOffset||0;u*u*100>l&&(u=h/10);var f=u/2,c=.2+.2*Q(n),p=n.bowing*n.maxRandomnessOffset*(r-t)/200,d=n.bowing*n.maxRandomnessOffset*(e-a)/200;p=U(p,n,o),d=U(d,n,o);var v=[],g=function(){return U(f,n,o)},y=function(){return U(u,n,o)},m=n.preserveVertices;return i&&(s?v.push({op:"move",data:[e+(m?0:g()),t+(m?0:g())]}):v.push({op:"move",data:[e+(m?0:U(u,n,o)),t+(m?0:U(u,n,o))]})),s?v.push({op:"bcurveTo",data:[p+e+(a-e)*c+g(),d+t+(r-t)*c+g(),p+e+2*(a-e)*c+g(),d+t+2*(r-t)*c+g(),a+(m?0:g()),r+(m?0:g())]}):v.push({op:"bcurveTo",data:[p+e+(a-e)*c+y(),d+t+(r-t)*c+y(),p+e+2*(a-e)*c+y(),d+t+2*(r-t)*c+y(),a+(m?0:y()),r+(m?0:y())]}),v}function K(e,t,a){var r=[];r.push([e[0][0]+U(t,a),e[0][1]+U(t,a)]),r.push([e[0][0]+U(t,a),e[0][1]+U(t,a)]);for(var n=1;n<e.length;n++)r.push([e[n][0]+U(t,a),e[n][1]+U(t,a)]),n===e.length-1&&r.push([e[n][0]+U(t,a),e[n][1]+U(t,a)]);return J(r,null,a)}function J(e,t,a){var r=e.length,n=[];if(r>3){var i=[],s=1-a.curveTightness;n.push({op:"move",data:[e[1][0],e[1][1]]});for(var o=1;o+2<r;o++){var l=e[o];i[0]=[l[0],l[1]],i[1]=[l[0]+(s*e[o+1][0]-s*e[o-1][0])/6,l[1]+(s*e[o+1][1]-s*e[o-1][1])/6],i[2]=[e[o+1][0]+(s*e[o][0]-s*e[o+2][0])/6,e[o+1][1]+(s*e[o][1]-s*e[o+2][1])/6],i[3]=[e[o+1][0],e[o+1][1]],n.push({op:"bcurveTo",data:[i[1][0],i[1][1],i[2][0],i[2][1],i[3][0],i[3][1]]})}if(t&&2===t.length){var h=a.maxRandomnessOffset;n.push({op:"lineTo",data:[t[0]+U(h,a),t[1]+U(h,a)]})}}else 3===r?(n.push({op:"move",data:[e[1][0],e[1][1]]}),n.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):2===r&&n.push.apply(n,d($(e[0][0],e[0][1],e[1][0],e[1][1],a)));return n}function ee(e,t,a,r,n,i,s,o){var l=[],h=[];if(0===o.roughness){e/=4,h.push([t+r*Math.cos(-e),a+n*Math.sin(-e)]);for(var u=0;u<=2*Math.PI;u+=e){var f=[t+r*Math.cos(u),a+n*Math.sin(u)];l.push(f),h.push(f)}h.push([t+r*Math.cos(0),a+n*Math.sin(0)]),h.push([t+r*Math.cos(e),a+n*Math.sin(e)])}else{var c=U(.5,o)-Math.PI/2;h.push([U(i,o)+t+.9*r*Math.cos(c-e),U(i,o)+a+.9*n*Math.sin(c-e)]);for(var p=2*Math.PI+c-.01,d=c;d<p;d+=e){var v=[U(i,o)+t+r*Math.cos(d),U(i,o)+a+n*Math.sin(d)];l.push(v),h.push(v)}h.push([U(i,o)+t+r*Math.cos(c+2*Math.PI+.5*s),U(i,o)+a+n*Math.sin(c+2*Math.PI+.5*s)]),h.push([U(i,o)+t+.98*r*Math.cos(c+s),U(i,o)+a+.98*n*Math.sin(c+s)]),h.push([U(i,o)+t+.9*r*Math.cos(c+.5*s),U(i,o)+a+.9*n*Math.sin(c+.5*s)])}return[h,l]}function te(e,t,a,r,n,i,s,o,l){var h=i+U(.1,l),u=[];u.push([U(o,l)+t+.9*r*Math.cos(h-e),U(o,l)+a+.9*n*Math.sin(h-e)]);for(var f=h;f<=s;f+=e)u.push([U(o,l)+t+r*Math.cos(f),U(o,l)+a+n*Math.sin(f)]);return u.push([t+r*Math.cos(s),a+n*Math.sin(s)]),u.push([t+r*Math.cos(s),a+n*Math.sin(s)]),J(u,null,l)}function ae(e){return d(e)}function re(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function ne(e,t,a){var r=re(t,a);if(0===r)return re(e,t);var n=((e[0]-t[0])*(a[0]-t[0])+(e[1]-t[1])*(a[1]-t[1]))/r;return re(e,ie(t,a,n=Math.max(0,Math.min(1,n))))}function ie(e,t,a){return[e[0]+(t[0]-e[0])*a,e[1]+(t[1]-e[1])*a]}function se(e,t,a,r){var n,i,s=r||[];if(function(e,t){var a=e[t+0],r=e[t+1],n=e[t+2],i=e[t+3],s=3*r[0]-2*a[0]-i[0];s*=s;var o=3*r[1]-2*a[1]-i[1];o*=o;var l=3*n[0]-2*i[0]-a[0];l*=l;var h=3*n[1]-2*i[1]-a[1];return s<l&&(s=l),o<(h*=h)&&(o=h),s+o}(e,t)<a){var o=e[t+0];s.length?(n=s[s.length-1],i=o,Math.sqrt(re(n,i))>1&&s.push(o)):s.push(o),s.push(e[t+3])}else{var l=.5,h=e[t+0],u=e[t+1],f=e[t+2],c=e[t+3],p=ie(h,u,l),d=ie(u,f,l),v=ie(f,c,l),g=ie(p,d,l),y=ie(d,v,l),m=ie(g,y,l);se([h,p,g,m],0,a,s),se([m,y,v,c],0,a,s)}return s}function oe(e,t){return le(e,0,e.length,t)}function le(e,t,a,r,n){for(var i=n||[],s=e[t],o=e[a-1],l=0,h=1,u=t+1;u<a-1;++u){var f=ne(e[u],s,o);f>l&&(l=f,h=u)}return Math.sqrt(l)>r?(le(e,t,h+1,r,i),le(e,h,a,r,i)):(i.length||i.push(s),i.push(o)),i}function he(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15,a=arguments.length>2?arguments[2]:void 0,r=[],n=(e.length-1)/3,i=0;i<n;i++)se(e,3*i,t,r);return a&&a>0?le(r,0,r.length,a):r}var ue="none",fe=function(){function e(t){i(this,e),this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}return o(e,[{key:"_o",value:function(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}},{key:"_d",value:function(e,t,a){return{shape:e,sets:t||[],options:a||this.defaultOptions}}},{key:"line",value:function(e,t,a,r,n){var i=this._o(n);return this._d("line",[E(e,t,a,r,i)],i)}},{key:"rectangle",value:function(e,t,a,r,n){var i=this._o(n),s=[],o=function(e,t,a,r,n){return function(e,t){return V(e,!0,t)}([[e,t],[e+a,t],[e+a,t+r],[e,t+r]],n)}(e,t,a,r,i);if(i.fill){var l=[[e,t],[e+a,t],[e+a,t+r],[e,t+r]];"solid"===i.fillStyle?s.push(Z([l],i)):s.push(H([l],i))}return i.stroke!==ue&&s.push(o),this._d("rectangle",s,i)}},{key:"ellipse",value:function(e,t,a,r,n){var i=this._o(n),s=[],o=q(a,r,i),l=B(e,t,i,o);if(i.fill)if("solid"===i.fillStyle){var h=B(e,t,i,o).opset;h.type="fillPath",s.push(h)}else s.push(H([l.estimatedPoints],i));return i.stroke!==ue&&s.push(l.opset),this._d("ellipse",s,i)}},{key:"circle",value:function(e,t,a,r){var n=this.ellipse(e,t,a,a,r);return n.shape="circle",n}},{key:"linearPath",value:function(e,t){var a=this._o(t);return this._d("linearPath",[V(e,!1,a)],a)}},{key:"arc",value:function(e,t,a,r,n,i){var s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o=arguments.length>7?arguments[7]:void 0,l=this._o(o),h=[],u=Y(e,t,a,r,n,i,s,!0,l);if(s&&l.fill)if("solid"===l.fillStyle){var f=Object.assign({},l);f.disableMultiStroke=!0;var c=Y(e,t,a,r,n,i,!0,!1,f);c.type="fillPath",h.push(c)}else h.push(function(e,t,a,r,n,i,s){var o=e,l=t,h=Math.abs(a/2),u=Math.abs(r/2);h+=U(.01*h,s),u+=U(.01*u,s);for(var f=n,c=i;f<0;)f+=2*Math.PI,c+=2*Math.PI;c-f>2*Math.PI&&(f=0,c=2*Math.PI);for(var p=(c-f)/s.curveStepCount,d=[],v=f;v<=c;v+=p)d.push([o+h*Math.cos(v),l+u*Math.sin(v)]);return d.push([o+h*Math.cos(c),l+u*Math.sin(c)]),d.push([o,l]),H([d],s)}(e,t,a,r,n,i,l));return l.stroke!==ue&&h.push(u),this._d("arc",h,l)}},{key:"curve",value:function(e,t){var a=this._o(t),r=[],n=function(e,t){var a=K(e,1*(1+.2*t.roughness),t);if(!t.disableMultiStroke){var r=K(e,1.5*(1+.22*t.roughness),function(e){var t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}(t));a=a.concat(r)}return{type:"path",ops:a}}(e,a);if(a.fill&&a.fill!==ue&&e.length>=3){var i=he(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=e.length;if(a<3)throw new Error("A curve must have at least three points.");var r=[];if(3===a)r.push(ae(e[0]),ae(e[1]),ae(e[2]),ae(e[2]));else{var n=[];n.push(e[0],e[0]);for(var i=1;i<e.length;i++)n.push(e[i]),i===e.length-1&&n.push(e[i]);var s=[],o=1-t;r.push(ae(n[0]));for(var l=1;l+2<n.length;l++){var h=n[l];s[0]=[h[0],h[1]],s[1]=[h[0]+(o*n[l+1][0]-o*n[l-1][0])/6,h[1]+(o*n[l+1][1]-o*n[l-1][1])/6],s[2]=[n[l+1][0]+(o*n[l][0]-o*n[l+2][0])/6,n[l+1][1]+(o*n[l][1]-o*n[l+2][1])/6],s[3]=[n[l+1][0],n[l+1][1]],r.push(s[1],s[2],s[3])}}return r}(e),10,(1+a.roughness)/2);"solid"===a.fillStyle?r.push(Z([i],a)):r.push(H([i],a))}return a.stroke!==ue&&r.push(n),this._d("curve",r,a)}},{key:"polygon",value:function(e,t){var a=this._o(t),r=[],n=V(e,!0,a);return a.fill&&("solid"===a.fillStyle?r.push(Z([e],a)):r.push(H([e],a))),a.stroke!==ue&&r.push(n),this._d("polygon",r,a)}},{key:"path",value:function(e,t){var a=this._o(t),r=[];if(!e)return this._d("path",r,a);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");var n=a.fill&&"transparent"!==a.fill&&a.fill!==ue,i=a.stroke!==ue,s=!!(a.simplification&&a.simplification<1),o=function(e,t,a){var r,n=A(F(G(e))),i=[],s=[],o=[0,0],l=[],h=function(){var e;l.length>=4&&(e=s).push.apply(e,d(he(l,1))),l=[]},u=function(){h(),s.length&&(i.push(s),s=[])},f=y(n);try{for(f.s();!(r=f.n()).done;){var c=r.value,p=c.key,v=c.data;switch(p){case"M":u(),o=[v[0],v[1]],s.push(o);break;case"L":h(),s.push([v[0],v[1]]);break;case"C":if(!l.length){var g=s.length?s[s.length-1]:o;l.push([g[0],g[1]])}l.push([v[0],v[1]]),l.push([v[2],v[3]]),l.push([v[4],v[5]]);break;case"Z":h(),s.push([o[0],o[1]])}}}catch(e){f.e(e)}finally{f.f()}if(u(),!a)return i;for(var m=[],b=0,k=i;b<k.length;b++){var M=oe(k[b],a);M.length&&m.push(M)}return m}(e,0,s?4-4*a.simplification:(1+a.roughness)/2);return n&&("solid"===a.fillStyle?r.push(Z(o,a)):r.push(H(o,a))),i&&(s?o.forEach((function(e){r.push(V(e,!1,a))})):r.push(function(e,t){var a,r=A(F(G(e))),n=[],i=[0,0],s=[0,0],o=y(r);try{var l=function(){var e=a.value,r=e.key,o=e.data;switch(r){case"M":var l=1*(t.maxRandomnessOffset||0),h=t.preserveVertices;n.push({op:"move",data:o.map((function(e){return e+(h?0:U(l,t))}))}),s=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push.apply(n,d($(s[0],s[1],o[0],o[1],t))),s=[o[0],o[1]];break;case"C":var u=p(o,6),f=u[0],c=u[1],v=u[2],g=u[3],y=u[4],m=u[5];n.push.apply(n,d(function(e,t,a,r,n,i,s,o){for(var l=[],h=[o.maxRandomnessOffset||1,(o.maxRandomnessOffset||1)+.3],u=[0,0],f=o.disableMultiStroke?1:2,c=o.preserveVertices,p=0;p<f;p++)0===p?l.push({op:"move",data:[s[0],s[1]]}):l.push({op:"move",data:[s[0]+(c?0:U(h[0],o)),s[1]+(c?0:U(h[0],o))]}),u=c?[n,i]:[n+U(h[p],o),i+U(h[p],o)],l.push({op:"bcurveTo",data:[e+U(h[p],o),t+U(h[p],o),a+U(h[p],o),r+U(h[p],o),u[0],u[1]]});return l}(f,c,v,g,y,m,s,t))),s=[y,m];break;case"Z":n.push.apply(n,d($(s[0],s[1],i[0],i[1],t))),s=[i[0],i[1]]}};for(o.s();!(a=o.n()).done;)l()}catch(e){o.e(e)}finally{o.f()}return{type:"path",ops:n}}(e,a))),this._d("path",r,a)}},{key:"opsToPath",value:function(e,t){var a,r="",n=y(e.ops);try{for(n.s();!(a=n.n()).done;){var i=a.value,s="number"==typeof t&&t>=0?i.data.map((function(e){return+e.toFixed(t)})):i.data;switch(i.op){case"move":r+="M".concat(s[0]," ").concat(s[1]," ");break;case"bcurveTo":r+="C".concat(s[0]," ").concat(s[1],", ").concat(s[2]," ").concat(s[3],", ").concat(s[4]," ").concat(s[5]," ");break;case"lineTo":r+="L".concat(s[0]," ").concat(s[1]," ")}}}catch(e){n.e(e)}finally{n.f()}return r.trim()}},{key:"toPaths",value:function(e){var t,a=e.sets||[],r=e.options||this.defaultOptions,n=[],i=y(a);try{for(i.s();!(t=i.n()).done;){var s=t.value,o=null;switch(s.type){case"path":o={d:this.opsToPath(s),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:ue};break;case"fillPath":o={d:this.opsToPath(s),stroke:ue,strokeWidth:0,fill:r.fill||ue};break;case"fillSketch":o=this.fillSketch(s,r)}o&&n.push(o)}}catch(e){i.e(e)}finally{i.f()}return n}},{key:"fillSketch",value:function(e,t){var a=t.fillWeight;return a<0&&(a=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||ue,strokeWidth:a,fill:ue}}}],[{key:"newSeed",value:function(){return Math.floor(Math.random()*Math.pow(2,31))}}]),e}(),ce=function(){function e(t,a){i(this,e),this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new fe(a)}return o(e,[{key:"draw",value:function(e){var t,a=e.sets||[],r=e.options||this.getDefaultOptions(),n=this.ctx,i=e.options.fixedDecimalPlaceDigits,s=y(a);try{for(s.s();!(t=s.n()).done;){var o=t.value;switch(o.type){case"path":n.save(),n.strokeStyle="none"===r.stroke?"transparent":r.stroke,n.lineWidth=r.strokeWidth,r.strokeLineDash&&n.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(n.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(n,o,i),n.restore();break;case"fillPath":n.save(),n.fillStyle=r.fill||"";var l="curve"===e.shape||"polygon"===e.shape||"path"===e.shape?"evenodd":"nonzero";this._drawToContext(n,o,i,l),n.restore();break;case"fillSketch":this.fillSketch(n,o,r)}}}catch(e){s.e(e)}finally{s.f()}}},{key:"fillSketch",value:function(e,t,a){var r=a.fillWeight;r<0&&(r=a.strokeWidth/2),e.save(),a.fillLineDash&&e.setLineDash(a.fillLineDash),a.fillLineDashOffset&&(e.lineDashOffset=a.fillLineDashOffset),e.strokeStyle=a.fill||"",e.lineWidth=r,this._drawToContext(e,t,a.fixedDecimalPlaceDigits),e.restore()}},{key:"_drawToContext",value:function(e,t,a){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"nonzero";e.beginPath();var n,i=y(t.ops);try{for(i.s();!(n=i.n()).done;){var s=n.value,o="number"==typeof a&&a>=0?s.data.map((function(e){return+e.toFixed(a)})):s.data;switch(s.op){case"move":e.moveTo(o[0],o[1]);break;case"bcurveTo":e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":e.lineTo(o[0],o[1])}}}catch(e){i.e(e)}finally{i.f()}"fillPath"===t.type?e.fill(r):e.stroke()}},{key:"generator",get:function(){return this.gen}},{key:"getDefaultOptions",value:function(){return this.gen.defaultOptions}},{key:"line",value:function(e,t,a,r,n){var i=this.gen.line(e,t,a,r,n);return this.draw(i),i}},{key:"rectangle",value:function(e,t,a,r,n){var i=this.gen.rectangle(e,t,a,r,n);return this.draw(i),i}},{key:"ellipse",value:function(e,t,a,r,n){var i=this.gen.ellipse(e,t,a,r,n);return this.draw(i),i}},{key:"circle",value:function(e,t,a,r){var n=this.gen.circle(e,t,a,r);return this.draw(n),n}},{key:"linearPath",value:function(e,t){var a=this.gen.linearPath(e,t);return this.draw(a),a}},{key:"polygon",value:function(e,t){var a=this.gen.polygon(e,t);return this.draw(a),a}},{key:"arc",value:function(e,t,a,r,n,i){var s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o=arguments.length>7?arguments[7]:void 0,l=this.gen.arc(e,t,a,r,n,i,s,o);return this.draw(l),l}},{key:"curve",value:function(e,t){var a=this.gen.curve(e,t);return this.draw(a),a}},{key:"path",value:function(e,t){var a=this.gen.path(e,t);return this.draw(a),a}}]),e}(),pe=function(e,t){return new ce(e,t)};const de={maxRandomnessOffset:3,roughness:1,bowing:1,curveFitting:.95,curveTightness:void 0,curveStepCount:9,fillStyle:"hachure",fillWeight:void 0,hachureAngle:60,hachureGap:6,simplification:0,dashOffset:void 0,dashGap:void 0,zigzagOffset:void 0,seed:1,fillLineDash:void 0,fillLineDashOffset:void 0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!0,fixedDecimalPlaceDigits:void 0};let ve=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="arc",this.numberType=a.ARC_NUMBER_TYPE}draw(e,t,r,n){const{context:i}=r;if(!i)return;const s=i.canvas.nativeCanvas,o=pe(s);i.highPerformanceSave();const l=a.getTheme(e).arc;let{x:h=l.x,y:u=l.y}=e.attribute;if(e.transMatrix.onlyTranslate()){const{dx:t=l.dx,dy:a=l.dy}=e.attribute;h+=t,u+=a,i.setTransformForCurrent()}else h=0,u=0,i.transformFromMatrix(e.transMatrix,!0);const f=new a.CustomPath2D,{fill:c=l.fill,stroke:p=l.stroke,lineWidth:d=l.lineWidth,outerRadius:v=l.outerRadius,innerRadius:g=l.innerRadius,maxRandomnessOffset:y=de.maxRandomnessOffset,roughness:m=de.roughness,bowing:b=de.bowing,curveFitting:k=de.curveFitting,curveTightness:M=de.curveTightness,curveStepCount:S=de.curveStepCount,fillStyle:x=de.fillStyle,fillWeight:O=de.fillWeight,hachureAngle:w=de.hachureAngle,hachureGap:P=de.hachureGap,simplification:D=de.simplification,dashOffset:R=de.dashOffset,dashGap:T=de.dashGap,zigzagOffset:C=de.zigzagOffset,seed:L=de.seed,fillLineDash:z=de.fillLineDash,fillLineDashOffset:W=de.fillLineDashOffset,disableMultiStroke:G=de.disableMultiStroke,disableMultiStrokeFill:F=de.disableMultiStrokeFill,preserveVertices:A=de.preserveVertices,fixedDecimalPlaceDigits:j=de.fixedDecimalPlaceDigits}=e.attribute;a.drawArcPath(e,f,h,u,v,g),o.path(f.toString(),{fill:c||void 0,stroke:p||void 0,strokeWidth:d,maxRandomnessOffset:y,roughness:m,bowing:b,curveFitting:k,curveTightness:M,curveStepCount:S,fillStyle:x,fillWeight:O,hachureAngle:w,hachureGap:P,simplification:D,dashOffset:R,dashGap:T,zigzagOffset:C,seed:L,fillLineDash:z,fillLineDashOffset:W,disableMultiStroke:G,disableMultiStrokeFill:F,preserveVertices:A,fixedDecimalPlaceDigits:j}),i.highPerformanceRestore()}drawShape(e,t,a,r,n,i,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,n,i,s,o)}};ve=m([r.injectable(),b(0,r.inject(a.DefaultCanvasArcRender)),k("design:paramtypes",[Object])],ve);let ge=class extends a.DefaultCanvasAreaRender{style="rough";drawSegmentItem(e,t,r,n,i,s,o,l,h,u,f,c){if(c)return super.drawSegmentItem(e,t,r,n,i,s,o,l,h,u,f,c);e.highPerformanceSave();const p=e.canvas.nativeCanvas,d=pe(p,{}),v=new a.CustomPath2D;a.drawAreaSegments(v,t,o,{offsetX:l,offsetY:h});const{maxRandomnessOffset:g=de.maxRandomnessOffset,roughness:y=de.roughness,bowing:m=de.bowing,curveFitting:b=de.curveFitting,curveTightness:k=de.curveTightness,curveStepCount:M=de.curveStepCount,fillStyle:S=de.fillStyle,fillWeight:x=de.fillWeight,hachureAngle:O=de.hachureAngle,hachureGap:w=de.hachureGap,simplification:P=de.simplification,dashOffset:D=de.dashOffset,dashGap:R=de.dashGap,zigzagOffset:T=de.zigzagOffset,seed:C=de.seed,fillLineDash:L=de.fillLineDash,fillLineDashOffset:z=de.fillLineDashOffset,disableMultiStroke:W=de.disableMultiStroke,disableMultiStrokeFill:G=de.disableMultiStrokeFill,preserveVertices:F=de.preserveVertices,fixedDecimalPlaceDigits:A=de.fixedDecimalPlaceDigits}=i;let{fill:j,stroke:_,lineWidth:I}=i;return Array.isArray(s)?s.forEach((e=>{j=j??e.fill,_=_??e.stroke,I=I??e.lineWidth})):(j=j??s.fill,_=_??s.stroke,I=I??s.lineWidth),d.path(v.toString(),{fill:r?j:void 0,strokeWidth:I,maxRandomnessOffset:g,roughness:y,bowing:m,curveFitting:b,curveTightness:k,curveStepCount:M,fillStyle:S,fillWeight:x,hachureAngle:O,hachureGap:w,simplification:P,dashOffset:D,dashGap:R,zigzagOffset:T,seed:C,fillLineDash:L,fillLineDashOffset:z,disableMultiStroke:W,disableMultiStrokeFill:G,preserveVertices:F,fixedDecimalPlaceDigits:A}),e.highPerformanceRestore(),!1}};ge=m([r.injectable()],ge);let ye=class{canvasRenderer;style="rough";constructor(e){this.canvasRenderer=e,this.type="circle",this.numberType=a.CIRCLE_NUMBER_TYPE}draw(e,t,r,n){const{context:i}=r;if(!i)return;const s=i.canvas.nativeCanvas,o=pe(s,{}),l=a.getTheme(e).circle;let{x:h=l.x,y:u=l.y}=e.attribute;e.transMatrix.onlyTranslate()?i.onlyTranslate()||i.clearMatrix():(h=0,u=0,i.transformFromMatrix(e.transMatrix,!0));const{radius:f=l.radius,fill:c=l.fill,stroke:p=l.stroke,lineWidth:d=l.lineWidth}=e.attribute;o.circle(h,u,f,{fill:c||void 0,stroke:p||void 0,strokeWidth:d,fillStyle:"zigzag",roughness:.5})}drawShape(e,t,a,r,n,i,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,n,i,s,o)}};ye=m([r.injectable(),b(0,r.inject(a.DefaultCanvasCircleRender)),k("design:paramtypes",[Object])],ye);let me=class extends a.DefaultCanvasLineRender{style="rough";drawSegmentItem(e,t,r,n,i,s,o,l,h,u,f,c,p,d,v){if(d||v)return super.drawSegmentItem(e,t,r,n,i,s,o,l,h,u,f,c,p,d,v);e.highPerformanceSave();const g=e.canvas.nativeCanvas,y=pe(g,{}),m=new a.CustomPath2D;a.drawSegments(e.camera?e:e.nativeContext,t,h,u,{offsetX:f,offsetY:c});const{maxRandomnessOffset:b=de.maxRandomnessOffset,roughness:k=de.roughness,bowing:M=de.bowing,curveFitting:S=de.curveFitting,curveTightness:x=de.curveTightness,curveStepCount:O=de.curveStepCount,fillStyle:w=de.fillStyle,fillWeight:P=de.fillWeight,hachureAngle:D=de.hachureAngle,hachureGap:R=de.hachureGap,simplification:T=de.simplification,dashOffset:C=de.dashOffset,dashGap:L=de.dashGap,zigzagOffset:z=de.zigzagOffset,seed:W=de.seed,fillLineDash:G=de.fillLineDash,fillLineDashOffset:F=de.fillLineDashOffset,disableMultiStroke:A=de.disableMultiStroke,disableMultiStrokeFill:j=de.disableMultiStrokeFill,preserveVertices:_=de.preserveVertices,fixedDecimalPlaceDigits:I=de.fixedDecimalPlaceDigits}=o;let{fill:E,stroke:V,lineWidth:q}=o;return Array.isArray(l)?l.forEach((e=>{E=E??e.fill,V=V??e.stroke,q=q??e.lineWidth})):(E=E??l.fill,V=V??l.stroke,q=q??l.lineWidth),y.path(m.toString(),{fill:r?E:void 0,stroke:n?V:void 0,strokeWidth:q,maxRandomnessOffset:b,roughness:k,bowing:M,curveFitting:S,curveTightness:x,curveStepCount:O,fillStyle:w,fillWeight:P,hachureAngle:D,hachureGap:R,simplification:T,dashOffset:C,dashGap:L,zigzagOffset:z,seed:W,fillLineDash:G,fillLineDashOffset:F,disableMultiStroke:A,disableMultiStrokeFill:j,preserveVertices:_,fixedDecimalPlaceDigits:I}),e.highPerformanceRestore(),!1}};me=m([r.injectable()],me);let be=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="path",this.numberType=a.PATH_NUMBER_TYPE}draw(e,t,r,n){const{context:i}=r;if(!i)return;const s=i.canvas.nativeCanvas,o=pe(s,{});i.highPerformanceSave();const l=a.getTheme(e).path;i.transformFromMatrix(e.transMatrix,!0);const{fill:h=l.fill,stroke:u=l.stroke,lineWidth:f=l.lineWidth,path:c=l.path,maxRandomnessOffset:p=de.maxRandomnessOffset,roughness:d=de.roughness,bowing:v=de.bowing,curveFitting:g=de.curveFitting,curveTightness:y=de.curveTightness,curveStepCount:m=de.curveStepCount,fillStyle:b=de.fillStyle,fillWeight:k=de.fillWeight,hachureAngle:M=de.hachureAngle,hachureGap:S=de.hachureGap,simplification:x=de.simplification,dashOffset:O=de.dashOffset,dashGap:w=de.dashGap,zigzagOffset:P=de.zigzagOffset,seed:D=de.seed,fillLineDash:R=de.fillLineDash,fillLineDashOffset:T=de.fillLineDashOffset,disableMultiStroke:C=de.disableMultiStroke,disableMultiStrokeFill:L=de.disableMultiStrokeFill,preserveVertices:z=de.preserveVertices,fixedDecimalPlaceDigits:W=de.fixedDecimalPlaceDigits}=e.attribute;"string"==typeof c&&o.path(c,{fill:h||void 0,stroke:u||void 0,strokeWidth:f,maxRandomnessOffset:p,roughness:d,bowing:v,curveFitting:g,curveTightness:y,curveStepCount:m,fillStyle:b,fillWeight:k,hachureAngle:M,hachureGap:S,simplification:x,dashOffset:O,dashGap:w,zigzagOffset:P,seed:D,fillLineDash:R,fillLineDashOffset:T,disableMultiStroke:C,disableMultiStrokeFill:L,preserveVertices:z,fixedDecimalPlaceDigits:W}),i.highPerformanceRestore()}drawShape(e,t,a,r,n,i,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,n,i,s,o)}};be=m([r.injectable(),b(0,r.inject(a.DefaultCanvasPathRender)),k("design:paramtypes",[Object])],be);let ke=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="rect",this.numberType=a.RECT_NUMBER_TYPE}draw(e,t,r,n){const{context:i}=r;if(!i)return;const s=i.canvas.nativeCanvas,o=pe(s);i.highPerformanceSave();const l=a.getTheme(e).rect;let{x:h=l.x,y:u=l.y}=e.attribute;if(e.transMatrix.onlyTranslate()){const{dx:t=l.dx,dy:a=l.dy}=e.attribute;h+=t,u+=a,i.setTransformForCurrent()}else h=0,u=0,i.transformFromMatrix(e.transMatrix,!0);const{fill:f=l.fill,stroke:c=l.stroke,fillColor:p=l.fill,strokeColor:d=l.stroke,width:v=l.width,height:g=l.height,lineWidth:y=l.lineWidth,maxRandomnessOffset:m=de.maxRandomnessOffset,roughness:b=de.roughness,bowing:k=de.bowing,curveFitting:M=de.curveFitting,curveTightness:S=de.curveTightness,curveStepCount:x=de.curveStepCount,fillStyle:O=de.fillStyle,fillWeight:w=de.fillWeight,hachureAngle:P=de.hachureAngle,hachureGap:D=de.hachureGap,simplification:R=de.simplification,dashOffset:T=de.dashOffset,dashGap:C=de.dashGap,zigzagOffset:L=de.zigzagOffset,seed:z=de.seed,fillLineDash:W=de.fillLineDash,fillLineDashOffset:G=de.fillLineDashOffset,disableMultiStroke:F=de.disableMultiStroke,disableMultiStrokeFill:A=de.disableMultiStrokeFill,preserveVertices:j=de.preserveVertices,fixedDecimalPlaceDigits:_=de.fixedDecimalPlaceDigits}=e.attribute;o.rectangle(h,u,v,g,{fill:f?p:void 0,stroke:c?d:void 0,strokeWidth:y,maxRandomnessOffset:m,roughness:b,bowing:k,curveFitting:M,curveTightness:S,curveStepCount:x,fillStyle:O,fillWeight:w,hachureAngle:P,hachureGap:D,simplification:R,dashOffset:T,dashGap:C,zigzagOffset:L,seed:z,fillLineDash:W,fillLineDashOffset:G,disableMultiStroke:F,disableMultiStrokeFill:A,preserveVertices:j,fixedDecimalPlaceDigits:_}),i.highPerformanceRestore()}drawShape(e,t,a,r,n,i,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,n,i,s,o)}};ke=m([r.injectable(),b(0,r.inject(a.DefaultCanvasRectRender)),k("design:paramtypes",[Object])],ke);let Me=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="symbol",this.numberType=a.SYMBOL_NUMBER_TYPE}draw(e,t,r,n){const{context:i}=r;if(!i)return;const s=i.canvas.nativeCanvas,o=pe(s);i.highPerformanceSave();const l=a.getTheme(e).symbol;let{x:h=l.x,y:u=l.y}=e.attribute;if(e.transMatrix.onlyTranslate()){const{dx:t=l.dx,dy:a=l.dy}=e.attribute;h+=t,u+=a,i.setTransformForCurrent()}else h=0,u=0,i.transformFromMatrix(e.transMatrix,!0);const f=e.getParsedPath();if(!f)return;const{fill:c=l.fill,stroke:p=l.stroke,fillColor:d=l.fill,strokeColor:v=l.stroke,size:g=l.size,lineWidth:y=l.lineWidth,maxRandomnessOffset:m=de.maxRandomnessOffset,roughness:b=de.roughness,bowing:k=de.bowing,curveFitting:M=de.curveFitting,curveTightness:S=de.curveTightness,curveStepCount:x=de.curveStepCount,fillStyle:O=de.fillStyle,fillWeight:w=de.fillWeight,hachureAngle:P=de.hachureAngle,hachureGap:D=de.hachureGap,simplification:R=de.simplification,dashOffset:T=de.dashOffset,dashGap:C=de.dashGap,zigzagOffset:L=de.zigzagOffset,seed:z=de.seed,fillLineDash:W=de.fillLineDash,fillLineDashOffset:G=de.fillLineDashOffset,disableMultiStroke:F=de.disableMultiStroke,disableMultiStrokeFill:A=de.disableMultiStrokeFill,preserveVertices:j=de.preserveVertices,fixedDecimalPlaceDigits:_=de.fixedDecimalPlaceDigits}=e.attribute,I=new a.CustomPath2D;f.draw(I,g,h,u)&&I.closePath(),o.path(I.toString(),{fill:c?d:void 0,stroke:p?v:void 0,strokeWidth:y,maxRandomnessOffset:m,roughness:b,bowing:k,curveFitting:M,curveTightness:S,curveStepCount:x,fillStyle:O,fillWeight:w,hachureAngle:P,hachureGap:D,simplification:R,dashOffset:T,dashGap:C,zigzagOffset:L,seed:z,fillLineDash:W,fillLineDashOffset:G,disableMultiStroke:F,disableMultiStrokeFill:A,preserveVertices:j,fixedDecimalPlaceDigits:_}),i.highPerformanceRestore()}drawShape(e,t,a,r,n,i,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,n,i,s,o)}};Me=m([r.injectable(),b(0,r.inject(a.DefaultCanvasSymbolRender)),k("design:paramtypes",[Object])],Me);const Se=new r.ContainerModule(((e,t,r,n)=>{e(ye).toSelf().inSingletonScope(),e(a.GraphicRender).to(ye),e(ke).toSelf().inSingletonScope(),e(a.GraphicRender).to(ke),e(be).toSelf().inSingletonScope(),e(a.GraphicRender).to(be),e(Me).toSelf().inSingletonScope(),e(a.GraphicRender).to(Me),e(me).toSelf().inSingletonScope(),e(a.GraphicRender).to(me),e(ge).toSelf().inSingletonScope(),e(a.GraphicRender).to(ge),e(ve).toSelf().inSingletonScope(),e(a.GraphicRender).to(ve)}));e.roughModule=Se}));
{
"name": "@visactor/vrender-kits",
"version": "0.11.0-alpha.1",
"version": "0.11.0-alpha.2",
"description": "",

@@ -15,3 +15,3 @@ "sideEffects": false,

"dependencies": {
"@visactor/vrender": "0.11.0-alpha.1",
"@visactor/vrender": "0.11.0-alpha.2",
"@visactor/vutils": "~0.9.2-alpha.5",

@@ -63,7 +63,3 @@ "@resvg/resvg-js": "2.4.1",

"exports": {
"node": {
"import": "./es/index-node.js",
"require": "./cjs/index-node.js"
},
"default": {
".": {
"import": "./es/index.js",

@@ -70,0 +66,0 @@ "require": "./cjs/index.js"

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc