@antv/util
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -1,1 +0,1 @@ | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).util={})}(this,function(t){"use strict";function n(t){return[parseInt(t.substr(1,2),16),parseInt(t.substr(3,2),16),parseInt(t.substr(5,2),16)]}function r(t){t=Math.round(t).toString(16);return 1===t.length?"0"+t:t}function u(t){return"#"+r(t[0])+r(t[1])+r(t[2])}var a,z=/rgba?\(([\s.,0-9]+)\)/;function e(t){if("#"===t[0]&&7===t.length)return t;a||((n=document.createElement("i")).title="Web Colour Picker",n.style.display="none",document.body.appendChild(n),a=n),a.style.color=t;var n=document.defaultView.getComputedStyle(a,"").getPropertyValue("color");return u(z.exec(n)[1].split(/\s*,\s*/).map(function(t){return Number(t)}))}function i(t,n,r,a){return t[a]+(n[a]-t[a])*r}var N=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,V=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Z=/[\d.]+:(#[^\s]+|[^)]+\))/gi;var o="undefined"!=typeof Float32Array?Float32Array:Array;function l(t,n,r){var a=n[0],e=n[1],o=n[2],u=n[3],i=n[4],c=n[5],h=n[6],s=n[7],n=n[8],f=r[0],l=r[1],p=r[2],x=r[3],y=r[4],v=r[5],g=r[6],M=r[7],r=r[8];return t[0]=f*a+l*u+p*h,t[1]=f*e+l*i+p*s,t[2]=f*o+l*c+p*n,t[3]=x*a+y*u+v*h,t[4]=x*e+y*i+v*s,t[5]=x*o+y*c+v*n,t[6]=g*a+M*u+r*h,t[7]=g*e+M*i+r*s,t[8]=g*o+M*c+r*n,t}function c(){var t=new o(3);return o!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function h(t,n,r){var a=new o(3);return a[0]=t,a[1]=n,a[2]=r,a}Math.hypot||(Math.hypot=function(){for(var t=0,n=arguments.length;n--;)t+=arguments[n]*arguments[n];return Math.sqrt(t)});function s(){var t=new o(4);return o!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}c(),v=new o(4),o!=Float32Array&&(v[0]=0,v[1]=0,v[2]=0,v[3]=0);function b(t,n,r){return t[0]=n[0]+r[0],t[1]=n[1]+r[1],t}function A(t,n,r){return t[0]=Math.min(n[0],r[0]),t[1]=Math.min(n[1],r[1]),t}function w(t,n,r){return t[0]=Math.max(n[0],r[0]),t[1]=Math.max(n[1],r[1]),t}function P(t,n,r){return t[0]=n[0]*r,t[1]=n[1]*r,t}function T(t,n){var r=n[0]-t[0],n=n[1]-t[1];return Math.hypot(r,n)}c(),h(1,0,0),h(0,1,0),s(),s(),v=new o(9),o!=Float32Array&&(v[1]=0,v[2]=0,v[3]=0,v[5]=0,v[6]=0,v[7]=0),v[0]=1,v[4]=1,v[8]=1;var k=function(t,n,r){return t[0]=n[0]-r[0],t[1]=n[1]-r[1],t};function R(t,n,r){var a,e,o=[0,0,0,0,0,0,0,0,0];a=o,r=r,e=Math.sin(r),r=Math.cos(r),a[0]=r,a[1]=e,a[2]=0,a[3]=-e,a[4]=r,a[5]=0,a[6]=0,a[7]=0,a[8]=1,l(t,o,n)}function f(t,n){return t[0]*n[1]-n[0]*t[1]}v=new o(2),o!=Float32Array&&(v[0]=0,v[1]=0);var H=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,E=/[^\s,]+/gi;function C(t){var a=t||[];return Array.isArray(a)?a:"string"==typeof a?((a=a.match(H)).forEach(function(r,t){var n;1<(r=r.match(E))[0].length&&(n=r[0].charAt(0),r.splice(1,0,r[0].substr(1)),r[0]=n),r.forEach(function(t,n){isNaN(t)||(r[n]=+t)}),a[t]=r}),a):void 0}function X(t,n){var o=[],u=[];return t.length&&function t(n,r){if(1===n.length)o.push(n[0]),u.push(n[0]);else{for(var a=[],e=0;e<n.length-1;e++)0===e&&o.push(n[0]),e===n.length-2&&u.push(n[e+1]),a[e]=[(1-r)*n[e][0]+r*n[e+1][0],(1-r)*n[e][1]+r*n[e+1][1]];t(a,r)}}(t,n),{left:o,right:u.reverse()}}function Y(t,n,r){if(1===r)return[[].concat(t)];var a=[];if("L"===n[0]||"C"===n[0]||"Q"===n[0])a=a.concat(function(t,n,r){for(var t=[[t[1],t[2]]],a=(r=r||2,[]),e=("A"===n[0]?(t.push(n[6]),t.push(n[7])):"C"===n[0]?(t.push([n[1],n[2]]),t.push([n[3],n[4]]),t.push([n[5],n[6]])):"S"===n[0]||"Q"===n[0]?(t.push([n[1],n[2]]),t.push([n[3],n[4]])):t.push([n[1],n[2]]),t),o=1/r,u=0;u<r-1;u++){var i=X(e,o/(1-o*u));a.push(i.left),e=i.right}return a.push(e),a.map(function(t){var n=[];return 4===t.length&&(n.push("C"),n=n.concat(t[2])),3<=t.length&&(3===t.length&&n.push("Q"),n=n.concat(t[1])),2===t.length&&n.push("L"),n=n.concat(t[t.length-1])})}(t,n,r));else{var e=[].concat(t);"M"===e[0]&&(e[0]="L");for(var o=0;o<=r-1;o++)a.push(e)}return a}var B=function t(n,r){if(n===r)return!0;if(n&&r&&"object"==typeof n&&"object"==typeof r){if(n.constructor!==r.constructor)return!1;var a,e,o;if(Array.isArray(n)){if((a=n.length)!=r.length)return!1;for(e=a;0!=e--;)if(!t(n[e],r[e]))return!1;return!0}if(n.constructor===RegExp)return n.source===r.source&&n.flags===r.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===r.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===r.toString();if((a=(o=Object.keys(n)).length)!==Object.keys(r).length)return!1;for(e=a;0!=e--;)if(!Object.prototype.hasOwnProperty.call(r,o[e]))return!1;for(e=a;0!=e--;){var u=o[e];if(!t(n[u],r[u]))return!1}return!0}return n!=n&&r!=r};function p(t){var n=[];switch(t[0]){case"M":case"L":n.push([t[1],t[2]]);break;case"A":n.push([t[6],t[7]]);break;case"Q":n.push([t[3],t[4]]),n.push([t[1],t[2]]);break;case"T":n.push([t[1],t[2]]);break;case"C":n.push([t[5],t[6]]),n.push([t[1],t[2]]),n.push([t[3],t[4]]);break;case"S":n.push([t[3],t[4]]),n.push([t[1],t[2]]);break;case"H":case"V":n.push([t[1],t[1]])}return n}function x(t,n,r){for(var a,e=[].concat(t),o=1/(r+1),u=p(n)[0],i=1;i<=r;i++)o*=i,0===(a=Math.floor(t.length*o))?e.unshift([u[0]*o+t[a][0]*(1-o),u[1]*o+t[a][1]*(1-o)]):e.splice(a,0,[u[0]*o+t[a][0]*(1-o),u[1]*o+t[a][1]*(1-o)]);return e}function y(t,n,r,a,e){return e?[["M",+t+ +e,n],["l",r-2*e,0],["a",e,e,0,0,1,e,e],["l",0,a-2*e],["a",e,e,0,0,1,-e,e],["l",2*e-r,0],["a",e,e,0,0,1,-e,-e],["l",0,2*e-a],["a",e,e,0,0,1,e,-e],["z"]]:[["M",t,n],["l",r,0],["l",0,a],["l",-r,0],["z"]]}var v="\t\n\v\f\r \u2028\u2029",G=new RegExp("([a-z])["+v+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+v+"]*,?["+v+"]*)+)","ig"),_=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+v+"]*,?["+v+"]*","ig");function d(t){if(!t)return null;if(Array.isArray(t))return t;var o={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},u=[];return String(t).replace(G,function(t,n,r){var a=[],e=n.toLowerCase();if(r.replace(_,function(t,n){n&&a.push(+n)}),"m"===e&&2<a.length&&(u.push([n].concat(a.splice(0,2))),e="l",n="m"===n?"l":"L"),"o"===e&&1===a.length&&u.push([n,a[0]]),"r"===e)u.push([n].concat(a));else for(;a.length>=o[e]&&(u.push([n].concat(a.splice(0,o[e]))),o[e]););return""}),u}var D=/[a-z]/;function U(t,n){return[n[0]+(n[0]-t[0]),n[1]+(n[1]-t[1])]}function W(t){var n=d(t);if(!n||!n.length)return[["M",0,0]];for(var r=!1,a=0;a<n.length;a++){var e=n[a][0];if(D.test(e)||0<=["V","H","T","S"].indexOf(e)){r=!0;break}}if(!r)return n;var o=[],u=0,i=0,c=0,h=0,t=0,s=n[0];"M"!==s[0]&&"m"!==s[0]||(c=u=+s[1],h=i=+s[2],t++,o[0]=["M",u,i]);for(var a=t,f=n.length;a<f;a++){var l=n[a],p=o[a-1],x=[],y=(e=l[0]).toUpperCase();if(e!==y)switch(x[0]=y){case"A":x[1]=l[1],x[2]=l[2],x[3]=l[3],x[4]=l[4],x[5]=l[5],x[6]=+l[6]+u,x[7]=+l[7]+i;break;case"V":x[1]=+l[1]+i;break;case"H":x[1]=+l[1]+u;break;case"M":c=+l[1]+u,h=+l[2]+i,x[1]=c,x[2]=h;break;default:for(var v=1,g=l.length;v<g;v++)x[v]=+l[v]+(v%2?u:i)}else x=n[a];switch(y){case"Z":u=+c,i=+h;break;case"H":x=["L",u=x[1],i];break;case"V":x=["L",u,i=x[1]];break;case"T":var u=x[1],i=x[2],M=U([p[1],p[2]],[p[3],p[4]]),x=["Q",M[0],M[1],u,i];break;case"S":u=x[x.length-2],i=x[x.length-1];var M=p.length,m=U([p[M-4],p[M-3]],[p[M-2],p[M-1]]);x=["C",m[0],m[1],x[1],x[2],u,i];break;case"M":c=x[x.length-2],h=x[x.length-1];break;default:u=x[x.length-2],i=x[x.length-1]}o.push(x)}return o}function $(t,n,r,a){var e=t*r+n*a;return(e=1<e?1:e)<-1&&(e=-1),(t*a-n*r<0?-1:1)*Math.acos(e)}function J(t){var n=t.px,r=t.py,a=t.cx,e=t.cy,o=t.rx,u=t.ry,i=void 0===(i=t.xAxisRotation)?0:i,c=void 0===(c=t.largeArcFlag)?0:c,t=void 0===(t=t.sweepFlag)?0:t,h=[];if(0===o||0===u)return[{x1:0,y1:0,x2:0,y2:0,x:a,y:e}];var s=Math.sin(i*F/360),f=Math.cos(i*F/360),l=-s*(n-a)/2+f*(r-e)/2;if(0==(i=f*(n-a)/2+s*(r-e)/2)&&0==l)return[{x1:0,y1:0,x2:0,y2:0,x:a,y:e}];var o=Math.abs(o),u=Math.abs(u),p=Math.pow(i,2)/Math.pow(o,2)+Math.pow(l,2)/Math.pow(u,2);1<p&&(o*=Math.sqrt(p),u*=Math.sqrt(p));var x=(p=tt(n,r,a,e,o,u,c,t,s,f,i,l))[0],y=p[1],v=p[2],g=p[3],n=Math.abs(g)/(F/4),M=(Math.abs(1-n)<1e-7&&(n=1),Math.max(Math.ceil(n),1));g/=M;for(var m=0;m<M;m++)h.push(K(v,g)),v+=g;return h.map(function(t){var n=S(t[0],o,u,f,s,x,y),r=n.x,n=n.y,a=S(t[1],o,u,f,s,x,y),e=a.x,a=a.y,t=S(t[2],o,u,f,s,x,y);return{x1:r,y1:n,x2:e,y2:a,x:t.x,y:t.y}})}var F=2*Math.PI,S=function(t,n,r,a,e,o,u){var i=t.x,t=t.y;return{x:a*(i*=n)-e*(t*=r)+o,y:e*i+a*t+u}},K=function(t,n){var r=1.5707963267948966===n?.551915024494:-1.5707963267948966===n?-.551915024494:4/3*Math.tan(n/4),a=Math.cos(t),e=Math.sin(t),o=Math.cos(t+n),t=Math.sin(t+n);return[{x:a-e*r,y:e+a*r},{x:o+t*r,y:t-o*r},{x:o,y:t}]},tt=function(t,n,r,a,e,o,u,i,c,h,s,f){var l=Math.pow(e,2),p=Math.pow(o,2),x=Math.pow(s,2),y=Math.pow(f,2),v=l*p-l*y-p*x,l=(v<0&&(v=0),v/=l*y+p*x,(v=Math.sqrt(v)*(u===i?-1:1))*e/o*f),y=v*-o/e*s,p=h*l-c*y+(t+r)/2,x=c*l+h*y+(n+a)/2,u=(s-l)/e,v=(f-y)/o,t=(-s-l)/e,r=(-f-y)/o,c=$(1,0,u,v),h=$(u,v,t,r);return 0===i&&0<h&&(h-=F),1===i&&h<0&&(h+=F),[p,x,c,h]};function g(t,n,r,a){return[t,n,r,a,r,a]}function nt(t,n){"TQ".indexOf(t[0])<0&&(n.qx=null,n.qy=null);var r=t.slice(1),a=r[0],e=r[1];switch(t[0]){case"M":return n.x=a,n.y=e,t;case"A":return["C"].concat(function(t,n,r,a,e,o,u,i,c){return J({px:t,py:n,cx:i,cy:c,rx:r,ry:a,xAxisRotation:e,largeArcFlag:o,sweepFlag:u}).reduce(function(t,n){var r=n.x1,a=n.y1,e=n.x2,o=n.y2,u=n.x,n=n.y;return t.push(r,a,e,o,u,n),t},[])}.apply(0,[n.x1,n.y1].concat(t.slice(1))));case"Q":return n.qx=a,n.qy=e,["C"].concat(function(t,n,r,a,e,o){return[1/3*t+2/3*r,1/3*n+2/3*a,1/3*e+2/3*r,1/3*o+2/3*a,e,o]}.apply(0,[n.x1,n.y1].concat(t.slice(1))));case"L":return["C"].concat(g(n.x1,n.y1,t[1],t[2]));case"H":return["C"].concat(g(n.x1,n.y1,t[1],n.y1));case"V":return["C"].concat(g(n.x1,n.y1,n.x1,t[1]));case"Z":return["C"].concat(g(n.x1,n.y1,n.x,n.y))}return t}function q(t,n){void 0===n&&(n=!1);for(var r,a,e=W(t),o={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},u=[],i="",c=e.length,h=[],s=0;s<c;s+=1){e[s]&&(i=e[s][0]),u[s]=i,e[s]=nt(e[s],o),y=x=p=l=f=void 0;var f=e,l=u,p=s;if(7<f[p].length){f[p].shift();for(var x=f[p],y=p;x.length;)l[p]="A",f.splice(y+=1,0,["C"].concat(x.splice(0,6)));f.splice(p,1)}c=e.length,"Z"===i&&h.push(s),a=(r=e[s]).length,o.x1=+r[a-2],o.y1=+r[a-1],o.x2=+r[a-4]||o.x1,o.y2=+r[a-3]||o.y1}return n?[e,h]:e}function rt(t,n,r,a,e){return t*(t*(-3*n+9*r-9*a+3*e)+6*n-12*r+6*a)-3*n+3*r}function at(t,n,r,a,e,o,u,i,c){for(var h=(c=1<(c=null===c?1:c)?1:c<0?0:c)/2,s=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],l=0,p=0;p<12;p++){var x=h*s[p]+h,y=rt(x,t,r,e,u),x=rt(x,n,a,o,i);l+=f[p]*Math.sqrt(y*y+x*x)}return h*l}function L(t,n,r){return n>=t.x&&n<=t.x+t.width&&r>=t.y&&r<=t.y+t.height}function I(t,n,r,a){return null===t&&(t=n=r=a=0),null===n&&(n=t.y,r=t.width,a=t.height,t=t.x),{x:t,y:n,width:r,w:r,height:a,h:a,x2:t+r,y2:n+a,cx:t+r/2,cy:n+a/2,r1:Math.min(r,a)/2,r2:Math.max(r,a)/2,r0:Math.sqrt(r*r+a*a)/2,path:y(t,n,r,a),vb:[t,n,r,a].join(" ")}}function et(t,n,r,a,e,o,u,i){return Array.isArray(t)||(t=[t,n,r,a,e,o,u,i]),n=function(t,n,r,a,e,o,u,i){for(var c,h,s,f=[],l=[[],[]],p=0;p<2;++p){var x,y=0===p?(h=6*t-12*r+6*e,c=-3*t+9*r-9*e+3*u,3*r-3*t):(h=6*n-12*a+6*o,c=-3*n+9*a-9*o+3*i,3*a-3*n);Math.abs(c)<1e-12?Math.abs(h)<1e-12||0<(s=-y/h)&&s<1&&f.push(s):(y=h*h-4*y*c,x=Math.sqrt(y),y<0||(0<(y=(-h+x)/(2*c))&&y<1&&f.push(y),0<(y=(-h-x)/(2*c))&&y<1&&f.push(y)))}for(var v,g=f.length,M=g;g--;)s=f[g],l[0][g]=(v=1-s)*v*v*t+3*v*v*s*r+3*v*s*s*e+s*s*s*u,l[1][g]=v*v*v*n+3*v*v*s*a+3*v*s*s*o+s*s*s*i;return l[0][M]=t,l[1][M]=n,l[0][M+1]=u,l[1][M+1]=i,l[0].length=l[1].length=M+2,{min:{x:Math.min.apply(0,l[0]),y:Math.min.apply(0,l[1])},max:{x:Math.max.apply(0,l[0]),y:Math.max.apply(0,l[1])}}}.apply(null,t),I(n.min.x,n.min.y,n.max.x-n.min.x,n.max.y-n.min.y)}function ot(t,n,r,a,e,o,u,i,c){var h=1-c,s=Math.pow(h,3),f=Math.pow(h,2),l=c*c,p=l*c,x=t+2*c*(r-t)+l*(e-2*r+t),y=n+2*c*(a-n)+l*(o-2*a+n),v=r+2*c*(e-r)+l*(u-2*e+r);return{x:s*t+3*f*c*r+3*h*c*c*e+p*u,y:s*n+3*f*c*a+3*h*c*c*o+p*i,m:{x:x,y:y},n:{x:v,y:l=a+2*c*(o-a)+l*(i-2*o+a)},start:{x:h*t+c*r,y:h*n+c*a},end:{x:h*e+c*u,y:h*o+c*i},alpha:90-180*Math.atan2(x-v,y-l)/Math.PI}}var ut=function(t,n,r){var a=et(t),e=et(n);if(e=e,a=I(a=a),e=I(e),!(L(e,a.x,a.y)||L(e,a.x2,a.y)||L(e,a.x,a.y2)||L(e,a.x2,a.y2)||L(a,e.x,e.y)||L(a,e.x2,e.y)||L(a,e.x,e.y2)||L(a,e.x2,e.y2)||(a.x<e.x2&&a.x>e.x||e.x<a.x2&&e.x>a.x)&&(a.y<e.y2&&a.y>e.y||e.y<a.y2&&e.y>a.y)))return r?0:[];for(var o=~~(at.apply(0,t)/8),u=~~(at.apply(0,n)/8),i=[],c=[],h={},s=r?0:[],f=0;f<1+o;f++){var l=ot.apply(0,t.concat(f/o));i.push({x:l.x,y:l.y,t:f/o})}for(f=0;f<1+u;f++){l=ot.apply(0,n.concat(f/u));c.push({x:l.x,y:l.y,t:f/u})}for(f=0;f<o;f++)for(var p=0;p<u;p++){var x=i[f],y=i[f+1],v=c[p],g=c[p+1],M=Math.abs(y.x-x.x)<.001?"y":"x",m=Math.abs(g.x-v.x)<.001?"y":"x",d=function(t,n,r,a,e,o,u,i){if(!(Math.max(t,r)<Math.min(e,u)||Math.min(t,r)>Math.max(e,u)||Math.max(n,a)<Math.min(o,i)||Math.min(n,a)>Math.max(o,i))){var c=(t*a-n*r)*(e-u)-(t-r)*(e*i-o*u),h=(t*a-n*r)*(o-i)-(n-a)*(e*i-o*u),s=(t-r)*(o-i)-(n-a)*(e-u);if(s){var c=c/s,h=h/s,s=+c.toFixed(2),f=+h.toFixed(2);if(!(s<+Math.min(t,r).toFixed(2)||s>+Math.max(t,r).toFixed(2)||s<+Math.min(e,u).toFixed(2)||s>+Math.max(e,u).toFixed(2)||f<+Math.min(n,a).toFixed(2)||f>+Math.max(n,a).toFixed(2)||f<+Math.min(o,i).toFixed(2)||f>+Math.max(o,i).toFixed(2)))return{x:c,y:h}}}}(x.x,x.y,y.x,y.y,v.x,v.y,g.x,g.y);d&&h[d.x.toFixed(4)]!==d.y.toFixed(4)&&(h[d.x.toFixed(4)]=d.y.toFixed(4),M=x.t+Math.abs((d[M]-x[M])/(y[M]-x[M]))*(y.t-x.t),y=v.t+Math.abs((d[m]-v[m])/(g[m]-v[m]))*(g.t-v.t),0<=M&&M<=1&&0<=y&&y<=1&&(r?s++:s.push({x:d.x,y:d.y,t1:M,t2:y})))}return s};var it=/,?([a-z]),?/gi;var ct=Math.PI/180;function M(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function m(t,n){return M(t)*M(n)?(t[0]*n[0]+t[1]*n[1])/(M(t)*M(n)):1}function ht(t,n){return(t[0]*n[1]<t[1]*n[0]?-1:1)*Math.acos(m(t,n))}function Q(t,n){return t[0]===n[0]&&t[1]===n[1]}function st(t,n){var r=n[1],a=n[2],e=(e=n[3],e=ct*e,o=2*Math.PI,(e%o+o)%o),o=n[4],u=n[5],i=t[0],c=t[1],h=n[6],n=n[7],s=Math.cos(e)*(i-h)/2+Math.sin(e)*(c-n)/2,f=-1*Math.sin(e)*(i-h)/2+Math.cos(e)*(c-n)/2,l=s*s/(r*r)+f*f/(a*a),l=(1<l&&(r*=Math.sqrt(l),a*=Math.sqrt(l)),r*r*(f*f)+a*a*(s*s)),l=l?Math.sqrt((r*r*(a*a)-l)/l):1,p=(o===u&&(l*=-1),isNaN(l)&&(l=0),a?l*r*f/a:0),l=r?l*-a*s/r:0,i=(i+h)/2+Math.cos(e)*p-Math.sin(e)*l,c=(c+n)/2+Math.sin(e)*p+Math.cos(e)*l,x=[(s-p)/r,(f-l)/a],s=[(-1*s-p)/r,(-1*f-l)/a],p=ht([1,0],x),f=ht(x,s);return m(x,s)<=-1&&(f=Math.PI),1<=m(x,s)&&(f=0),0===u&&0<f&&(f-=2*Math.PI),1===u&&f<0&&(f+=2*Math.PI),{cx:i,cy:c,rx:Q(t,[h,n])?0:r,ry:Q(t,[h,n])?0:a,startAngle:p,endAngle:p+f,xRotation:e,arcFlag:o,sweepFlag:u}}function ft(t,n){return[n[0]+(n[0]-t[0]),n[1]+(n[1]-t[1])]}function lt(t,n,r){return n<=t&&t<=r}function pt(t,n,r,a){var e=r.x-t.x,o=r.y-t.y,u=n.x-t.x,n=n.y-t.y,i=a.x-r.x,a=a.y-r.y,r=u*a-n*i,c=null;return.001*(u*u+n*n)*(i*i+a*a)<r*r&&(lt(a=(e*a-o*i)/r,0,1)&<((e*n-o*u)/r,0,1)&&(c={x:t.x+a*u,y:t.y+a*n})),c}var xt=1e-6;function O(t){return Math.abs(t)<xt?0:t<0?-1:1}function j(t,n,r){var a=!1,e=t.length;if(e<=2)return!1;for(var o,u,i,c=0;c<e;c++){var h=t[c],s=t[(c+1)%e];if(u=s,((i=[n,r])[0]-(o=h)[0])*(u[1]-o[1])==(u[0]-o[0])*(i[1]-o[1])&&Math.min(o[0],u[0])<=i[0]&&i[0]<=Math.max(o[0],u[0])&&Math.min(o[1],u[1])<=i[1]&&i[1]<=Math.max(o[1],u[1]))return!0;0<O(h[1]-r)!=0<O(s[1]-r)&&O(n-(r-h[1])*(h[0]-s[0])/(h[1]-s[1])-h[0])<0&&(a=!a)}return a}function yt(t){for(var n,r,a=[],e=t.length,o=0;o<e-1;o++){var u=t[o],i=t[o+1];a.push({from:{x:u[0],y:u[1]},to:{x:i[0],y:i[1]}})}return 1<a.length&&(n=t[0],r=t[e-1],a.push({from:{x:r[0],y:r[1]},to:{x:n[0],y:n[1]}})),a}function vt(t){var n=t.map(function(t){return t[0]}),t=t.map(function(t){return t[1]});return{minX:Math.min.apply(null,n),maxX:Math.max.apply(null,n),minY:Math.min.apply(null,t),maxY:Math.max.apply(null,t)}}t.angleTo=function(t,n,r){e=n,u=(a=t)[0],a=a[1],i=e[0],e=e[1],o=Math.sqrt(u*u+a*a)*Math.sqrt(i*i+e*e);var a,e,o,u=Math.acos(Math.min(Math.max(o&&(u*i+a*e)/o,-1),1)),i=0<=f(t,n);return r?i?2*Math.PI-u:u:i?u:2*Math.PI-u},t.catmullRom2Bezier=function(t,n,r){void 0===r&&(r=[[0,0],[1,1]]);for(var n=!!(n=void 0===n?!1:n),a=[],e=0,o=t.length;e<o;e+=2)a.push([t[e],t[e+1]]);for(var u,i,c,h=function(t,n,r,a){var e,o=[],u=!!a;if(u){h=a[0],s=a[1];for(var i=0,c=t.length;i<c;i+=1)var h=A([0,0],h,d=t[i]),s=w([0,0],s,d)}for(var i=0,f=t.length;i<f;i+=1){var l,p,x,y,v,g,M,m,d=t[i];0!==i||r?i!==f-1||r?(l=t[[i?i-1:f-1,i-1][r?0:1]],p=t[r?(i+1)%f:i+1],g=P(g=k([0,0],p,l),g,n),0!==(v=(x=T(d,l))+(y=T(d,p)))&&(x/=v,y/=v),v=P([0,0],g,-x),g=P([0,0],g,y),M=b([0,0],d,v),m=A([0,0],m=b([0,0],d,g),w([0,0],p,d)),m=w([0,0],m,A([0,0],p,d)),M=A([0,0],M=b([0,0],d,v=P([0,0],v=k([0,0],m,d),-x/y)),w([0,0],l,d)),M=w([0,0],M,A([0,0],l,d)),m=b([0,0],d,g=P([0,0],g=k([0,0],d,M),y/x)),u&&(M=A([0,0],M=w([0,0],M,h),s),m=A([0,0],m=w([0,0],m,h),s)),o.push(e),o.push(M),e=m):(M=d,o.push(e),o.push(M)):e=d}return r&&o.push(o.shift()),o}(a,.4,n,r),s=a.length,f=[],e=0;e<s-1;e+=1)u=h[2*e],i=h[2*e+1],c=a[e+1],f.push(["C",u[0],u[1],i[0],i[1],c[0],c[1]]);return n&&(u=h[s],i=h[s+1],c=a[0],f.push(["C",u[0],u[1],i[0],i[1],c[0],c[1]])),f},t.direction=f,t.fillPath=function(a,t){if(1===a.length)return a;var e=a.length-1,n=t.length-1,r=e/n,o=[];if(1===a.length&&"M"===a[0][0]){for(var u=0;u<n-e;u++)a.push(a[0]);return a}for(u=0;u<n;u++){var i=Math.floor(r*u);o[i]=(o[i]||0)+1}var c=o.reduce(function(t,n,r){return r===e?t.concat(a[e]):t.concat(Y(a[r],a[r+1],n))},[]);return c.unshift(a[0]),"Z"!==t[n]&&"z"!==t[n]||c.push("Z"),c},t.fillPathByDiff=function(t,n){var r=function(t,n){var r=t.length,a=n.length,e=0;if(0===r||0===a)return null;for(var o=[],u=0;u<=r;u++)o[u]=[],o[u][0]={min:u};for(var i=0;i<=a;i++)o[0][i]={min:i};for(var c,u=1;u<=r;u++)for(var h=t[u-1],i=1;i<=a;i++){var s=n[i-1],e=B(h,s)?0:1,s=o[u-1][i].min+1,f=o[u][i-1].min+1,l=o[u-1][i-1].min+e;o[u][i]=(void 0,c=null,(f=f)<(l=l)&&(l=f,c="add"),(f=s)<l&&(l=f,c="del"),{type:c,min:l})}return o}(t,n),a=t.length,e=n.length,o=[],u=1,i=1;if(r[a][e]!==a){for(var c=1;c<=a;c++){for(var h=r[c][c].min,i=c,s=u;s<=e;s++)r[c][s].min<h&&(h=r[c][s].min,i=s);u=i,r[c][u].type&&o.push({index:c-1,type:r[c][u].type})}for(c=o.length-1;0<=c;c--)u=o[c].index,"add"===o[c].type?t.splice(u,0,[].concat(t[u])):t.splice(u,1)}if((a=t.length)<e)for(c=0;c<e-a;c++)"z"===t[a-1][0]||"Z"===t[a-1][0]?t.splice(a-2,0,t[a-2]):t.push(t[a-1]);return t},t.formatPath=function(t,n){if(t.length<=1)return t;for(var r,a=0;a<n.length;a++)if(t[a][0]!==n[a][0])switch(r=p(t[a]),n[a][0]){case"M":t[a]=["M"].concat(r[0]);break;case"L":t[a]=["L"].concat(r[0]);break;case"A":t[a]=[].concat(n[a]),t[a][6]=r[0][0],t[a][7]=r[0][1];break;case"Q":if(r.length<2){if(!(0<a)){t[a]=n[a];break}r=x(r,t[a-1],1)}t[a]=["Q"].concat(r.reduce(function(t,n){return t.concat(n)},[]));break;case"T":t[a]=["T"].concat(r[0]);break;case"C":if(r.length<3){if(!(0<a)){t[a]=n[a];break}r=x(r,t[a-1],2)}t[a]=["C"].concat(r.reduce(function(t,n){return t.concat(n)},[]));break;case"S":if(r.length<2){if(!(0<a)){t[a]=n[a];break}r=x(r,t[a-1],1)}t[a]=["S"].concat(r.reduce(function(t,n){return t.concat(n)},[]));break;default:t[a]=n[a]}return t},t.getArcParams=st,t.getLineIntersect=pt,t.gradient=function(t){var o=("string"==typeof t?t.split("-"):t).map(function(t){return n(-1===t.indexOf("#")?e(t):t)});return function(t){return n=o,t=t,t=isNaN(Number(t))||t<0?0:1<t?1:Number(t),r=n.length-1,a=Math.floor(r*t),t=r*t-a,e=n[a],r=a===r?e:n[a+1],u([i(e,r,t,0),i(e,r,t,1),i(e,r,t,2)]);var n,r,a,e}},t.isPointInPolygon=j,t.isPolygonsIntersect=function(n,r){if(n.length<2||r.length<2)return!1;var t=vt(n),a=vt(r);if(t=t,(a=a).minX>t.maxX||a.maxX<t.minX||a.minY>t.maxY||a.maxY<t.minY)return!1;if(r.some(function(t){return j(n,t[0],t[1])}))return!0;if(n.some(function(t){return j(r,t[0],t[1])}))return!0;var o=yt(n);return yt(r).some(function(t){for(var n=o,r=t,a=0;a<n.length;a++){var e=n[a];if(pt(e.from,e.to,r.from,r.to))return!0}return!1})},t.parsePath=C,t.parsePathArray=function(t){return t.join(",").replace(it,"$1")},t.parsePathString=d,t.path2Absolute=W,t.path2Curve=q,t.path2Segments=function(t){for(var n=[],r=null,a=null,e=null,o=0,u=(t=C(t)).length,i=0;i<u;i++){var c=t[i],a=t[i+1],h=c[0],s={command:h,prePoint:r,params:c,startTangent:null,endTangent:null};switch(h){case"M":e=[c[1],c[2]],o=i;break;case"A":var f=st(r,c);s.arcParams=f}"Z"===h?(r=e,a=t[o+1]):r=[c[(P=c.length)-2],c[P-1]],a&&"Z"===a[0]&&(a=t[o],n[o]&&(n[o].prePoint=r)),s.currentPoint=r,n[o]&&Q(r,n[o].currentPoint)&&(n[o].prePoint=s.prePoint);var l,p,x,y,v,g,M,m,d,b,A,w,P=a?[a[a.length-2],a[a.length-1]]:null,T=(s.nextPoint=P,s.prePoint);["L","H","V"].includes(h)?(s.startTangent=[T[0]-r[0],T[1]-r[1]],s.endTangent=[r[0]-T[0],r[1]-T[1]]):"Q"===h?(l=[c[1],c[2]],s.startTangent=[T[0]-l[0],T[1]-l[1]],s.endTangent=[r[0]-l[0],r[1]-l[1]]):"T"===h?(l=ft((p=n[i-1]).currentPoint,T),"Q"===p.command?(s.command="Q",s.startTangent=[T[0]-l[0],T[1]-l[1]],s.endTangent=[r[0]-l[0],r[1]-l[1]]):(s.command="TL",s.startTangent=[T[0]-r[0],T[1]-r[1]],s.endTangent=[r[0]-T[0],r[1]-T[1]])):"C"===h?(x=[c[1],c[2]],y=[c[3],c[4]],s.startTangent=[T[0]-x[0],T[1]-x[1]],s.endTangent=[r[0]-y[0],r[1]-y[1]],0===s.startTangent[0]&&0===s.startTangent[1]&&(s.startTangent=[x[0]-y[0],x[1]-y[1]]),0===s.endTangent[0]&&0===s.endTangent[1]&&(s.endTangent=[y[0]-x[0],y[1]-x[1]])):"S"===h?(x=ft((p=n[i-1]).currentPoint,T),y=[c[1],c[2]],"C"===p.command?(s.command="C",s.startTangent=[T[0]-x[0],T[1]-x[1]]):(s.command="SQ",s.startTangent=[T[0]-y[0],T[1]-y[1]]),s.endTangent=[r[0]-y[0],r[1]-y[1]]):"A"===h&&(h=.001,v=void 0===(v=(b=s.arcParams||{}).cx)?0:v,g=void 0===(g=b.cy)?0:g,A=b.rx,M=void 0===(M=b.ry)?0:M,m=b.sweepFlag,d=void 0===(d=b.startAngle)?0:d,b=void 0===(b=b.endAngle)?0:b,0===(void 0===m?0:m)&&(h*=-1),A=(m=void 0===A?0:A)*Math.cos(d-h)+v,w=M*Math.sin(d-h)+g,s.startTangent=[A-e[0],w-e[1]],A=m*Math.cos(d+b+h)+v,w=M*Math.sin(d+b-h)+g,s.endTangent=[T[0]-A,T[1]-w]),n.push(s)}return n},t.pathIntersection=function(t,n){var r=t,a=n,e=void 0;r=q(r),a=q(a);for(var o,u,i,c,h,s,f,l,p=e?0:[],x=0,y=r.length;x<y;x++){var v=r[x];if("M"===v[0])o=i=v[1],g=c=v[2];else for(var g="C"===v[0]?(o=(f=[o,g].concat(v.slice(1)))[6],f[7]):(f=[o,g,o,g,i,c,i,c],o=i,c),M=0,m=a.length;M<m;M++){var d=a[M];if("M"===d[0])u=h=d[1],b=s=d[2];else{var b="C"===d[0]?(u=(l=[u,b].concat(d.slice(1)))[6],l[7]):(l=[u,b,u,b,h,s,h,s],u=h,s),A=ut(f,l,e);if(e)p+=A;else{for(var w=0,P=A.length;w<P;w++)A[w].segment1=x,A[w].segment2=M,A[w].bez1=f,A[w].bez2=l;p=p.concat(A)}}}}return p},t.rectPath=y,t.rgb2arr=n,t.toCSSGradient=function(t){var n,r,a,e,o;return/^[r,R,L,l]{1}[\s]*\(/.test(t)?(r=void 0,"l"===t[0]?(n=+(e=N.exec(t))[1]+90,r=e[2],a="linear-gradient("+n+"deg, "):"r"===t[0]&&(a="radial-gradient(",r=(e=V.exec(t))[4]),(o=r.match(Z)).forEach(function(t,n){t=t.split(":");a+=t[1]+" "+100*Number(t[0])+"%",n!==o.length-1&&(a+=", ")}),a+=")"):t},t.toRGB=e,t.transform=function(t,n){for(var r,a,e,o,u,i,c=t?[].concat(t):[1,0,0,0,1,0,0,0,1],h=0,s=n.length;h<s;h++){var f=n[h];switch(f[0]){case"t":e=a=c,o=[f[1],f[2]],u=void 0,o=o,(u=i=[0,0,0,0,0,0,0,0,0])[0]=1,u[1]=0,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=o[0],u[7]=o[1],u[8]=1,l(a,i,e);break;case"s":u=o=c,a=[f[1],f[2]],i=void 0,(i=e=[0,0,0,0,0,0,0,0,0])[0]=(a=a)[0],i[1]=0,i[2]=0,i[3]=0,i[4]=a[1],i[5]=0,i[6]=0,i[7]=0,i[8]=1,l(o,e,u);break;case"r":R(c,c,f[1]);break;case"m":r=f[1],l(c,r,c)}}return c},t.vertical=function(t,n,r){return r?(t[0]=n[1],t[1]=-1*n[0]):(t[0]=-1*n[1],t[1]=n[0]),t},Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).util={})}(this,function(t){"use strict";function n(t){return[parseInt(t.substr(1,2),16),parseInt(t.substr(3,2),16),parseInt(t.substr(5,2),16)]}function r(t){t=Math.round(t).toString(16);return 1===t.length?"0"+t:t}function u(t){return"#"+r(t[0])+r(t[1])+r(t[2])}var a,z=/rgba?\(([\s.,0-9]+)\)/;function e(t){if("#"===t[0]&&7===t.length)return t;a||((n=document.createElement("i")).title="Web Colour Picker",n.style.display="none",document.body.appendChild(n),a=n),a.style.color=t;var n=document.defaultView.getComputedStyle(a,"").getPropertyValue("color");return u(z.exec(n)[1].split(/\s*,\s*/).map(function(t){return Number(t)}))}function i(t,n,r,a){return t[a]+(n[a]-t[a])*r}var N=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,V=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Z=/[\d.]+:(#[^\s]+|[^)]+\))/gi;var o="undefined"!=typeof Float32Array?Float32Array:Array;function l(t,n,r){var a=n[0],e=n[1],o=n[2],u=n[3],i=n[4],c=n[5],h=n[6],s=n[7],n=n[8],f=r[0],l=r[1],p=r[2],x=r[3],y=r[4],g=r[5],v=r[6],M=r[7],r=r[8];return t[0]=f*a+l*u+p*h,t[1]=f*e+l*i+p*s,t[2]=f*o+l*c+p*n,t[3]=x*a+y*u+g*h,t[4]=x*e+y*i+g*s,t[5]=x*o+y*c+g*n,t[6]=v*a+M*u+r*h,t[7]=v*e+M*i+r*s,t[8]=v*o+M*c+r*n,t}function c(){var t=new o(3);return o!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function h(t,n,r){var a=new o(3);return a[0]=t,a[1]=n,a[2]=r,a}Math.hypot||(Math.hypot=function(){for(var t=0,n=arguments.length;n--;)t+=arguments[n]*arguments[n];return Math.sqrt(t)});function s(){var t=new o(4);return o!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}c(),f=new o(4),o!=Float32Array&&(f[0]=0,f[1]=0,f[2]=0,f[3]=0);function b(t,n,r){return t[0]=n[0]+r[0],t[1]=n[1]+r[1],t}function A(t,n,r){return t[0]=Math.min(n[0],r[0]),t[1]=Math.min(n[1],r[1]),t}function w(t,n,r){return t[0]=Math.max(n[0],r[0]),t[1]=Math.max(n[1],r[1]),t}function P(t,n,r){return t[0]=n[0]*r,t[1]=n[1]*r,t}function T(t,n){var r=n[0]-t[0],n=n[1]-t[1];return Math.hypot(r,n)}c(),h(1,0,0),h(0,1,0),s(),s(),f=new o(9),o!=Float32Array&&(f[1]=0,f[2]=0,f[3]=0,f[5]=0,f[6]=0,f[7]=0),f[0]=1,f[4]=1,f[8]=1;var f,k=function(t,n,r){return t[0]=n[0]-r[0],t[1]=n[1]-r[1],t};function R(t,n,r){var a,e,o=[0,0,0,0,0,0,0,0,0];a=o,r=r,e=Math.sin(r),r=Math.cos(r),a[0]=r,a[1]=e,a[2]=0,a[3]=-e,a[4]=r,a[5]=0,a[6]=0,a[7]=0,a[8]=1,l(t,o,n)}function p(t,n){return t[0]*n[1]-n[0]*t[1]}f=new o(2),o!=Float32Array&&(f[0]=0,f[1]=0);var H=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,E=/[^\s,]+/gi;function C(t){var a=t||[];return Array.isArray(a)?a:"string"==typeof a?((a=a.match(H)).forEach(function(r,t){var n;1<(r=r.match(E))[0].length&&(n=r[0].charAt(0),r.splice(1,0,r[0].substr(1)),r[0]=n),r.forEach(function(t,n){isNaN(t)||(r[n]=+t)}),a[t]=r}),a):void 0}function X(t,n){var o=[],u=[];return t.length&&function t(n,r){if(1===n.length)o.push(n[0]),u.push(n[0]);else{for(var a=[],e=0;e<n.length-1;e++)0===e&&o.push(n[0]),e===n.length-2&&u.push(n[e+1]),a[e]=[(1-r)*n[e][0]+r*n[e+1][0],(1-r)*n[e][1]+r*n[e+1][1]];t(a,r)}}(t,n),{left:o,right:u.reverse()}}function Y(t,n,r){if(1===r)return[[].concat(t)];var a=[];if("L"===n[0]||"C"===n[0]||"Q"===n[0])a=a.concat(function(t,n,r){for(var t=[[t[1],t[2]]],a=(r=r||2,[]),e=("A"===n[0]?(t.push(n[6]),t.push(n[7])):"C"===n[0]?(t.push([n[1],n[2]]),t.push([n[3],n[4]]),t.push([n[5],n[6]])):"S"===n[0]||"Q"===n[0]?(t.push([n[1],n[2]]),t.push([n[3],n[4]])):t.push([n[1],n[2]]),t),o=1/r,u=0;u<r-1;u++){var i=X(e,o/(1-o*u));a.push(i.left),e=i.right}return a.push(e),a.map(function(t){var n=[];return 4===t.length&&(n.push("C"),n=n.concat(t[2])),3<=t.length&&(3===t.length&&n.push("Q"),n=n.concat(t[1])),2===t.length&&n.push("L"),n=n.concat(t[t.length-1])})}(t,n,r));else{var e=[].concat(t);"M"===e[0]&&(e[0]="L");for(var o=0;o<=r-1;o++)a.push(e)}return a}var B=function t(n,r){if(n===r)return!0;if(n&&r&&"object"==typeof n&&"object"==typeof r){if(n.constructor!==r.constructor)return!1;var a,e,o;if(Array.isArray(n)){if((a=n.length)!=r.length)return!1;for(e=a;0!=e--;)if(!t(n[e],r[e]))return!1;return!0}if(n.constructor===RegExp)return n.source===r.source&&n.flags===r.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===r.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===r.toString();if((a=(o=Object.keys(n)).length)!==Object.keys(r).length)return!1;for(e=a;0!=e--;)if(!Object.prototype.hasOwnProperty.call(r,o[e]))return!1;for(e=a;0!=e--;){var u=o[e];if(!t(n[u],r[u]))return!1}return!0}return n!=n&&r!=r};function x(t){var n=[];switch(t[0]){case"M":case"L":n.push([t[1],t[2]]);break;case"A":n.push([t[6],t[7]]);break;case"Q":n.push([t[3],t[4]]),n.push([t[1],t[2]]);break;case"T":n.push([t[1],t[2]]);break;case"C":n.push([t[5],t[6]]),n.push([t[1],t[2]]),n.push([t[3],t[4]]);break;case"S":n.push([t[3],t[4]]),n.push([t[1],t[2]]);break;case"H":case"V":n.push([t[1],t[1]])}return n}function y(t,n,r){for(var a,e=[].concat(t),o=1/(r+1),u=x(n)[0],i=1;i<=r;i++)o*=i,0===(a=Math.floor(t.length*o))?e.unshift([u[0]*o+t[a][0]*(1-o),u[1]*o+t[a][1]*(1-o)]):e.splice(a,0,[u[0]*o+t[a][0]*(1-o),u[1]*o+t[a][1]*(1-o)]);return e}function g(t,n,r,a,e){return e?[["M",+t+ +e,n],["l",r-2*e,0],["a",e,e,0,0,1,e,e],["l",0,a-2*e],["a",e,e,0,0,1,-e,e],["l",2*e-r,0],["a",e,e,0,0,1,-e,-e],["l",0,2*e-a],["a",e,e,0,0,1,e,-e],["z"]]:[["M",t,n],["l",r,0],["l",0,a],["l",-r,0],["z"]]}var G=new RegExp("([a-z])[\\s,]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[\\s]*,?[\\s]*)+)","ig"),_=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[\\s]*,?[\\s]*","ig");function d(t){if(!t)return null;if(Array.isArray(t))return t;var o={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},u=[];return String(t).replace(G,function(t,n,r){var a=[],e=n.toLowerCase();if(r.replace(_,function(t,n){n&&a.push(+n)}),"m"===e&&2<a.length&&(u.push([n].concat(a.splice(0,2))),e="l",n="m"===n?"l":"L"),"o"===e&&1===a.length&&u.push([n,a[0]]),"r"===e)u.push([n].concat(a));else for(;a.length>=o[e]&&(u.push([n].concat(a.splice(0,o[e]))),o[e]););return""}),u}var D=/[a-z]/;function U(t,n){return[n[0]+(n[0]-t[0]),n[1]+(n[1]-t[1])]}function W(t){var n=d(t);if(!n||!n.length)return[["M",0,0]];for(var r=!1,a=0;a<n.length;a++){var e=n[a][0];if(D.test(e)||0<=["V","H","T","S"].indexOf(e)){r=!0;break}}if(!r)return n;var o=[],u=0,i=0,c=0,h=0,t=0,s=n[0];"M"!==s[0]&&"m"!==s[0]||(c=u=+s[1],h=i=+s[2],t++,o[0]=["M",u,i]);for(var a=t,f=n.length;a<f;a++){var l=n[a],p=o[a-1],x=[],y=(e=l[0]).toUpperCase();if(e!==y)switch(x[0]=y){case"A":x[1]=l[1],x[2]=l[2],x[3]=l[3],x[4]=l[4],x[5]=l[5],x[6]=+l[6]+u,x[7]=+l[7]+i;break;case"V":x[1]=+l[1]+i;break;case"H":x[1]=+l[1]+u;break;case"M":c=+l[1]+u,h=+l[2]+i,x[1]=c,x[2]=h;break;default:for(var g=1,v=l.length;g<v;g++)x[g]=+l[g]+(g%2?u:i)}else x=n[a];switch(y){case"Z":u=+c,i=+h;break;case"H":x=["L",u=x[1],i];break;case"V":x=["L",u,i=x[1]];break;case"T":var u=x[1],i=x[2],M=U([p[1],p[2]],[p[3],p[4]]),x=["Q",M[0],M[1],u,i];break;case"S":u=x[x.length-2],i=x[x.length-1];var M=p.length,m=U([p[M-4],p[M-3]],[p[M-2],p[M-1]]);x=["C",m[0],m[1],x[1],x[2],u,i];break;case"M":c=x[x.length-2],h=x[x.length-1];break;default:u=x[x.length-2],i=x[x.length-1]}o.push(x)}return o}function $(t,n,r,a){var e=t*r+n*a;return(e=1<e?1:e)<-1&&(e=-1),(t*a-n*r<0?-1:1)*Math.acos(e)}function J(t){var n=t.px,r=t.py,a=t.cx,e=t.cy,o=t.rx,u=t.ry,i=void 0===(i=t.xAxisRotation)?0:i,c=void 0===(c=t.largeArcFlag)?0:c,t=void 0===(t=t.sweepFlag)?0:t,h=[];if(0===o||0===u)return[{x1:0,y1:0,x2:0,y2:0,x:a,y:e}];var s=Math.sin(i*F/360),f=Math.cos(i*F/360),l=-s*(n-a)/2+f*(r-e)/2;if(0==(i=f*(n-a)/2+s*(r-e)/2)&&0==l)return[{x1:0,y1:0,x2:0,y2:0,x:a,y:e}];var o=Math.abs(o),u=Math.abs(u),p=Math.pow(i,2)/Math.pow(o,2)+Math.pow(l,2)/Math.pow(u,2);1<p&&(o*=Math.sqrt(p),u*=Math.sqrt(p));var x=(p=tt(n,r,a,e,o,u,c,t,s,f,i,l))[0],y=p[1],g=p[2],v=p[3],n=Math.abs(v)/(F/4),M=(Math.abs(1-n)<1e-7&&(n=1),Math.max(Math.ceil(n),1));v/=M;for(var m=0;m<M;m++)h.push(K(g,v)),g+=v;return h.map(function(t){var n=S(t[0],o,u,f,s,x,y),r=n.x,n=n.y,a=S(t[1],o,u,f,s,x,y),e=a.x,a=a.y,t=S(t[2],o,u,f,s,x,y);return{x1:r,y1:n,x2:e,y2:a,x:t.x,y:t.y}})}var F=2*Math.PI,S=function(t,n,r,a,e,o,u){var i=t.x,t=t.y;return{x:a*(i*=n)-e*(t*=r)+o,y:e*i+a*t+u}},K=function(t,n){var r=1.5707963267948966===n?.551915024494:-1.5707963267948966===n?-.551915024494:4/3*Math.tan(n/4),a=Math.cos(t),e=Math.sin(t),o=Math.cos(t+n),t=Math.sin(t+n);return[{x:a-e*r,y:e+a*r},{x:o+t*r,y:t-o*r},{x:o,y:t}]},tt=function(t,n,r,a,e,o,u,i,c,h,s,f){var l=Math.pow(e,2),p=Math.pow(o,2),x=Math.pow(s,2),y=Math.pow(f,2),g=l*p-l*y-p*x,l=(g<0&&(g=0),g/=l*y+p*x,(g=Math.sqrt(g)*(u===i?-1:1))*e/o*f),y=g*-o/e*s,p=h*l-c*y+(t+r)/2,x=c*l+h*y+(n+a)/2,u=(s-l)/e,g=(f-y)/o,t=(-s-l)/e,r=(-f-y)/o,c=$(1,0,u,g),h=$(u,g,t,r);return 0===i&&0<h&&(h-=F),1===i&&h<0&&(h+=F),[p,x,c,h]};function v(t,n,r,a){return[t,n,r,a,r,a]}function nt(t,n){"TQ".indexOf(t[0])<0&&(n.qx=null,n.qy=null);var r=t.slice(1),a=r[0],e=r[1];switch(t[0]){case"M":return n.x=a,n.y=e,t;case"A":return["C"].concat(function(t,n,r,a,e,o,u,i,c){return J({px:t,py:n,cx:i,cy:c,rx:r,ry:a,xAxisRotation:e,largeArcFlag:o,sweepFlag:u}).reduce(function(t,n){var r=n.x1,a=n.y1,e=n.x2,o=n.y2,u=n.x,n=n.y;return t.push(r,a,e,o,u,n),t},[])}.apply(0,[n.x1,n.y1].concat(t.slice(1))));case"Q":return n.qx=a,n.qy=e,["C"].concat(function(t,n,r,a,e,o){return[1/3*t+2/3*r,1/3*n+2/3*a,1/3*e+2/3*r,1/3*o+2/3*a,e,o]}.apply(0,[n.x1,n.y1].concat(t.slice(1))));case"L":return["C"].concat(v(n.x1,n.y1,t[1],t[2]));case"H":return["C"].concat(v(n.x1,n.y1,t[1],n.y1));case"V":return["C"].concat(v(n.x1,n.y1,n.x1,t[1]));case"Z":return["C"].concat(v(n.x1,n.y1,n.x,n.y))}return t}function q(t,n){void 0===n&&(n=!1);for(var r,a,e=W(t),o={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},u=[],i="",c=e.length,h=[],s=0;s<c;s+=1){e[s]&&(i=e[s][0]),u[s]=i,e[s]=nt(e[s],o),y=x=p=l=f=void 0;var f=e,l=u,p=s;if(7<f[p].length){f[p].shift();for(var x=f[p],y=p;x.length;)l[p]="A",f.splice(y+=1,0,["C"].concat(x.splice(0,6)));f.splice(p,1)}c=e.length,"Z"===i&&h.push(s),a=(r=e[s]).length,o.x1=+r[a-2],o.y1=+r[a-1],o.x2=+r[a-4]||o.x1,o.y2=+r[a-3]||o.y1}return n?[e,h]:e}function rt(t,n,r,a,e){return t*(t*(-3*n+9*r-9*a+3*e)+6*n-12*r+6*a)-3*n+3*r}function at(t,n,r,a,e,o,u,i,c){for(var h=(c=1<(c=null===c?1:c)?1:c<0?0:c)/2,s=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],l=0,p=0;p<12;p++){var x=h*s[p]+h,y=rt(x,t,r,e,u),x=rt(x,n,a,o,i);l+=f[p]*Math.sqrt(y*y+x*x)}return h*l}function L(t,n,r){return n>=t.x&&n<=t.x+t.width&&r>=t.y&&r<=t.y+t.height}function I(t,n,r,a){return null===t&&(t=n=r=a=0),null===n&&(n=t.y,r=t.width,a=t.height,t=t.x),{x:t,y:n,width:r,w:r,height:a,h:a,x2:t+r,y2:n+a,cx:t+r/2,cy:n+a/2,r1:Math.min(r,a)/2,r2:Math.max(r,a)/2,r0:Math.sqrt(r*r+a*a)/2,path:g(t,n,r,a),vb:[t,n,r,a].join(" ")}}function et(t,n,r,a,e,o,u,i){return Array.isArray(t)||(t=[t,n,r,a,e,o,u,i]),n=function(t,n,r,a,e,o,u,i){for(var c,h,s,f=[],l=[[],[]],p=0;p<2;++p){var x,y=0===p?(h=6*t-12*r+6*e,c=-3*t+9*r-9*e+3*u,3*r-3*t):(h=6*n-12*a+6*o,c=-3*n+9*a-9*o+3*i,3*a-3*n);Math.abs(c)<1e-12?Math.abs(h)<1e-12||0<(s=-y/h)&&s<1&&f.push(s):(y=h*h-4*y*c,x=Math.sqrt(y),y<0||(0<(y=(-h+x)/(2*c))&&y<1&&f.push(y),0<(y=(-h-x)/(2*c))&&y<1&&f.push(y)))}for(var g,v=f.length,M=v;v--;)s=f[v],l[0][v]=(g=1-s)*g*g*t+3*g*g*s*r+3*g*s*s*e+s*s*s*u,l[1][v]=g*g*g*n+3*g*g*s*a+3*g*s*s*o+s*s*s*i;return l[0][M]=t,l[1][M]=n,l[0][M+1]=u,l[1][M+1]=i,l[0].length=l[1].length=M+2,{min:{x:Math.min.apply(0,l[0]),y:Math.min.apply(0,l[1])},max:{x:Math.max.apply(0,l[0]),y:Math.max.apply(0,l[1])}}}.apply(null,t),I(n.min.x,n.min.y,n.max.x-n.min.x,n.max.y-n.min.y)}function ot(t,n,r,a,e,o,u,i,c){var h=1-c,s=Math.pow(h,3),f=Math.pow(h,2),l=c*c,p=l*c,x=t+2*c*(r-t)+l*(e-2*r+t),y=n+2*c*(a-n)+l*(o-2*a+n),g=r+2*c*(e-r)+l*(u-2*e+r);return{x:s*t+3*f*c*r+3*h*c*c*e+p*u,y:s*n+3*f*c*a+3*h*c*c*o+p*i,m:{x:x,y:y},n:{x:g,y:l=a+2*c*(o-a)+l*(i-2*o+a)},start:{x:h*t+c*r,y:h*n+c*a},end:{x:h*e+c*u,y:h*o+c*i},alpha:90-180*Math.atan2(x-g,y-l)/Math.PI}}var ut=function(t,n,r){var a=et(t),e=et(n);if(e=e,a=I(a=a),e=I(e),!(L(e,a.x,a.y)||L(e,a.x2,a.y)||L(e,a.x,a.y2)||L(e,a.x2,a.y2)||L(a,e.x,e.y)||L(a,e.x2,e.y)||L(a,e.x,e.y2)||L(a,e.x2,e.y2)||(a.x<e.x2&&a.x>e.x||e.x<a.x2&&e.x>a.x)&&(a.y<e.y2&&a.y>e.y||e.y<a.y2&&e.y>a.y)))return r?0:[];for(var o=~~(at.apply(0,t)/8),u=~~(at.apply(0,n)/8),i=[],c=[],h={},s=r?0:[],f=0;f<1+o;f++){var l=ot.apply(0,t.concat(f/o));i.push({x:l.x,y:l.y,t:f/o})}for(f=0;f<1+u;f++){l=ot.apply(0,n.concat(f/u));c.push({x:l.x,y:l.y,t:f/u})}for(f=0;f<o;f++)for(var p=0;p<u;p++){var x=i[f],y=i[f+1],g=c[p],v=c[p+1],M=Math.abs(y.x-x.x)<.001?"y":"x",m=Math.abs(v.x-g.x)<.001?"y":"x",d=function(t,n,r,a,e,o,u,i){if(!(Math.max(t,r)<Math.min(e,u)||Math.min(t,r)>Math.max(e,u)||Math.max(n,a)<Math.min(o,i)||Math.min(n,a)>Math.max(o,i))){var c=(t*a-n*r)*(e-u)-(t-r)*(e*i-o*u),h=(t*a-n*r)*(o-i)-(n-a)*(e*i-o*u),s=(t-r)*(o-i)-(n-a)*(e-u);if(s){var c=c/s,h=h/s,s=+c.toFixed(2),f=+h.toFixed(2);if(!(s<+Math.min(t,r).toFixed(2)||s>+Math.max(t,r).toFixed(2)||s<+Math.min(e,u).toFixed(2)||s>+Math.max(e,u).toFixed(2)||f<+Math.min(n,a).toFixed(2)||f>+Math.max(n,a).toFixed(2)||f<+Math.min(o,i).toFixed(2)||f>+Math.max(o,i).toFixed(2)))return{x:c,y:h}}}}(x.x,x.y,y.x,y.y,g.x,g.y,v.x,v.y);d&&h[d.x.toFixed(4)]!==d.y.toFixed(4)&&(h[d.x.toFixed(4)]=d.y.toFixed(4),M=x.t+Math.abs((d[M]-x[M])/(y[M]-x[M]))*(y.t-x.t),y=g.t+Math.abs((d[m]-g[m])/(v[m]-g[m]))*(v.t-g.t),0<=M&&M<=1&&0<=y&&y<=1&&(r?s++:s.push({x:d.x,y:d.y,t1:M,t2:y})))}return s};var it=/,?([a-z]),?/gi;var ct=Math.PI/180;function M(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function m(t,n){return M(t)*M(n)?(t[0]*n[0]+t[1]*n[1])/(M(t)*M(n)):1}function ht(t,n){return(t[0]*n[1]<t[1]*n[0]?-1:1)*Math.acos(m(t,n))}function Q(t,n){return t[0]===n[0]&&t[1]===n[1]}function st(t,n){var r=n[1],a=n[2],e=(e=n[3],e=ct*e,o=2*Math.PI,(e%o+o)%o),o=n[4],u=n[5],i=t[0],c=t[1],h=n[6],n=n[7],s=Math.cos(e)*(i-h)/2+Math.sin(e)*(c-n)/2,f=-1*Math.sin(e)*(i-h)/2+Math.cos(e)*(c-n)/2,l=s*s/(r*r)+f*f/(a*a),l=(1<l&&(r*=Math.sqrt(l),a*=Math.sqrt(l)),r*r*(f*f)+a*a*(s*s)),l=l?Math.sqrt((r*r*(a*a)-l)/l):1,p=(o===u&&(l*=-1),isNaN(l)&&(l=0),a?l*r*f/a:0),l=r?l*-a*s/r:0,i=(i+h)/2+Math.cos(e)*p-Math.sin(e)*l,c=(c+n)/2+Math.sin(e)*p+Math.cos(e)*l,x=[(s-p)/r,(f-l)/a],s=[(-1*s-p)/r,(-1*f-l)/a],p=ht([1,0],x),f=ht(x,s);return m(x,s)<=-1&&(f=Math.PI),1<=m(x,s)&&(f=0),0===u&&0<f&&(f-=2*Math.PI),1===u&&f<0&&(f+=2*Math.PI),{cx:i,cy:c,rx:Q(t,[h,n])?0:r,ry:Q(t,[h,n])?0:a,startAngle:p,endAngle:p+f,xRotation:e,arcFlag:o,sweepFlag:u}}function ft(t,n){return[n[0]+(n[0]-t[0]),n[1]+(n[1]-t[1])]}function lt(t,n,r){return n<=t&&t<=r}function pt(t,n,r,a){var e=r.x-t.x,o=r.y-t.y,u=n.x-t.x,n=n.y-t.y,i=a.x-r.x,a=a.y-r.y,r=u*a-n*i,c=null;return.001*(u*u+n*n)*(i*i+a*a)<r*r&&(lt(a=(e*a-o*i)/r,0,1)&<((e*n-o*u)/r,0,1)&&(c={x:t.x+a*u,y:t.y+a*n})),c}var xt=1e-6;function O(t){return Math.abs(t)<xt?0:t<0?-1:1}function j(t,n,r){var a=!1,e=t.length;if(e<=2)return!1;for(var o,u,i,c=0;c<e;c++){var h=t[c],s=t[(c+1)%e];if(u=s,((i=[n,r])[0]-(o=h)[0])*(u[1]-o[1])==(u[0]-o[0])*(i[1]-o[1])&&Math.min(o[0],u[0])<=i[0]&&i[0]<=Math.max(o[0],u[0])&&Math.min(o[1],u[1])<=i[1]&&i[1]<=Math.max(o[1],u[1]))return!0;0<O(h[1]-r)!=0<O(s[1]-r)&&O(n-(r-h[1])*(h[0]-s[0])/(h[1]-s[1])-h[0])<0&&(a=!a)}return a}function yt(t){for(var n,r,a=[],e=t.length,o=0;o<e-1;o++){var u=t[o],i=t[o+1];a.push({from:{x:u[0],y:u[1]},to:{x:i[0],y:i[1]}})}return 1<a.length&&(n=t[0],r=t[e-1],a.push({from:{x:r[0],y:r[1]},to:{x:n[0],y:n[1]}})),a}function gt(t){var n=t.map(function(t){return t[0]}),t=t.map(function(t){return t[1]});return{minX:Math.min.apply(null,n),maxX:Math.max.apply(null,n),minY:Math.min.apply(null,t),maxY:Math.max.apply(null,t)}}t.angleTo=function(t,n,r){e=n,u=(a=t)[0],a=a[1],i=e[0],e=e[1],o=Math.sqrt(u*u+a*a)*Math.sqrt(i*i+e*e);var a,e,o,u=Math.acos(Math.min(Math.max(o&&(u*i+a*e)/o,-1),1)),i=0<=p(t,n);return r?i?2*Math.PI-u:u:i?u:2*Math.PI-u},t.catmullRom2Bezier=function(t,n,r){void 0===r&&(r=[[0,0],[1,1]]);for(var n=!!(n=void 0===n?!1:n),a=[],e=0,o=t.length;e<o;e+=2)a.push([t[e],t[e+1]]);for(var u,i,c,h=function(t,n,r,a){var e,o=[],u=!!a;if(u){h=a[0],s=a[1];for(var i=0,c=t.length;i<c;i+=1)var h=A([0,0],h,d=t[i]),s=w([0,0],s,d)}for(var i=0,f=t.length;i<f;i+=1){var l,p,x,y,g,v,M,m,d=t[i];0!==i||r?i!==f-1||r?(l=t[[i?i-1:f-1,i-1][r?0:1]],p=t[r?(i+1)%f:i+1],v=P(v=k([0,0],p,l),v,n),0!==(g=(x=T(d,l))+(y=T(d,p)))&&(x/=g,y/=g),g=P([0,0],v,-x),v=P([0,0],v,y),M=b([0,0],d,g),m=A([0,0],m=b([0,0],d,v),w([0,0],p,d)),m=w([0,0],m,A([0,0],p,d)),M=A([0,0],M=b([0,0],d,g=P([0,0],g=k([0,0],m,d),-x/y)),w([0,0],l,d)),M=w([0,0],M,A([0,0],l,d)),m=b([0,0],d,v=P([0,0],v=k([0,0],d,M),y/x)),u&&(M=A([0,0],M=w([0,0],M,h),s),m=A([0,0],m=w([0,0],m,h),s)),o.push(e),o.push(M),e=m):(M=d,o.push(e),o.push(M)):e=d}return r&&o.push(o.shift()),o}(a,.4,n,r),s=a.length,f=[],e=0;e<s-1;e+=1)u=h[2*e],i=h[2*e+1],c=a[e+1],f.push(["C",u[0],u[1],i[0],i[1],c[0],c[1]]);return n&&(u=h[s],i=h[s+1],c=a[0],f.push(["C",u[0],u[1],i[0],i[1],c[0],c[1]])),f},t.direction=p,t.fillPath=function(a,t){if(1===a.length)return a;var e=a.length-1,n=t.length-1,r=e/n,o=[];if(1===a.length&&"M"===a[0][0]){for(var u=0;u<n-e;u++)a.push(a[0]);return a}for(u=0;u<n;u++){var i=Math.floor(r*u);o[i]=(o[i]||0)+1}var c=o.reduce(function(t,n,r){return r===e?t.concat(a[e]):t.concat(Y(a[r],a[r+1],n))},[]);return c.unshift(a[0]),"Z"!==t[n]&&"z"!==t[n]||c.push("Z"),c},t.fillPathByDiff=function(t,n){var r=function(t,n){var r=t.length,a=n.length,e=0;if(0===r||0===a)return null;for(var o=[],u=0;u<=r;u++)o[u]=[],o[u][0]={min:u};for(var i=0;i<=a;i++)o[0][i]={min:i};for(var c,u=1;u<=r;u++)for(var h=t[u-1],i=1;i<=a;i++){var s=n[i-1],e=B(h,s)?0:1,s=o[u-1][i].min+1,f=o[u][i-1].min+1,l=o[u-1][i-1].min+e;o[u][i]=(void 0,c=null,(f=f)<(l=l)&&(l=f,c="add"),(f=s)<l&&(l=f,c="del"),{type:c,min:l})}return o}(t,n),a=t.length,e=n.length,o=[],u=1,i=1;if(r[a][e]!==a){for(var c=1;c<=a;c++){for(var h=r[c][c].min,i=c,s=u;s<=e;s++)r[c][s].min<h&&(h=r[c][s].min,i=s);u=i,r[c][u].type&&o.push({index:c-1,type:r[c][u].type})}for(c=o.length-1;0<=c;c--)u=o[c].index,"add"===o[c].type?t.splice(u,0,[].concat(t[u])):t.splice(u,1)}if((a=t.length)<e)for(c=0;c<e-a;c++)"z"===t[a-1][0]||"Z"===t[a-1][0]?t.splice(a-2,0,t[a-2]):t.push(t[a-1]);return t},t.formatPath=function(t,n){if(t.length<=1)return t;for(var r,a=0;a<n.length;a++)if(t[a][0]!==n[a][0])switch(r=x(t[a]),n[a][0]){case"M":t[a]=["M"].concat(r[0]);break;case"L":t[a]=["L"].concat(r[0]);break;case"A":t[a]=[].concat(n[a]),t[a][6]=r[0][0],t[a][7]=r[0][1];break;case"Q":if(r.length<2){if(!(0<a)){t[a]=n[a];break}r=y(r,t[a-1],1)}t[a]=["Q"].concat(r.reduce(function(t,n){return t.concat(n)},[]));break;case"T":t[a]=["T"].concat(r[0]);break;case"C":if(r.length<3){if(!(0<a)){t[a]=n[a];break}r=y(r,t[a-1],2)}t[a]=["C"].concat(r.reduce(function(t,n){return t.concat(n)},[]));break;case"S":if(r.length<2){if(!(0<a)){t[a]=n[a];break}r=y(r,t[a-1],1)}t[a]=["S"].concat(r.reduce(function(t,n){return t.concat(n)},[]));break;default:t[a]=n[a]}return t},t.getArcParams=st,t.getLineIntersect=pt,t.gradient=function(t){var o=("string"==typeof t?t.split("-"):t).map(function(t){return n(-1===t.indexOf("#")?e(t):t)});return function(t){return n=o,t=t,t=isNaN(Number(t))||t<0?0:1<t?1:Number(t),r=n.length-1,a=Math.floor(r*t),t=r*t-a,e=n[a],r=a===r?e:n[a+1],u([i(e,r,t,0),i(e,r,t,1),i(e,r,t,2)]);var n,r,a,e}},t.isPointInPolygon=j,t.isPolygonsIntersect=function(n,r){if(n.length<2||r.length<2)return!1;var t=gt(n),a=gt(r);if(t=t,(a=a).minX>t.maxX||a.maxX<t.minX||a.minY>t.maxY||a.maxY<t.minY)return!1;if(r.some(function(t){return j(n,t[0],t[1])}))return!0;if(n.some(function(t){return j(r,t[0],t[1])}))return!0;var o=yt(n);return yt(r).some(function(t){for(var n=o,r=t,a=0;a<n.length;a++){var e=n[a];if(pt(e.from,e.to,r.from,r.to))return!0}return!1})},t.parsePath=C,t.parsePathArray=function(t){return t.join(",").replace(it,"$1")},t.parsePathString=d,t.path2Absolute=W,t.path2Curve=q,t.path2Segments=function(t){for(var n=[],r=null,a=null,e=null,o=0,u=(t=C(t)).length,i=0;i<u;i++){var c=t[i],a=t[i+1],h=c[0],s={command:h,prePoint:r,params:c,startTangent:null,endTangent:null};switch(h){case"M":e=[c[1],c[2]],o=i;break;case"A":var f=st(r,c);s.arcParams=f}"Z"===h?(r=e,a=t[o+1]):r=[c[(P=c.length)-2],c[P-1]],a&&"Z"===a[0]&&(a=t[o],n[o]&&(n[o].prePoint=r)),s.currentPoint=r,n[o]&&Q(r,n[o].currentPoint)&&(n[o].prePoint=s.prePoint);var l,p,x,y,g,v,M,m,d,b,A,w,P=a?[a[a.length-2],a[a.length-1]]:null,T=(s.nextPoint=P,s.prePoint);["L","H","V"].includes(h)?(s.startTangent=[T[0]-r[0],T[1]-r[1]],s.endTangent=[r[0]-T[0],r[1]-T[1]]):"Q"===h?(l=[c[1],c[2]],s.startTangent=[T[0]-l[0],T[1]-l[1]],s.endTangent=[r[0]-l[0],r[1]-l[1]]):"T"===h?(l=ft((p=n[i-1]).currentPoint,T),"Q"===p.command?(s.command="Q",s.startTangent=[T[0]-l[0],T[1]-l[1]],s.endTangent=[r[0]-l[0],r[1]-l[1]]):(s.command="TL",s.startTangent=[T[0]-r[0],T[1]-r[1]],s.endTangent=[r[0]-T[0],r[1]-T[1]])):"C"===h?(x=[c[1],c[2]],y=[c[3],c[4]],s.startTangent=[T[0]-x[0],T[1]-x[1]],s.endTangent=[r[0]-y[0],r[1]-y[1]],0===s.startTangent[0]&&0===s.startTangent[1]&&(s.startTangent=[x[0]-y[0],x[1]-y[1]]),0===s.endTangent[0]&&0===s.endTangent[1]&&(s.endTangent=[y[0]-x[0],y[1]-x[1]])):"S"===h?(x=ft((p=n[i-1]).currentPoint,T),y=[c[1],c[2]],"C"===p.command?(s.command="C",s.startTangent=[T[0]-x[0],T[1]-x[1]]):(s.command="SQ",s.startTangent=[T[0]-y[0],T[1]-y[1]]),s.endTangent=[r[0]-y[0],r[1]-y[1]]):"A"===h&&(h=.001,g=void 0===(g=(b=s.arcParams||{}).cx)?0:g,v=void 0===(v=b.cy)?0:v,A=b.rx,M=void 0===(M=b.ry)?0:M,m=b.sweepFlag,d=void 0===(d=b.startAngle)?0:d,b=void 0===(b=b.endAngle)?0:b,0===(void 0===m?0:m)&&(h*=-1),A=(m=void 0===A?0:A)*Math.cos(d-h)+g,w=M*Math.sin(d-h)+v,s.startTangent=[A-e[0],w-e[1]],A=m*Math.cos(d+b+h)+g,w=M*Math.sin(d+b-h)+v,s.endTangent=[T[0]-A,T[1]-w]),n.push(s)}return n},t.pathIntersection=function(t,n){var r=t,a=n,e=void 0;r=q(r),a=q(a);for(var o,u,i,c,h,s,f,l,p=e?0:[],x=0,y=r.length;x<y;x++){var g=r[x];if("M"===g[0])o=i=g[1],v=c=g[2];else for(var v="C"===g[0]?(o=(f=[o,v].concat(g.slice(1)))[6],f[7]):(f=[o,v,o,v,i,c,i,c],o=i,c),M=0,m=a.length;M<m;M++){var d=a[M];if("M"===d[0])u=h=d[1],b=s=d[2];else{var b="C"===d[0]?(u=(l=[u,b].concat(d.slice(1)))[6],l[7]):(l=[u,b,u,b,h,s,h,s],u=h,s),A=ut(f,l,e);if(e)p+=A;else{for(var w=0,P=A.length;w<P;w++)A[w].segment1=x,A[w].segment2=M,A[w].bez1=f,A[w].bez2=l;p=p.concat(A)}}}}return p},t.rectPath=g,t.rgb2arr=n,t.toCSSGradient=function(t){var n,r,a,e,o;return/^[r,R,L,l]{1}[\s]*\(/.test(t)?(r=void 0,"l"===t[0]?(n=+(e=N.exec(t))[1]+90,r=e[2],a="linear-gradient("+n+"deg, "):"r"===t[0]&&(a="radial-gradient(",r=(e=V.exec(t))[4]),(o=r.match(Z)).forEach(function(t,n){t=t.split(":");a+=t[1]+" "+100*Number(t[0])+"%",n!==o.length-1&&(a+=", ")}),a+=")"):t},t.toRGB=e,t.transform=function(t,n){for(var r,a,e,o,u,i,c=t?[].concat(t):[1,0,0,0,1,0,0,0,1],h=0,s=n.length;h<s;h++){var f=n[h];switch(f[0]){case"t":e=a=c,o=[f[1],f[2]],u=void 0,o=o,(u=i=[0,0,0,0,0,0,0,0,0])[0]=1,u[1]=0,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=o[0],u[7]=o[1],u[8]=1,l(a,i,e);break;case"s":u=o=c,a=[f[1],f[2]],i=void 0,(i=e=[0,0,0,0,0,0,0,0,0])[0]=(a=a)[0],i[1]=0,i[2]=0,i[3]=0,i[4]=a[1],i[5]=0,i[6]=0,i[7]=0,i[8]=1,l(o,e,u);break;case"r":R(c,c,f[1]);break;case"m":r=f[1],l(c,r,c)}}return c},t.vertical=function(t,n,r){return r?(t[0]=n[1],t[1]=-1*n[0]):(t[0]=-1*n[1],t[1]=n[0]),t},Object.defineProperty(t,"__esModule",{value:!0})}); |
@@ -1,2 +0,2 @@ | ||
var SPACES = '\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029'; | ||
var SPACES = '\\s'; | ||
var PATH_COMMAND = new RegExp('([a-z])[' + SPACES + ',]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[' + SPACES + ']*,?[' + SPACES + ']*)+)', 'ig'); | ||
@@ -3,0 +3,0 @@ var PATH_VALUES = new RegExp('(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[' + SPACES + ']*,?[' + SPACES + ']*', 'ig'); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parsePathString = void 0; | ||
var SPACES = '\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029'; | ||
var SPACES = '\\s'; | ||
var PATH_COMMAND = new RegExp('([a-z])[' + SPACES + ',]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[' + SPACES + ']*,?[' + SPACES + ']*)+)', 'ig'); | ||
@@ -6,0 +6,0 @@ var PATH_VALUES = new RegExp('(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[' + SPACES + ']*,?[' + SPACES + ']*', 'ig'); |
{ | ||
"name": "@antv/util", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
@@ -1,3 +0,2 @@ | ||
const SPACES = | ||
'\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029'; | ||
const SPACES = '\\s'; | ||
const PATH_COMMAND = new RegExp( | ||
@@ -4,0 +3,0 @@ '([a-z])[' + SPACES + ',]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[' + SPACES + ']*,?[' + SPACES + ']*)+)', |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
429712
6846
1