svg-path-commander 0.1.9 → 0.1.10-alpha1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SVGPathCommander v0.1.9 (http://thednp.github.io/svg-path-commander)
2
+ * SVGPathCommander v0.1.10alpha1 (http://thednp.github.io/svg-path-commander)
3
3
  * Copyright 2021 © thednp
4
4
  * Licensed under MIT (https://github.com/thednp/svg-path-commander/blob/master/LICENSE)
5
5
  */
@@ -2827,7 +2827,7 @@ function transformPath(path, transform) {
2827
2827
  return clonePath(absolutePath);
2828
2828
  }
2829
2829
 
2830
- var version = "0.1.9";
2830
+ var version = "0.1.10alpha1";
2831
2831
 
2832
2832
  // @ts-ignore
2833
2833
 
@@ -1,2 +1,2 @@
1
- // SVGPathCommander v0.1.9 | thednp © 2021 | MIT-License
2
- function t(t){if(!t.every(t=>!Number.isNaN(t)))throw TypeError(`CSSMatrix: "${t}" must only have numbers.`);const e=new l,n=Array.from(t);if(16===n.length){const[t,r,s,a,i,c,o,m,l,h,u,f,y,p,x,g]=n;e.m11=t,e.a=t,e.m21=i,e.c=i,e.m31=l,e.m41=y,e.e=y,e.m12=r,e.b=r,e.m22=c,e.d=c,e.m32=h,e.m42=p,e.f=p,e.m13=s,e.m23=o,e.m33=u,e.m43=x,e.m14=a,e.m24=m,e.m34=f,e.m44=g}else{if(6!==n.length)throw new TypeError("CSSMatrix: expecting an Array of 6/16 values.");{const[t,r,s,a,i,c]=n;e.m11=t,e.a=t,e.m12=r,e.b=r,e.m21=s,e.c=s,e.m22=a,e.d=a,e.m41=i,e.e=i,e.m42=c,e.f=c}}return e}function e(e){if(![l,DOMMatrix,Object].some(t=>e instanceof t))throw TypeError(`CSSMatrix: "${e}" is not a DOMMatrix / CSSMatrix compatible object.`);return t([e.m11,e.m12,e.m13,e.m14,e.m21,e.m22,e.m23,e.m24,e.m31,e.m32,e.m33,e.m34,e.m41,e.m42,e.m43,e.m44])}function n(e){if("string"!=typeof e)throw TypeError(`CSSMatrix: "${e}" is not a string.`);const n=String(e).replace(/\s/g,"");let r=new l;return n.split(")").filter(t=>t).map(t=>{const[e,n]=t.split("(");return{prop:e,components:n.split(",").map(t=>t.includes("rad")?parseFloat(t)*(180/Math.PI):parseFloat(t))}}).forEach(e=>{const{prop:n,components:s}=e,[a,i,c,o]=s,m=[a,i,c],l=[a,i,c,o];if(n.includes("matrix")){const e=s.map(t=>Math.abs(t)<1e-6?0:t);[6,16].includes(e.length)&&(r=r.multiply(t(e)))}else if(["translate","translate3d"].some(t=>n===t)&&a)r=r.translate(a,i||0,c||0);else if("rotate3d"===n&&l.every(t=>!Number.isNaN(+t))&&o)r=r.rotateAxisAngle(a,i,c,o);else if("scale3d"===n&&m.every(t=>!Number.isNaN(+t))&&m.some(t=>1!==t))r=r.scale(a,i,c);else if("rotate"===n&&a)r=r.rotate(0,0,a);else if("scale"!==n||Number.isNaN(a)||1===a){if("skew"===n&&(a||i))r=a?r.skewX(a):r,r=i?r.skewY(i):r;else if(/[XYZ]/.test(n)&&a)if(n.includes("skew"))r=r[n](a);else{const t=n.replace(/[XYZ]/,""),e=n.replace(t,""),s=["X","Y","Z"].indexOf(e),i=[0===s?a:0,1===s?a:0,2===s?a:0];r=r[t](...i)}}else{const t=Number.isNaN(+i)?a:i;r=r.scale(a,t,1)}}),r}function r(t,e,n){const r=new l;return r.m41=t,r.e=t,r.m42=e,r.f=e,r.m43=n,r}function s(t,e,n){const r=new l,s=Math.PI/180,a=t*s,i=e*s,c=n*s,o=Math.cos(a),m=-Math.sin(a),h=Math.cos(i),u=-Math.sin(i),f=Math.cos(c),y=-Math.sin(c),p=h*f,x=-h*y;r.m11=p,r.a=p,r.m12=x,r.b=x,r.m13=u;const g=m*u*f+o*y;r.m21=g,r.c=g;const d=o*f-m*u*y;return r.m22=d,r.d=d,r.m23=-m*h,r.m31=m*y-o*u*f,r.m32=m*f+o*u*y,r.m33=o*h,r}function a(t,e,n,r){const s=new l,a=r*(Math.PI/360),i=Math.sin(a),c=Math.cos(a),o=i*i,m=Math.sqrt(t*t+e*e+n*n);let h=t,u=e,f=n;0===m?(h=0,u=0,f=1):(h/=m,u/=m,f/=m);const y=h*h,p=u*u,x=f*f,g=1-2*(p+x)*o;s.m11=g,s.a=g;const d=2*(h*u*o+f*i*c);s.m12=d,s.b=d,s.m13=2*(h*f*o-u*i*c);const M=2*(u*h*o-f*i*c);s.m21=M,s.c=M;const b=1-2*(x+y)*o;return s.m22=b,s.d=b,s.m23=2*(u*f*o+h*i*c),s.m31=2*(f*h*o+u*i*c),s.m32=2*(f*u*o-h*i*c),s.m33=1-2*(y+p)*o,s}function i(t,e,n){const r=new l;return r.m11=t,r.a=t,r.m22=e,r.d=e,r.m33=n,r}function c(t){const e=new l,n=t*Math.PI/180,r=Math.tan(n);return e.m21=r,e.c=r,e}function o(t){const e=new l,n=t*Math.PI/180,r=Math.tan(n);return e.m12=r,e.b=r,e}function m(e,n){return t([n.m11*e.m11+n.m12*e.m21+n.m13*e.m31+n.m14*e.m41,n.m11*e.m12+n.m12*e.m22+n.m13*e.m32+n.m14*e.m42,n.m11*e.m13+n.m12*e.m23+n.m13*e.m33+n.m14*e.m43,n.m11*e.m14+n.m12*e.m24+n.m13*e.m34+n.m14*e.m44,n.m21*e.m11+n.m22*e.m21+n.m23*e.m31+n.m24*e.m41,n.m21*e.m12+n.m22*e.m22+n.m23*e.m32+n.m24*e.m42,n.m21*e.m13+n.m22*e.m23+n.m23*e.m33+n.m24*e.m43,n.m21*e.m14+n.m22*e.m24+n.m23*e.m34+n.m24*e.m44,n.m31*e.m11+n.m32*e.m21+n.m33*e.m31+n.m34*e.m41,n.m31*e.m12+n.m32*e.m22+n.m33*e.m32+n.m34*e.m42,n.m31*e.m13+n.m32*e.m23+n.m33*e.m33+n.m34*e.m43,n.m31*e.m14+n.m32*e.m24+n.m33*e.m34+n.m34*e.m44,n.m41*e.m11+n.m42*e.m21+n.m43*e.m31+n.m44*e.m41,n.m41*e.m12+n.m42*e.m22+n.m43*e.m32+n.m44*e.m42,n.m41*e.m13+n.m42*e.m23+n.m43*e.m33+n.m44*e.m43,n.m41*e.m14+n.m42*e.m24+n.m43*e.m34+n.m44*e.m44])}class l{constructor(...t){const e=this;if(e.a=1,e.b=0,e.c=0,e.d=1,e.e=0,e.f=0,e.m11=1,e.m12=0,e.m13=0,e.m14=0,e.m21=0,e.m22=1,e.m23=0,e.m24=0,e.m31=0,e.m32=0,e.m33=1,e.m34=0,e.m41=0,e.m42=0,e.m43=0,e.m44=1,t&&t.length){let n=t;return t instanceof Array&&(t[0]instanceof Array&&[16,6].includes(t[0].length)||"string"==typeof t[0]||[l,DOMMatrix].some(e=>t[0]instanceof e))&&([n]=t),e.setMatrixValue(n)}return e}set isIdentity(t){this.isIdentity=t}get isIdentity(){const t=this;return 1===t.m11&&0===t.m12&&0===t.m13&&0===t.m14&&0===t.m21&&1===t.m22&&0===t.m23&&0===t.m24&&0===t.m31&&0===t.m32&&1===t.m33&&0===t.m34&&0===t.m41&&0===t.m42&&0===t.m43&&1===t.m44}get is2D(){const t=this;return 0===t.m31&&0===t.m32&&1===t.m33&&0===t.m34&&0===t.m43&&1===t.m44}set is2D(t){this.is2D=t}setMatrixValue(r){return[DOMMatrix,l].some(t=>r instanceof t)?e(r):"string"==typeof r&&r.length&&"none"!==r?n(r):Array.isArray(r)?t(r):this}toString(){const t=this.toArray().join(",");return`${this.is2D?"matrix":"matrix3d"}(${t})`}toArray(){const t=this;let e;return e=t.is2D?[t.a,t.b,t.c,t.d,t.e,t.f]:[t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44],e.map(t=>Math.abs(t)<1e-6?0:(t*10**6>>0)/10**6)}toJSON(){return JSON.parse(JSON.stringify(this))}multiply(t){return m(this,t)}translate(t,e,n){let s=e,a=n;return null==a&&(a=0),null==s&&(s=0),m(this,r(t,s,a))}scale(t,e,n){let r=e,s=n;return null==r&&(r=t),null==s&&(s=t),m(this,i(t,r,s))}rotate(t,e,n){let r=t,a=e,i=n;return null==a&&(a=0),null==i&&(i=r,r=0),m(this,s(r,a,i))}rotateAxisAngle(t,e,n,r){if([t,e,n,r].some(t=>Number.isNaN(t)))throw new TypeError("CSSMatrix: expecting 4 values");return m(this,a(t,e,n,r))}skewX(t){return m(this,c(t))}skewY(t){return m(this,o(t))}transformPoint(t){let e=r(t.x,t.y,t.z);return e.m44=t.w||1,e=this.multiply(e),{x:e.m41,y:e.m42,z:e.m43,w:e.m44}}transform(t){const e=this,n=e.m11*t.x+e.m12*t.y+e.m13*t.z+e.m14*t.w,r=e.m21*t.x+e.m22*t.y+e.m23*t.z+e.m24*t.w,s=e.m31*t.x+e.m32*t.y+e.m33*t.z+e.m34*t.w,a=e.m41*t.x+e.m42*t.y+e.m43*t.z+e.m44*t.w;return{x:n/a,y:r/a,z:s/a,w:a}}}l.Translate=r,l.Rotate=s,l.RotateAxisAngle=a,l.Scale=i,l.SkewX=c,l.SkewY=o,l.Multiply=m,l.fromArray=t,l.fromMatrix=e,l.fromString=n;const h={origin:null,decimals:4,round:1};function u(t,e,n){if(t[n].length>7){t[n].shift();const r=t[n];let s=n;for(;r.length;)e[n]="A",t.splice(s+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}const f={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function y(t){return Array.isArray(t)&&t.every(t=>{const e=t[0].toLowerCase();return f[e]===t.length-1&&/[achlmqstvz]/gi.test(e)})}function p(t){return y(t)&&t.slice(1).every(t=>"C"===t[0])}function x(t){return t.map(t=>Array.isArray(t)?x(t):Number.isNaN(+t)?t:+t)}function g(t){let e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;if("m"===n&&r.length>2&&(t.segments.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.segments.push([e].concat(r));else for(;r.length>=f[n]&&(t.segments.push([e].concat(r.splice(0,f[n]))),f[n]););}function d(t){const{index:e}=t,n=t.pathValue.charCodeAt(e);return 48===n?(t.param=0,void(t.index+=1)):49===n?(t.param=1,void(t.index+=1)):void(t.err=`Invalid path value: invalid Arc flag ${n}, expecting 0 or 1 at index ${e}`)}function M(t){return t>=48&&t<=57}function b(t){const{max:e,pathValue:n,index:r}=t;let s,a=r,i=!1,c=!1,o=!1,m=!1;if(a>=e)t.err=`Invalid path value at ${a}: missing param ${n[a]}`;else if(s=n.charCodeAt(a),43!==s&&45!==s||(a+=1,s=a<e?n.charCodeAt(a):0),M(s)||46===s){if(46!==s){if(i=48===s,a+=1,s=a<e?n.charCodeAt(a):0,i&&a<e&&s&&M(s))return void(t.err=`Invalid path value at index ${r}: ${n[r]} illegal number`);for(;a<e&&M(n.charCodeAt(a));)a+=1,c=!0;s=a<e?n.charCodeAt(a):0}if(46===s){for(m=!0,a+=1;M(n.charCodeAt(a));)a+=1,o=!0;s=a<e?n.charCodeAt(a):0}if(101===s||69===s){if(m&&!c&&!o)return void(t.err=`Invalid path value at index ${a}: ${n[a]} invalid float exponent`);if(a+=1,s=a<e?n.charCodeAt(a):0,43!==s&&45!==s||(a+=1),!(a<e&&M(n.charCodeAt(a))))return void(t.err=`Invalid path value at index ${a}: ${n[a]} invalid float exponent`);for(;a<e&&M(n.charCodeAt(a));)a+=1}t.index=a,t.param=+t.pathValue.slice(r,a)}else t.err=`Invalid path value at index ${a}: ${n[a]} is not a number`}function A(t){const{pathValue:e,max:n}=t;for(;t.index<n&&(10===(r=e.charCodeAt(t.index))||13===r||8232===r||8233===r||32===r||9===r||11===r||12===r||160===r||r>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(r)>=0);)t.index+=1;var r}function w(t){return t>=48&&t<=57||43===t||45===t||46===t}function v(t){const{max:e,pathValue:n,index:r}=t,s=n.charCodeAt(r),a=f[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0;default:return!1}}(s))if(t.index+=1,A(t),t.data=[],a){for(;;){for(let r=a;r>0;r-=1){if(97!=(32|s)||3!==r&&4!==r?b(t):d(t),t.err.length)return;t.data.push(t.param),A(t),t.index<e&&44===n.charCodeAt(t.index)&&(t.index+=1,A(t))}if(t.index>=t.max)break;if(!w(n.charCodeAt(t.index)))break}g(t)}else g(t);else t.err=`Invalid path value: ${n[r]} not a path command`}function C(t){this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}function N(t){if(y(t))return x(t);const e=new C(t);for(A(e);e.index<e.max&&!e.err.length;)v(e);return e.err.length?e.segments=[]:e.segments.length&&("mM".indexOf(e.segments[0][0])<0?(e.err="Invalid path value: missing M/m",e.segments=[]):e.segments[0][0]="M"),e.segments}function k(t){return y(t)&&t.every(t=>t[0]===t[0].toUpperCase())}function S(t){if(k(t))return x(t);const e=N(t),n=e.length,r=[];let s=0,a=0,i=0,c=0,o=0;"M"===e[0][0]&&(s=+e[0][1],a=+e[0][2],i=s,c=a,o+=1,r.push(["M",s,a]));for(let t=o;t<n;t+=1){const n=e[t],[o]=n,m=o.toUpperCase(),l=[];let h=[];if(r.push(l),o!==m)switch(l[0]=m,m){case"A":h=n.slice(1,-2).concat([+n[6]+s,+n[7]+a]);for(let t=0;t<h.length;t+=1)l.push(h[t]);break;case"V":l[1]=+n[1]+a;break;case"H":l[1]=+n[1]+s;break;default:"M"===m&&(i=+n[1]+s,c=+n[2]+a);for(let t=1;t<n.length;t+=1)l.push(+n[t]+(t%2?s:a))}else for(let t=0;t<n.length;t+=1)l.push(n[t]);const u=l.length;switch(m){case"Z":s=i,a=c;break;case"H":s=+l[1];break;case"V":a=+l[1];break;default:s=+l[u-2],a=+l[u-1],"M"===m&&(i=s,c=a)}}return r}function q(t,e,n){const[r]=t,s=t.slice(1);let a=t;if("TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null),"H"===r)a=["L",t[1],e.y1];else if("V"===r)a=["L",e.x1,t[1]];else if("S"===r){const{x1:t,y1:r}=function(t,e,n,r,s){return"CS".indexOf(s)>-1?{x1:2*t-n,y1:2*e-r}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,n);e.x1=t,e.y1=r,a=["C",t,r].concat(s)}else if("T"===r){const{qx:t,qy:r}=function(t,e,n,r,s){return"QT".indexOf(s)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n);e.qx=t,e.qy=r,a=["Q",t,r].concat(s)}else if("Q"===r){const[t,n]=s;e.qx=t,e.qy=n}return a}function P(t){return y(t)&&t.every(t=>{const e=t[0].toLowerCase();return f[e]===t.length-1&&"ACLMQZ".includes(t[0])})}function I(t){if(P(t))return x(t);const e=S(t),n={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},r=[],s=e.length;let a,i,c="";for(let t=0;t<s;t+=1){const[s]=e[t];r[t]=s,t&&(c=r[t-1]),e[t]=q(e[t],n,c),a=e[t],i=a.length,n.x1=+a[i-2],n.y1=+a[i-1],n.x2=+a[i-4]||n.x1,n.y2=+a[i-3]||n.y1}return e}function T(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function O(t,e,n,r,s,a,i,c,o,m){const l=120*Math.PI/180,h=Math.PI/180*(s||0);let u,f,y,p,x,g=[],d=t,M=c,b=e,A=o,w=n,v=r;if(m){const[t,e,n,r]=m;f=t,y=e,p=n,x=r}else{u=T(d,b,-h),d=u.x,b=u.y,u=T(M,A,-h),M=u.x,A=u.y;const t=(d-M)/2,e=(b-A)/2;let n=t**2/w**2+e**2/v**2;n>1&&(n=Math.sqrt(n),w*=n,v*=n);const r=w**2,s=v**2,c=(a===i?-1:1)*Math.sqrt(Math.abs((r*s-r*e*e-s*t*t)/(r*e*e+s*t*t)));p=c*w*e/v+(d+M)/2,x=c*-v*t/w+(b+A)/2,f=Math.asin(((b-x)/v*10**9>>0)/10**9),y=Math.asin(((A-x)/v*10**9>>0)/10**9),f=d<p?Math.PI-f:f,y=M<p?Math.PI-y:y,f<0&&(f=2*Math.PI+f),y<0&&(y=2*Math.PI+y),i&&f>y&&(f-=2*Math.PI),!i&&y>f&&(y-=2*Math.PI)}let C=y-f;if(Math.abs(C)>l){const t=y,e=M,n=A;y=f+l*(i&&y>f?1:-1),M=p+w*Math.cos(y),A=x+v*Math.sin(y),g=O(M,A,w,v,s,0,i,e,n,[y,t,p,x])}C=y-f;const N=Math.cos(f),k=Math.sin(f),S=Math.cos(y),q=Math.sin(y),P=Math.tan(C/4),I=4/3*w*P,V=4/3*v*P,$=[d,b],z=[d+I*k,b-V*N],L=[M+I*q,A-V*S],E=[M,A];return z[0]=2*$[0]-z[0],z[1]=2*$[1]-z[1],m?[z,L,E].concat(g):(g=[z,L,E].concat(g).join().split(","),g.map((t,e)=>e%2?T(g[e-1],t,h).y:T(t,g[e+1],h).x))}function V(t,e,n,r,s,a){return[1/3*t+2/3*n,1/3*e+2/3*r,1/3*s+2/3*n,1/3*a+2/3*r,s,a]}function $(t,e,n,r,s,a,i,c,o){const m=1-o;return{x:m**3*t+m*m*3*o*n+3*m*o*o*s+o**3*i,y:m**3*e+m*m*3*o*r+3*m*o*o*a+o**3*c}}function z(t,e,n){const[r,s]=t,[a,i]=e;return[r+(a-r)*n,s+(i-s)*n]}function L(t,e,n,r){const s=.5,a=[t,e],i=[n,r],c=z(a,i,s),o=z(i,c,s),m=z(c,o,s),l=z(o,m,s),h=z(m,l,s),u=$.apply(0,a.concat(c,m,h,s)),f=$.apply(0,h.concat(l,o,i,0));return[u.x,u.y,f.x,f.y,n,r]}function E(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);const[n,r]=t.slice(1);switch(t[0]){case"M":return e.x=n,e.y=r,t;case"A":return["C"].concat(O.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=n,e.qy=r,["C"].concat(V.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(L(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(L(e.x1,e.y1,e.x,e.y))}return t}function j(t){if(p(t))return x(t);const e=I(t),n={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},r=[];let s="",a=e.length;for(let t=0;t<a;t+=1){const i=e[t],c=i.length;i&&([s]=i),r[t]=s,e[t]=E(i,n),u(e,r,t),a=e.length,n.x1=+i[c-2],n.y1=+i[c-1],n.x2=+i[c-4]||n.x1,n.y2=+i[c-3]||n.y1}return e}function D(t,e,n,r,s,a,i,c){return 3*((c-e)*(n+s)-(i-t)*(r+a)+r*(t-s)-n*(e-a)+c*(s+t/3)-i*(a+e/3))/20}function Z(t){let e=0,n=0,r=0,s=0,a=0;return j(t).map(t=>{switch(t[0]){case"M":case"Z":return r="M"===t[0]?t[1]:r,s="M"===t[0]?t[2]:s,e=r,n=s,0;default:return a=D.apply(0,[e,n].concat(t.slice(1))),[e,n]=t.slice(-2),a}}).reduce((t,e)=>t+e,0)}function Q(t,e,n,r,s){return s*(s*(-3*t+9*e-9*n+3*r)+6*t-12*e+6*n)-3*t+3*e}function X(t,e,n,r,s,a,i,c,o){let m;(null===o||Number.isNaN(+o))&&(m=1),m>1&&(m=1),m<0&&(m=0);const l=m/2;let h=0,u=0,f=0,y=0;const p=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];return[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816].forEach((o,m)=>{h=l*o+l,u=Q(t,n,s,i,h),f=Q(e,r,a,c,h),y+=p[m]*Math.sqrt(u*u+f*f)}),l*y}function Y(t,e,n,r,s,a,i,c){let o=s-2*n+t-(i-2*s+n),m=2*(n-t)-2*(s-n),l=t-n,h=(-m+Math.sqrt(m*m-4*o*l))/2/o,u=(-m-Math.sqrt(m*m-4*o*l))/2/o;const f=[e,c],y=[t,i];let p;return Math.abs(h)>"1e12"&&(h=.5),Math.abs(u)>"1e12"&&(u=.5),h>0&&h<1&&(p=$(t,e,n,r,s,a,i,c,h),y.push(p.x),f.push(p.y)),u>0&&u<1&&(p=$(t,e,n,r,s,a,i,c,u),y.push(p.x),f.push(p.y)),o=a-2*r+e-(c-2*a+r),m=2*(r-e)-2*(a-r),l=e-r,h=(-m+Math.sqrt(m*m-4*o*l))/2/o,u=(-m-Math.sqrt(m*m-4*o*l))/2/o,Math.abs(h)>"1e12"&&(h=.5),Math.abs(u)>"1e12"&&(u=.5),h>0&&h<1&&(p=$(t,e,n,r,s,a,i,c,h),y.push(p.x),f.push(p.y)),u>0&&u<1&&(p=$(t,e,n,r,s,a,i,c,u),y.push(p.x),f.push(p.y)),{min:{x:Math.min.apply(0,y),y:Math.min.apply(0,f)},max:{x:Math.max.apply(0,y),y:Math.max.apply(0,f)}}}function H(t){if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0};const e=j(t);let n=0,r=0,s=[],a=[];e.forEach(t=>{const[e,i]=t.slice(-2);if("M"===t[0])n=e,r=i,s.push(e),a.push(i);else{const c=Y.apply(0,[n,r].concat(t.slice(1)));s=s.concat(c.min.x,c.max.x),a=a.concat(c.min.y,c.max.y),n=e,r=i}});const i=Math.min.apply(0,s),c=Math.min.apply(0,a),o=Math.max.apply(0,s),m=Math.max.apply(0,a),l=o-i,h=m-c;return{width:l,height:h,x:i,y:c,x2:o,y2:m,cx:i+l/2,cy:c+h/2}}function R(t){return y(t)&&t.slice(1).every(t=>t[0]===t[0].toLowerCase())}function J(t,e){const{round:n,decimals:r}=h,s=Number.isNaN(+e)?n&&r:+e;return s?t.map(t=>t.map(t=>{const e=+t,n=10**s;return e?e%1==0?e:Math.round(e*n)/n:t})):x(t)}function B(t,e){return J(t,e).map(t=>t[0].concat(t.slice(1).join(" "))).join("")}const F={circle:["cx","cy","r"],ellipse:["cx","cy","rx","ry"],rect:["width","height","x","y","rx","ry"],polygon:["points"],polyline:["points"],glyph:[]};function G(t){return B(S(t)).replace(/(m|M)/g,"|$1").split("|").map(t=>t.trim()).filter(t=>t)}function U(t){if(R(t))return x(t);const e=N(t),n=e.length,r=[];let s=0,a=0,i=0,c=0,o=0;"M"===e[0][0]&&(s=+e[0][1],a=+e[0][2],i=s,c=a,o+=1,r.push(["M",s,a]));for(let t=o;t<n;t+=1){const n=e[t],[o]=n,m=o.toLowerCase(),l=[];let h=[];if(r.push(l),o!==m)switch(l[0]=m,m){case"a":h=n.slice(1,-2).concat([+n[6]-s,+n[7]-a]);for(let t=0;t<h.length;t+=1)l.push(h[t]);break;case"v":l[1]=+n[1]-a;break;default:for(let t=1;t<n.length;t+=1)l.push(+n[t]-(t%2?s:a));"m"===m&&(i=+n[1],c=+n[2])}else{"m"===o&&(i=+n[1]+s,c=+n[2]+a);for(let t=0;t<n.length;t+=1)l.push(n[t])}const u=l.length;switch(l[0]){case"z":s=i,a=c;break;case"h":s+=l[u-1];break;case"v":a+=l[u-1];break;default:s+=r[t][u-2],a+=r[t][u-1]}}return r}function K(t,e){const n=J(S(t),e),r=J(U(t),e);return n.map((t,e)=>e?t.join("").length<r[e].join("").length?t:r[e]:t)}function W(t){const e=S(t),n="Z"===e.slice(-1)[0][0];let r=[],s=0;return r=I(e).map((t,n)=>(s=t.length,{seg:e[n],n:t,c:e[n][0],x:t[s-2],y:t[s-1]})).map((t,e,r)=>{const s=t.seg,a=t.n,i=e&&r[e-1],c=r[e+1]&&r[e+1],o=t.c,m=r.length,l=e?r[e-1].x:r[m-1].x,h=e?r[e-1].y:r[m-1].y;let u=[];switch(o){case"M":u=n?["Z"]:[o,l,h];break;case"A":u=s.slice(0,-3).concat([1===s[5]?0:1,l,h]);break;case"C":u=c&&"S"===c.c?["S",s[1],s[2],l,h]:[o,s[3],s[4],s[1],s[2],l,h];break;case"S":u=i&&"CS".indexOf(i.c)>-1&&(!c||c&&"S"!==c.c)?["C",a[3],a[4],a[1],a[2],l,h]:[o,a[1],a[2],l,h];break;case"Q":u=c&&"T"===c.c?["T",l,h]:s.slice(0,-2).concat([l,h]);break;case"T":u=i&&"QT".indexOf(i.c)>-1&&(!c||c&&"T"!==c.c)?["Q",a[1],a[2],l,h]:[o,l,h];break;case"Z":u=["M",l,h];break;case"H":u=[o,l];break;case"V":u=[o,h];break;default:u=s.slice(0,-2).concat([l,h])}return u}),n?r.reverse():[r[0]].concat(r.slice(1).reverse())}function _(t){let e=new l;const{origin:n}=t,r=+n[0],s=+n[1],{translate:a}=t,{rotate:i}=t,{skew:c}=t,{scale:o}=t;return(!Number.isNaN(a)||Array.isArray(a)&&a.some(t=>0!=+t))&&(e=Array.isArray(a)?e.translate(+a[0]||0,+a[1]||0,+a[2]||0):e.translate(+a||0,0,0)),(i||c||o)&&(e=e.translate(+r,+s),i&&(e=Array.isArray(i)&&i.some(t=>0!=+t)?e.rotate(+i[0]||0,+i[1]||0,+i[2]||0):e.rotate(+i||0)),Array.isArray(c)&&c.some(t=>0!=+t)&&(Array.isArray(c)?(e=c[0]?e.skewX(+c[0]||0):e,e=c[1]?e.skewY(+c[1]||0):e):e=e.skewX(+c||0)),(!Number.isNaN(o)||Array.isArray(o)&&o.some(t=>1!=+t))&&(e=Array.isArray(o)?e.scale(+o[0]||1,+o[1]||1,+o[2]||1):e.scale(+o||1)),e=e.translate(-r,-s)),e}function tt(t,e,n){const r=t.transformPoint({x:e[0],y:e[1],z:0,w:1}),s=n[0]||0,a=n[1]||0,i=n[2]||0,c=r.x-s,o=r.y-a,m=r.z-i;return[c*(Math.abs(i)/Math.abs(m))+s,o*(Math.abs(i)/Math.abs(m))+a]}function et(t,e){let n,r,s,a,i,c,o,m,l;const h=S(t),f=I(h),y=_(e),p=Object.keys(e),{origin:g}=e,{a:d,b:M,c:b,d:A,e:w,f:v}=y,C=[d,M,b,A,w,v],N={x1:0,y1:0,x2:0,y2:0,x:0,y:0};let k=[],q=0,P="",T=[];const O=[];let V=[];if(!y.isIdentity){for(s=0,i=h.length;s<i;s+=1)k=h[s],h[s]&&([P]=k),O[s]=P,"A"!==P||y.is2D&&["skewX","skewY"].find(t=>p.includes(t))||(k=E(f[s],N),h[s]=E(f[s],N),u(h,O,s),f[s]=E(f[s],N),u(f,O,s),i=Math.max(h.length,f.length)),k=f[s],q=k.length,N.x1=+k[q-2],N.y1=+k[q-1],N.x2=+k[q-4]||N.x1,N.y2=+k[q-3]||N.y1,V={s:h[s],c:h[s][0]},"Z"!==P&&(V.x=N.x1,V.y=N.y1),T=T.concat(V);return T=T.map(t=>{switch(P=t.c,k=t.s,P){case"A":return l=function(t,e,n,r){const s=Math.cos(r*Math.PI/180),a=Math.sin(r*Math.PI/180),i=[e*(t[0]*s+t[2]*a),e*(t[1]*s+t[3]*a),n*(-t[0]*a+t[2]*s),n*(-t[1]*a+t[3]*s)],c=i[0]*i[0]+i[2]*i[2],o=i[1]*i[1]+i[3]*i[3];let m=((i[0]-i[3])*(i[0]-i[3])+(i[2]+i[1])*(i[2]+i[1]))*((i[0]+i[3])*(i[0]+i[3])+(i[2]-i[1])*(i[2]-i[1]));const l=(c+o)/2;if(m<1e-9*l){const t=Math.sqrt(l);return{rx:t,ry:t,ax:0}}const h=i[0]*i[1]+i[2]*i[3];m=Math.sqrt(m);const u=l+m/2,f=l-m/2;let y,p,x=Math.abs(h)<1e-9&&Math.abs(u-o)<1e-9?90:Math.atan(Math.abs(h)>Math.abs(u-o)?(u-c)/h:h/(u-o)*180)/Math.PI;return x>=0?(y=Math.sqrt(u),p=Math.sqrt(f)):(x+=90,y=Math.sqrt(f),p=Math.sqrt(u)),{rx:y,ry:p,ax:x}}(C,k[1],k[2],k[3]),C[0]*C[3]-C[1]*C[2]<0&&(k[5]=+k[5]?0:1),[o,m]=tt(y,[k[6],k[7]],g),k=n===o&&r===m||l.rx<1e-9*l.ry||l.ry<1e-9*l.rx?["L",o,m]:[P,l.rx,l.ry,l.ax,k[4],k[5],o,m],n=o,r=m,k;case"L":case"H":case"V":return[o,m]=tt(y,[t.x,t.y],g),n!==o&&r!==m?k=["L",o,m]:r===m?k=["H",o]:n===o&&(k=["V",m]),n=o,r=m,k;default:for(a=1,c=k.length;a<c;a+=2)[n,r]=tt(y,[k[a],k[a+1]],g),k[a]=n,k[a+1]=r;return k}}),T}return x(h)}const nt={CSSMatrix:l,parsePathString:N,isPathArray:y,isCurveArray:p,isAbsoluteArray:k,isRelativeArray:R,isNormalizedArray:P,isValidPath:function(t){if("string"!=typeof t)return!1;const e=new C(t);for(A(e);e.index<e.max&&!e.err.length;)v(e);return!e.err.length&&"mM".includes(e.segments[0][0])},pathToAbsolute:S,pathToRelative:U,pathToCurve:j,pathToString:B,getDrawDirection:function(t){return Z(j(t))>=0},getPathArea:Z,getPathBBox:H,getPathLength:function(t){let e=0;return j(t).forEach((t,n,r)=>{e+="M"===t[0]?0:X.apply(0,r[n-1].slice(-2).concat(t.slice(1)))}),e},getPointAtLength:function(t,e){let n,r,s,a=0;return j(t).map((t,i,c)=>(r=i?c[i-1].slice(-2).concat(t.slice(1)):t.slice(1),n=i?X.apply(0,r):0,a+=n,s=0===i?{x:r[0],y:r[1]}:a>e&&e>a-n?$.apply(0,r.concat(1-(a-e)/n)):null,s)).filter(t=>t).slice(-1)[0]},clonePath:x,splitPath:G,roundPath:J,optimizePath:K,reverseCurve:function(t){const e=t.slice(1).map((e,n,r)=>n?r[n-1].slice(-2).concat(e.slice(1)):t[0].slice(1).concat(e.slice(1))).map(t=>t.map((e,n)=>t[t.length-n-2*(1-n%2)])).reverse();return[["M"].concat(e[0].slice(0,2))].concat(e.map(t=>["C"].concat(t.slice(2))))},reversePath:W,normalizePath:I,transformPath:et,getSVGMatrix:_,shapeToPath:function(t,e){if(!Object.keys(F).concat(["glyph"]).some(e=>t.tagName===e))throw TypeError(`shapeToPath: ${t} is not SVGElement`);const n=document.createElementNS("http://www.w3.org/2000/svg","path"),r=t.tagName,s=F[r],a={type:r};let i;return s.forEach(e=>{a[e]=t.getAttribute(e)}),Object.values(t.attributes).forEach(({name:t,value:e})=>{s.includes(t)||n.setAttribute(t,e)}),["circle","ellipse"].includes(r)?i=B(function(t){const{type:e,cx:n,cy:r,r:s}=t;let{rx:a,ry:i}=t;return"circle"===e&&s>0&&(a=s,i=s),[["M",n-a,r],["a",a,i,0,1,0,2*a,0],["a",a,i,0,1,0,-2*a,0]]}(a)):["polyline","polygon"].includes(r)?i=B(function(t){const e=[];let{points:n}=t;n=n.split(/[\s|,]/).map(Number);let r=0;for(;r<n.length;)e.push([r?"L":"M",n[r],n[r+1]]),r+=2;return"polygon"===t.type?e.concat([["z"]]):e}(a)):"rect"===r?i=B(function(t){const e=+t.x||0,n=+t.y||0,r=+t.width,s=+t.height;let a=+t.rx,i=+t.ry;return a||i?(a=a||i,i=i||a,2*a>r&&(a-=(2*a-r)/2),2*i>s&&(i-=(2*i-s)/2),[["M",e+a,n],["h",r-2*a],["s",a,0,a,i],["v",s-2*i],["s",0,i,-a,i],["h",2*a-r],["s",-a,0,-a,-i],["v",2*i-s],["s",0,-i,a,-i]]):[["M",e,n],["h",r],["v",s],["H",e],["Z"]]}(a)):"line"===r?i=B(function(t){const{x1:e,y1:n,x2:r,y2:s}=t;return[["M",+e,+n],["L",+r,+s]]}(a)):"glyph"===r&&(i=t.getAttribute("d")),i?(n.setAttribute("d",i),e&&(t.before(n,t),t.remove()),n):null},options:h,Version:"0.1.9"};class rt{constructor(t,e){const n=e||{};let{round:r}=h;const{round:s}=n;0!=+s&&!1!==s||(r=0);const{decimals:a}=r&&(n||h);return this.round=0===r?0:a,this.segments=N(t),this.pathValue=t,this}toAbsolute(){const{segments:t}=this;return this.segments=S(t),this}toRelative(){const{segments:t}=this;return this.segments=U(t),this}reverse(t){this.toAbsolute();const{segments:e}=this,n=G(this.pathValue).length>1&&G(this.toString()),r=n&&x(n).map((e,n)=>t?n?W(e):N(e):W(e));let s=[];return s=n?r.flat(1):t?e:W(e),this.segments=x(s),this}normalize(){const{segments:t}=this;return this.segments=I(t),this}optimize(){const{segments:t}=this;return this.segments=K(t,this.round),this}transform(t){if(!t||"object"!=typeof t||"object"==typeof t&&!["translate","rotate","skew","scale"].some(e=>e in t))return this;const e=t||{},{segments:n}=this;if(!e.origin){const t=H(n);e.origin=[t.cx,t.cy,t.cx]}return this.segments=et(n,e),this}flipX(){return this.transform({rotate:[180,0,0]}),this}flipY(){return this.transform({rotate:[0,180,0]}),this}toString(){return B(this.segments,this.round)}}Object.keys(nt).forEach(t=>{rt[t]=nt[t]});export{rt as default};
1
+ // SVGPathCommander v0.1.10alpha1 | thednp © 2021 | MIT-License
2
+ function t(t){if(!t.every(t=>!Number.isNaN(t)))throw TypeError(`CSSMatrix: "${t}" must only have numbers.`);const e=new l,n=Array.from(t);if(16===n.length){const[t,r,s,a,i,c,o,m,l,h,u,f,y,p,x,g]=n;e.m11=t,e.a=t,e.m21=i,e.c=i,e.m31=l,e.m41=y,e.e=y,e.m12=r,e.b=r,e.m22=c,e.d=c,e.m32=h,e.m42=p,e.f=p,e.m13=s,e.m23=o,e.m33=u,e.m43=x,e.m14=a,e.m24=m,e.m34=f,e.m44=g}else{if(6!==n.length)throw new TypeError("CSSMatrix: expecting an Array of 6/16 values.");{const[t,r,s,a,i,c]=n;e.m11=t,e.a=t,e.m12=r,e.b=r,e.m21=s,e.c=s,e.m22=a,e.d=a,e.m41=i,e.e=i,e.m42=c,e.f=c}}return e}function e(e){if(![l,DOMMatrix,Object].some(t=>e instanceof t))throw TypeError(`CSSMatrix: "${e}" is not a DOMMatrix / CSSMatrix compatible object.`);return t([e.m11,e.m12,e.m13,e.m14,e.m21,e.m22,e.m23,e.m24,e.m31,e.m32,e.m33,e.m34,e.m41,e.m42,e.m43,e.m44])}function n(e){if("string"!=typeof e)throw TypeError(`CSSMatrix: "${e}" is not a string.`);const n=String(e).replace(/\s/g,"");let r=new l;return n.split(")").filter(t=>t).map(t=>{const[e,n]=t.split("(");return{prop:e,components:n.split(",").map(t=>t.includes("rad")?parseFloat(t)*(180/Math.PI):parseFloat(t))}}).forEach(e=>{const{prop:n,components:s}=e,[a,i,c,o]=s,m=[a,i,c],l=[a,i,c,o];if(n.includes("matrix")){const e=s.map(t=>Math.abs(t)<1e-6?0:t);[6,16].includes(e.length)&&(r=r.multiply(t(e)))}else if(["translate","translate3d"].some(t=>n===t)&&a)r=r.translate(a,i||0,c||0);else if("rotate3d"===n&&l.every(t=>!Number.isNaN(+t))&&o)r=r.rotateAxisAngle(a,i,c,o);else if("scale3d"===n&&m.every(t=>!Number.isNaN(+t))&&m.some(t=>1!==t))r=r.scale(a,i,c);else if("rotate"===n&&a)r=r.rotate(0,0,a);else if("scale"!==n||Number.isNaN(a)||1===a){if("skew"===n&&(a||i))r=a?r.skewX(a):r,r=i?r.skewY(i):r;else if(/[XYZ]/.test(n)&&a)if(n.includes("skew"))r=r[n](a);else{const t=n.replace(/[XYZ]/,""),e=n.replace(t,""),s=["X","Y","Z"].indexOf(e),i=[0===s?a:0,1===s?a:0,2===s?a:0];r=r[t](...i)}}else{const t=Number.isNaN(+i)?a:i;r=r.scale(a,t,1)}}),r}function r(t,e,n){const r=new l;return r.m41=t,r.e=t,r.m42=e,r.f=e,r.m43=n,r}function s(t,e,n){const r=new l,s=Math.PI/180,a=t*s,i=e*s,c=n*s,o=Math.cos(a),m=-Math.sin(a),h=Math.cos(i),u=-Math.sin(i),f=Math.cos(c),y=-Math.sin(c),p=h*f,x=-h*y;r.m11=p,r.a=p,r.m12=x,r.b=x,r.m13=u;const g=m*u*f+o*y;r.m21=g,r.c=g;const d=o*f-m*u*y;return r.m22=d,r.d=d,r.m23=-m*h,r.m31=m*y-o*u*f,r.m32=m*f+o*u*y,r.m33=o*h,r}function a(t,e,n,r){const s=new l,a=r*(Math.PI/360),i=Math.sin(a),c=Math.cos(a),o=i*i,m=Math.sqrt(t*t+e*e+n*n);let h=t,u=e,f=n;0===m?(h=0,u=0,f=1):(h/=m,u/=m,f/=m);const y=h*h,p=u*u,x=f*f,g=1-2*(p+x)*o;s.m11=g,s.a=g;const d=2*(h*u*o+f*i*c);s.m12=d,s.b=d,s.m13=2*(h*f*o-u*i*c);const M=2*(u*h*o-f*i*c);s.m21=M,s.c=M;const b=1-2*(x+y)*o;return s.m22=b,s.d=b,s.m23=2*(u*f*o+h*i*c),s.m31=2*(f*h*o+u*i*c),s.m32=2*(f*u*o-h*i*c),s.m33=1-2*(y+p)*o,s}function i(t,e,n){const r=new l;return r.m11=t,r.a=t,r.m22=e,r.d=e,r.m33=n,r}function c(t){const e=new l,n=t*Math.PI/180,r=Math.tan(n);return e.m21=r,e.c=r,e}function o(t){const e=new l,n=t*Math.PI/180,r=Math.tan(n);return e.m12=r,e.b=r,e}function m(e,n){return t([n.m11*e.m11+n.m12*e.m21+n.m13*e.m31+n.m14*e.m41,n.m11*e.m12+n.m12*e.m22+n.m13*e.m32+n.m14*e.m42,n.m11*e.m13+n.m12*e.m23+n.m13*e.m33+n.m14*e.m43,n.m11*e.m14+n.m12*e.m24+n.m13*e.m34+n.m14*e.m44,n.m21*e.m11+n.m22*e.m21+n.m23*e.m31+n.m24*e.m41,n.m21*e.m12+n.m22*e.m22+n.m23*e.m32+n.m24*e.m42,n.m21*e.m13+n.m22*e.m23+n.m23*e.m33+n.m24*e.m43,n.m21*e.m14+n.m22*e.m24+n.m23*e.m34+n.m24*e.m44,n.m31*e.m11+n.m32*e.m21+n.m33*e.m31+n.m34*e.m41,n.m31*e.m12+n.m32*e.m22+n.m33*e.m32+n.m34*e.m42,n.m31*e.m13+n.m32*e.m23+n.m33*e.m33+n.m34*e.m43,n.m31*e.m14+n.m32*e.m24+n.m33*e.m34+n.m34*e.m44,n.m41*e.m11+n.m42*e.m21+n.m43*e.m31+n.m44*e.m41,n.m41*e.m12+n.m42*e.m22+n.m43*e.m32+n.m44*e.m42,n.m41*e.m13+n.m42*e.m23+n.m43*e.m33+n.m44*e.m43,n.m41*e.m14+n.m42*e.m24+n.m43*e.m34+n.m44*e.m44])}class l{constructor(...t){const e=this;if(e.a=1,e.b=0,e.c=0,e.d=1,e.e=0,e.f=0,e.m11=1,e.m12=0,e.m13=0,e.m14=0,e.m21=0,e.m22=1,e.m23=0,e.m24=0,e.m31=0,e.m32=0,e.m33=1,e.m34=0,e.m41=0,e.m42=0,e.m43=0,e.m44=1,t&&t.length){let n=t;return t instanceof Array&&(t[0]instanceof Array&&[16,6].includes(t[0].length)||"string"==typeof t[0]||[l,DOMMatrix].some(e=>t[0]instanceof e))&&([n]=t),e.setMatrixValue(n)}return e}set isIdentity(t){this.isIdentity=t}get isIdentity(){const t=this;return 1===t.m11&&0===t.m12&&0===t.m13&&0===t.m14&&0===t.m21&&1===t.m22&&0===t.m23&&0===t.m24&&0===t.m31&&0===t.m32&&1===t.m33&&0===t.m34&&0===t.m41&&0===t.m42&&0===t.m43&&1===t.m44}get is2D(){const t=this;return 0===t.m31&&0===t.m32&&1===t.m33&&0===t.m34&&0===t.m43&&1===t.m44}set is2D(t){this.is2D=t}setMatrixValue(r){return[DOMMatrix,l].some(t=>r instanceof t)?e(r):"string"==typeof r&&r.length&&"none"!==r?n(r):Array.isArray(r)?t(r):this}toString(){const t=this.toArray().join(",");return`${this.is2D?"matrix":"matrix3d"}(${t})`}toArray(){const t=this;let e;return e=t.is2D?[t.a,t.b,t.c,t.d,t.e,t.f]:[t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44],e.map(t=>Math.abs(t)<1e-6?0:(t*10**6>>0)/10**6)}toJSON(){return JSON.parse(JSON.stringify(this))}multiply(t){return m(this,t)}translate(t,e,n){let s=e,a=n;return null==a&&(a=0),null==s&&(s=0),m(this,r(t,s,a))}scale(t,e,n){let r=e,s=n;return null==r&&(r=t),null==s&&(s=t),m(this,i(t,r,s))}rotate(t,e,n){let r=t,a=e,i=n;return null==a&&(a=0),null==i&&(i=r,r=0),m(this,s(r,a,i))}rotateAxisAngle(t,e,n,r){if([t,e,n,r].some(t=>Number.isNaN(t)))throw new TypeError("CSSMatrix: expecting 4 values");return m(this,a(t,e,n,r))}skewX(t){return m(this,c(t))}skewY(t){return m(this,o(t))}transformPoint(t){let e=r(t.x,t.y,t.z);return e.m44=t.w||1,e=this.multiply(e),{x:e.m41,y:e.m42,z:e.m43,w:e.m44}}transform(t){const e=this,n=e.m11*t.x+e.m12*t.y+e.m13*t.z+e.m14*t.w,r=e.m21*t.x+e.m22*t.y+e.m23*t.z+e.m24*t.w,s=e.m31*t.x+e.m32*t.y+e.m33*t.z+e.m34*t.w,a=e.m41*t.x+e.m42*t.y+e.m43*t.z+e.m44*t.w;return{x:n/a,y:r/a,z:s/a,w:a}}}l.Translate=r,l.Rotate=s,l.RotateAxisAngle=a,l.Scale=i,l.SkewX=c,l.SkewY=o,l.Multiply=m,l.fromArray=t,l.fromMatrix=e,l.fromString=n;const h={origin:null,decimals:4,round:1};function u(t,e,n){if(t[n].length>7){t[n].shift();const r=t[n];let s=n;for(;r.length;)e[n]="A",t.splice(s+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}const f={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function y(t){return Array.isArray(t)&&t.every(t=>{const e=t[0].toLowerCase();return f[e]===t.length-1&&/[achlmqstvz]/gi.test(e)})}function p(t){return y(t)&&t.slice(1).every(t=>"C"===t[0])}function x(t){return t.map(t=>Array.isArray(t)?x(t):Number.isNaN(+t)?t:+t)}function g(t){let e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;if("m"===n&&r.length>2&&(t.segments.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.segments.push([e].concat(r));else for(;r.length>=f[n]&&(t.segments.push([e].concat(r.splice(0,f[n]))),f[n]););}function d(t){const{index:e}=t,n=t.pathValue.charCodeAt(e);return 48===n?(t.param=0,void(t.index+=1)):49===n?(t.param=1,void(t.index+=1)):void(t.err=`Invalid path value: invalid Arc flag ${n}, expecting 0 or 1 at index ${e}`)}function M(t){return t>=48&&t<=57}function b(t){const{max:e,pathValue:n,index:r}=t;let s,a=r,i=!1,c=!1,o=!1,m=!1;if(a>=e)t.err=`Invalid path value at ${a}: missing param ${n[a]}`;else if(s=n.charCodeAt(a),43!==s&&45!==s||(a+=1,s=a<e?n.charCodeAt(a):0),M(s)||46===s){if(46!==s){if(i=48===s,a+=1,s=a<e?n.charCodeAt(a):0,i&&a<e&&s&&M(s))return void(t.err=`Invalid path value at index ${r}: ${n[r]} illegal number`);for(;a<e&&M(n.charCodeAt(a));)a+=1,c=!0;s=a<e?n.charCodeAt(a):0}if(46===s){for(m=!0,a+=1;M(n.charCodeAt(a));)a+=1,o=!0;s=a<e?n.charCodeAt(a):0}if(101===s||69===s){if(m&&!c&&!o)return void(t.err=`Invalid path value at index ${a}: ${n[a]} invalid float exponent`);if(a+=1,s=a<e?n.charCodeAt(a):0,43!==s&&45!==s||(a+=1),!(a<e&&M(n.charCodeAt(a))))return void(t.err=`Invalid path value at index ${a}: ${n[a]} invalid float exponent`);for(;a<e&&M(n.charCodeAt(a));)a+=1}t.index=a,t.param=+t.pathValue.slice(r,a)}else t.err=`Invalid path value at index ${a}: ${n[a]} is not a number`}function A(t){const{pathValue:e,max:n}=t;for(;t.index<n&&(10===(r=e.charCodeAt(t.index))||13===r||8232===r||8233===r||32===r||9===r||11===r||12===r||160===r||r>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(r)>=0);)t.index+=1;var r}function w(t){return t>=48&&t<=57||43===t||45===t||46===t}function v(t){const{max:e,pathValue:n,index:r}=t,s=n.charCodeAt(r),a=f[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0;default:return!1}}(s))if(t.index+=1,A(t),t.data=[],a){for(;;){for(let r=a;r>0;r-=1){if(97!=(32|s)||3!==r&&4!==r?b(t):d(t),t.err.length)return;t.data.push(t.param),A(t),t.index<e&&44===n.charCodeAt(t.index)&&(t.index+=1,A(t))}if(t.index>=t.max)break;if(!w(n.charCodeAt(t.index)))break}g(t)}else g(t);else t.err=`Invalid path value: ${n[r]} not a path command`}function C(t){this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}function N(t){if(y(t))return x(t);const e=new C(t);for(A(e);e.index<e.max&&!e.err.length;)v(e);return e.err.length?e.segments=[]:e.segments.length&&("mM".indexOf(e.segments[0][0])<0?(e.err="Invalid path value: missing M/m",e.segments=[]):e.segments[0][0]="M"),e.segments}function k(t){return y(t)&&t.every(t=>t[0]===t[0].toUpperCase())}function S(t){if(k(t))return x(t);const e=N(t),n=e.length,r=[];let s=0,a=0,i=0,c=0,o=0;"M"===e[0][0]&&(s=+e[0][1],a=+e[0][2],i=s,c=a,o+=1,r.push(["M",s,a]));for(let t=o;t<n;t+=1){const n=e[t],[o]=n,m=o.toUpperCase(),l=[];let h=[];if(r.push(l),o!==m)switch(l[0]=m,m){case"A":h=n.slice(1,-2).concat([+n[6]+s,+n[7]+a]);for(let t=0;t<h.length;t+=1)l.push(h[t]);break;case"V":l[1]=+n[1]+a;break;case"H":l[1]=+n[1]+s;break;default:"M"===m&&(i=+n[1]+s,c=+n[2]+a);for(let t=1;t<n.length;t+=1)l.push(+n[t]+(t%2?s:a))}else for(let t=0;t<n.length;t+=1)l.push(n[t]);const u=l.length;switch(m){case"Z":s=i,a=c;break;case"H":s=+l[1];break;case"V":a=+l[1];break;default:s=+l[u-2],a=+l[u-1],"M"===m&&(i=s,c=a)}}return r}function q(t,e,n){const[r]=t,s=t.slice(1);let a=t;if("TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null),"H"===r)a=["L",t[1],e.y1];else if("V"===r)a=["L",e.x1,t[1]];else if("S"===r){const{x1:t,y1:r}=function(t,e,n,r,s){return"CS".indexOf(s)>-1?{x1:2*t-n,y1:2*e-r}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,n);e.x1=t,e.y1=r,a=["C",t,r].concat(s)}else if("T"===r){const{qx:t,qy:r}=function(t,e,n,r,s){return"QT".indexOf(s)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n);e.qx=t,e.qy=r,a=["Q",t,r].concat(s)}else if("Q"===r){const[t,n]=s;e.qx=t,e.qy=n}return a}function P(t){return y(t)&&t.every(t=>{const e=t[0].toLowerCase();return f[e]===t.length-1&&"ACLMQZ".includes(t[0])})}function I(t){if(P(t))return x(t);const e=S(t),n={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},r=[],s=e.length;let a,i,c="";for(let t=0;t<s;t+=1){const[s]=e[t];r[t]=s,t&&(c=r[t-1]),e[t]=q(e[t],n,c),a=e[t],i=a.length,n.x1=+a[i-2],n.y1=+a[i-1],n.x2=+a[i-4]||n.x1,n.y2=+a[i-3]||n.y1}return e}function T(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function O(t,e,n,r,s,a,i,c,o,m){const l=120*Math.PI/180,h=Math.PI/180*(s||0);let u,f,y,p,x,g=[],d=t,M=c,b=e,A=o,w=n,v=r;if(m){const[t,e,n,r]=m;f=t,y=e,p=n,x=r}else{u=T(d,b,-h),d=u.x,b=u.y,u=T(M,A,-h),M=u.x,A=u.y;const t=(d-M)/2,e=(b-A)/2;let n=t**2/w**2+e**2/v**2;n>1&&(n=Math.sqrt(n),w*=n,v*=n);const r=w**2,s=v**2,c=(a===i?-1:1)*Math.sqrt(Math.abs((r*s-r*e*e-s*t*t)/(r*e*e+s*t*t)));p=c*w*e/v+(d+M)/2,x=c*-v*t/w+(b+A)/2,f=Math.asin(((b-x)/v*10**9>>0)/10**9),y=Math.asin(((A-x)/v*10**9>>0)/10**9),f=d<p?Math.PI-f:f,y=M<p?Math.PI-y:y,f<0&&(f=2*Math.PI+f),y<0&&(y=2*Math.PI+y),i&&f>y&&(f-=2*Math.PI),!i&&y>f&&(y-=2*Math.PI)}let C=y-f;if(Math.abs(C)>l){const t=y,e=M,n=A;y=f+l*(i&&y>f?1:-1),M=p+w*Math.cos(y),A=x+v*Math.sin(y),g=O(M,A,w,v,s,0,i,e,n,[y,t,p,x])}C=y-f;const N=Math.cos(f),k=Math.sin(f),S=Math.cos(y),q=Math.sin(y),P=Math.tan(C/4),I=4/3*w*P,V=4/3*v*P,$=[d,b],z=[d+I*k,b-V*N],L=[M+I*q,A-V*S],E=[M,A];return z[0]=2*$[0]-z[0],z[1]=2*$[1]-z[1],m?[z,L,E].concat(g):(g=[z,L,E].concat(g).join().split(","),g.map((t,e)=>e%2?T(g[e-1],t,h).y:T(t,g[e+1],h).x))}function V(t,e,n,r,s,a){return[1/3*t+2/3*n,1/3*e+2/3*r,1/3*s+2/3*n,1/3*a+2/3*r,s,a]}function $(t,e,n,r,s,a,i,c,o){const m=1-o;return{x:m**3*t+m*m*3*o*n+3*m*o*o*s+o**3*i,y:m**3*e+m*m*3*o*r+3*m*o*o*a+o**3*c}}function z(t,e,n){const[r,s]=t,[a,i]=e;return[r+(a-r)*n,s+(i-s)*n]}function L(t,e,n,r){const s=.5,a=[t,e],i=[n,r],c=z(a,i,s),o=z(i,c,s),m=z(c,o,s),l=z(o,m,s),h=z(m,l,s),u=$.apply(0,a.concat(c,m,h,s)),f=$.apply(0,h.concat(l,o,i,0));return[u.x,u.y,f.x,f.y,n,r]}function E(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);const[n,r]=t.slice(1);switch(t[0]){case"M":return e.x=n,e.y=r,t;case"A":return["C"].concat(O.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=n,e.qy=r,["C"].concat(V.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(L(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(L(e.x1,e.y1,e.x,e.y))}return t}function j(t){if(p(t))return x(t);const e=I(t),n={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},r=[];let s="",a=e.length;for(let t=0;t<a;t+=1){const i=e[t],c=i.length;i&&([s]=i),r[t]=s,e[t]=E(i,n),u(e,r,t),a=e.length,n.x1=+i[c-2],n.y1=+i[c-1],n.x2=+i[c-4]||n.x1,n.y2=+i[c-3]||n.y1}return e}function D(t,e,n,r,s,a,i,c){return 3*((c-e)*(n+s)-(i-t)*(r+a)+r*(t-s)-n*(e-a)+c*(s+t/3)-i*(a+e/3))/20}function Z(t){let e=0,n=0,r=0,s=0,a=0;return j(t).map(t=>{switch(t[0]){case"M":case"Z":return r="M"===t[0]?t[1]:r,s="M"===t[0]?t[2]:s,e=r,n=s,0;default:return a=D.apply(0,[e,n].concat(t.slice(1))),[e,n]=t.slice(-2),a}}).reduce((t,e)=>t+e,0)}function Q(t,e,n,r,s){return s*(s*(-3*t+9*e-9*n+3*r)+6*t-12*e+6*n)-3*t+3*e}function X(t,e,n,r,s,a,i,c,o){let m;(null===o||Number.isNaN(+o))&&(m=1),m>1&&(m=1),m<0&&(m=0);const l=m/2;let h=0,u=0,f=0,y=0;const p=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];return[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816].forEach((o,m)=>{h=l*o+l,u=Q(t,n,s,i,h),f=Q(e,r,a,c,h),y+=p[m]*Math.sqrt(u*u+f*f)}),l*y}function Y(t,e,n,r,s,a,i,c){let o=s-2*n+t-(i-2*s+n),m=2*(n-t)-2*(s-n),l=t-n,h=(-m+Math.sqrt(m*m-4*o*l))/2/o,u=(-m-Math.sqrt(m*m-4*o*l))/2/o;const f=[e,c],y=[t,i];let p;return Math.abs(h)>"1e12"&&(h=.5),Math.abs(u)>"1e12"&&(u=.5),h>0&&h<1&&(p=$(t,e,n,r,s,a,i,c,h),y.push(p.x),f.push(p.y)),u>0&&u<1&&(p=$(t,e,n,r,s,a,i,c,u),y.push(p.x),f.push(p.y)),o=a-2*r+e-(c-2*a+r),m=2*(r-e)-2*(a-r),l=e-r,h=(-m+Math.sqrt(m*m-4*o*l))/2/o,u=(-m-Math.sqrt(m*m-4*o*l))/2/o,Math.abs(h)>"1e12"&&(h=.5),Math.abs(u)>"1e12"&&(u=.5),h>0&&h<1&&(p=$(t,e,n,r,s,a,i,c,h),y.push(p.x),f.push(p.y)),u>0&&u<1&&(p=$(t,e,n,r,s,a,i,c,u),y.push(p.x),f.push(p.y)),{min:{x:Math.min.apply(0,y),y:Math.min.apply(0,f)},max:{x:Math.max.apply(0,y),y:Math.max.apply(0,f)}}}function H(t){if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0};const e=j(t);let n=0,r=0,s=[],a=[];e.forEach(t=>{const[e,i]=t.slice(-2);if("M"===t[0])n=e,r=i,s.push(e),a.push(i);else{const c=Y.apply(0,[n,r].concat(t.slice(1)));s=s.concat(c.min.x,c.max.x),a=a.concat(c.min.y,c.max.y),n=e,r=i}});const i=Math.min.apply(0,s),c=Math.min.apply(0,a),o=Math.max.apply(0,s),m=Math.max.apply(0,a),l=o-i,h=m-c;return{width:l,height:h,x:i,y:c,x2:o,y2:m,cx:i+l/2,cy:c+h/2}}function R(t){return y(t)&&t.slice(1).every(t=>t[0]===t[0].toLowerCase())}function J(t,e){const{round:n,decimals:r}=h,s=Number.isNaN(+e)?n&&r:+e;return s?t.map(t=>t.map(t=>{const e=+t,n=10**s;return e?e%1==0?e:Math.round(e*n)/n:t})):x(t)}function B(t,e){return J(t,e).map(t=>t[0].concat(t.slice(1).join(" "))).join("")}const F={circle:["cx","cy","r"],ellipse:["cx","cy","rx","ry"],rect:["width","height","x","y","rx","ry"],polygon:["points"],polyline:["points"],glyph:[]};function G(t){return B(S(t)).replace(/(m|M)/g,"|$1").split("|").map(t=>t.trim()).filter(t=>t)}function U(t){if(R(t))return x(t);const e=N(t),n=e.length,r=[];let s=0,a=0,i=0,c=0,o=0;"M"===e[0][0]&&(s=+e[0][1],a=+e[0][2],i=s,c=a,o+=1,r.push(["M",s,a]));for(let t=o;t<n;t+=1){const n=e[t],[o]=n,m=o.toLowerCase(),l=[];let h=[];if(r.push(l),o!==m)switch(l[0]=m,m){case"a":h=n.slice(1,-2).concat([+n[6]-s,+n[7]-a]);for(let t=0;t<h.length;t+=1)l.push(h[t]);break;case"v":l[1]=+n[1]-a;break;default:for(let t=1;t<n.length;t+=1)l.push(+n[t]-(t%2?s:a));"m"===m&&(i=+n[1],c=+n[2])}else{"m"===o&&(i=+n[1]+s,c=+n[2]+a);for(let t=0;t<n.length;t+=1)l.push(n[t])}const u=l.length;switch(l[0]){case"z":s=i,a=c;break;case"h":s+=l[u-1];break;case"v":a+=l[u-1];break;default:s+=r[t][u-2],a+=r[t][u-1]}}return r}function K(t,e){const n=J(S(t),e),r=J(U(t),e);return n.map((t,e)=>e?t.join("").length<r[e].join("").length?t:r[e]:t)}function W(t){const e=S(t),n="Z"===e.slice(-1)[0][0];let r=[],s=0;return r=I(e).map((t,n)=>(s=t.length,{seg:e[n],n:t,c:e[n][0],x:t[s-2],y:t[s-1]})).map((t,e,r)=>{const s=t.seg,a=t.n,i=e&&r[e-1],c=r[e+1]&&r[e+1],o=t.c,m=r.length,l=e?r[e-1].x:r[m-1].x,h=e?r[e-1].y:r[m-1].y;let u=[];switch(o){case"M":u=n?["Z"]:[o,l,h];break;case"A":u=s.slice(0,-3).concat([1===s[5]?0:1,l,h]);break;case"C":u=c&&"S"===c.c?["S",s[1],s[2],l,h]:[o,s[3],s[4],s[1],s[2],l,h];break;case"S":u=i&&"CS".indexOf(i.c)>-1&&(!c||c&&"S"!==c.c)?["C",a[3],a[4],a[1],a[2],l,h]:[o,a[1],a[2],l,h];break;case"Q":u=c&&"T"===c.c?["T",l,h]:s.slice(0,-2).concat([l,h]);break;case"T":u=i&&"QT".indexOf(i.c)>-1&&(!c||c&&"T"!==c.c)?["Q",a[1],a[2],l,h]:[o,l,h];break;case"Z":u=["M",l,h];break;case"H":u=[o,l];break;case"V":u=[o,h];break;default:u=s.slice(0,-2).concat([l,h])}return u}),n?r.reverse():[r[0]].concat(r.slice(1).reverse())}function _(t){let e=new l;const{origin:n}=t,r=+n[0],s=+n[1],{translate:a}=t,{rotate:i}=t,{skew:c}=t,{scale:o}=t;return(!Number.isNaN(a)||Array.isArray(a)&&a.some(t=>0!=+t))&&(e=Array.isArray(a)?e.translate(+a[0]||0,+a[1]||0,+a[2]||0):e.translate(+a||0,0,0)),(i||c||o)&&(e=e.translate(+r,+s),i&&(e=Array.isArray(i)&&i.some(t=>0!=+t)?e.rotate(+i[0]||0,+i[1]||0,+i[2]||0):e.rotate(+i||0)),Array.isArray(c)&&c.some(t=>0!=+t)&&(Array.isArray(c)?(e=c[0]?e.skewX(+c[0]||0):e,e=c[1]?e.skewY(+c[1]||0):e):e=e.skewX(+c||0)),(!Number.isNaN(o)||Array.isArray(o)&&o.some(t=>1!=+t))&&(e=Array.isArray(o)?e.scale(+o[0]||1,+o[1]||1,+o[2]||1):e.scale(+o||1)),e=e.translate(-r,-s)),e}function tt(t,e,n){const r=t.transformPoint({x:e[0],y:e[1],z:0,w:1}),s=n[0]||0,a=n[1]||0,i=n[2]||0,c=r.x-s,o=r.y-a,m=r.z-i;return[c*(Math.abs(i)/Math.abs(m))+s,o*(Math.abs(i)/Math.abs(m))+a]}function et(t,e){let n,r,s,a,i,c,o,m,l;const h=S(t),f=I(h),y=_(e),p=Object.keys(e),{origin:g}=e,{a:d,b:M,c:b,d:A,e:w,f:v}=y,C=[d,M,b,A,w,v],N={x1:0,y1:0,x2:0,y2:0,x:0,y:0};let k=[],q=0,P="",T=[];const O=[];let V=[];if(!y.isIdentity){for(s=0,i=h.length;s<i;s+=1)k=h[s],h[s]&&([P]=k),O[s]=P,"A"!==P||y.is2D&&["skewX","skewY"].find(t=>p.includes(t))||(k=E(f[s],N),h[s]=E(f[s],N),u(h,O,s),f[s]=E(f[s],N),u(f,O,s),i=Math.max(h.length,f.length)),k=f[s],q=k.length,N.x1=+k[q-2],N.y1=+k[q-1],N.x2=+k[q-4]||N.x1,N.y2=+k[q-3]||N.y1,V={s:h[s],c:h[s][0]},"Z"!==P&&(V.x=N.x1,V.y=N.y1),T=T.concat(V);return T=T.map(t=>{switch(P=t.c,k=t.s,P){case"A":return l=function(t,e,n,r){const s=Math.cos(r*Math.PI/180),a=Math.sin(r*Math.PI/180),i=[e*(t[0]*s+t[2]*a),e*(t[1]*s+t[3]*a),n*(-t[0]*a+t[2]*s),n*(-t[1]*a+t[3]*s)],c=i[0]*i[0]+i[2]*i[2],o=i[1]*i[1]+i[3]*i[3];let m=((i[0]-i[3])*(i[0]-i[3])+(i[2]+i[1])*(i[2]+i[1]))*((i[0]+i[3])*(i[0]+i[3])+(i[2]-i[1])*(i[2]-i[1]));const l=(c+o)/2;if(m<1e-9*l){const t=Math.sqrt(l);return{rx:t,ry:t,ax:0}}const h=i[0]*i[1]+i[2]*i[3];m=Math.sqrt(m);const u=l+m/2,f=l-m/2;let y,p,x=Math.abs(h)<1e-9&&Math.abs(u-o)<1e-9?90:Math.atan(Math.abs(h)>Math.abs(u-o)?(u-c)/h:h/(u-o)*180)/Math.PI;return x>=0?(y=Math.sqrt(u),p=Math.sqrt(f)):(x+=90,y=Math.sqrt(f),p=Math.sqrt(u)),{rx:y,ry:p,ax:x}}(C,k[1],k[2],k[3]),C[0]*C[3]-C[1]*C[2]<0&&(k[5]=+k[5]?0:1),[o,m]=tt(y,[k[6],k[7]],g),k=n===o&&r===m||l.rx<1e-9*l.ry||l.ry<1e-9*l.rx?["L",o,m]:[P,l.rx,l.ry,l.ax,k[4],k[5],o,m],n=o,r=m,k;case"L":case"H":case"V":return[o,m]=tt(y,[t.x,t.y],g),n!==o&&r!==m?k=["L",o,m]:r===m?k=["H",o]:n===o&&(k=["V",m]),n=o,r=m,k;default:for(a=1,c=k.length;a<c;a+=2)[n,r]=tt(y,[k[a],k[a+1]],g),k[a]=n,k[a+1]=r;return k}}),T}return x(h)}const nt={CSSMatrix:l,parsePathString:N,isPathArray:y,isCurveArray:p,isAbsoluteArray:k,isRelativeArray:R,isNormalizedArray:P,isValidPath:function(t){if("string"!=typeof t)return!1;const e=new C(t);for(A(e);e.index<e.max&&!e.err.length;)v(e);return!e.err.length&&"mM".includes(e.segments[0][0])},pathToAbsolute:S,pathToRelative:U,pathToCurve:j,pathToString:B,getDrawDirection:function(t){return Z(j(t))>=0},getPathArea:Z,getPathBBox:H,getPathLength:function(t){let e=0;return j(t).forEach((t,n,r)=>{e+="M"===t[0]?0:X.apply(0,r[n-1].slice(-2).concat(t.slice(1)))}),e},getPointAtLength:function(t,e){let n,r,s,a=0;return j(t).map((t,i,c)=>(r=i?c[i-1].slice(-2).concat(t.slice(1)):t.slice(1),n=i?X.apply(0,r):0,a+=n,s=0===i?{x:r[0],y:r[1]}:a>e&&e>a-n?$.apply(0,r.concat(1-(a-e)/n)):null,s)).filter(t=>t).slice(-1)[0]},clonePath:x,splitPath:G,roundPath:J,optimizePath:K,reverseCurve:function(t){const e=t.slice(1).map((e,n,r)=>n?r[n-1].slice(-2).concat(e.slice(1)):t[0].slice(1).concat(e.slice(1))).map(t=>t.map((e,n)=>t[t.length-n-2*(1-n%2)])).reverse();return[["M"].concat(e[0].slice(0,2))].concat(e.map(t=>["C"].concat(t.slice(2))))},reversePath:W,normalizePath:I,transformPath:et,getSVGMatrix:_,shapeToPath:function(t,e){if(!Object.keys(F).concat(["glyph"]).some(e=>t.tagName===e))throw TypeError(`shapeToPath: ${t} is not SVGElement`);const n=document.createElementNS("http://www.w3.org/2000/svg","path"),r=t.tagName,s=F[r],a={type:r};let i;return s.forEach(e=>{a[e]=t.getAttribute(e)}),Object.values(t.attributes).forEach(({name:t,value:e})=>{s.includes(t)||n.setAttribute(t,e)}),["circle","ellipse"].includes(r)?i=B(function(t){const{type:e,cx:n,cy:r,r:s}=t;let{rx:a,ry:i}=t;return"circle"===e&&s>0&&(a=s,i=s),[["M",n-a,r],["a",a,i,0,1,0,2*a,0],["a",a,i,0,1,0,-2*a,0]]}(a)):["polyline","polygon"].includes(r)?i=B(function(t){const e=[];let{points:n}=t;n=n.split(/[\s|,]/).map(Number);let r=0;for(;r<n.length;)e.push([r?"L":"M",n[r],n[r+1]]),r+=2;return"polygon"===t.type?e.concat([["z"]]):e}(a)):"rect"===r?i=B(function(t){const e=+t.x||0,n=+t.y||0,r=+t.width,s=+t.height;let a=+t.rx,i=+t.ry;return a||i?(a=a||i,i=i||a,2*a>r&&(a-=(2*a-r)/2),2*i>s&&(i-=(2*i-s)/2),[["M",e+a,n],["h",r-2*a],["s",a,0,a,i],["v",s-2*i],["s",0,i,-a,i],["h",2*a-r],["s",-a,0,-a,-i],["v",2*i-s],["s",0,-i,a,-i]]):[["M",e,n],["h",r],["v",s],["H",e],["Z"]]}(a)):"line"===r?i=B(function(t){const{x1:e,y1:n,x2:r,y2:s}=t;return[["M",+e,+n],["L",+r,+s]]}(a)):"glyph"===r&&(i=t.getAttribute("d")),i?(n.setAttribute("d",i),e&&(t.before(n,t),t.remove()),n):null},options:h,Version:"0.1.10alpha1"};class rt{constructor(t,e){const n=e||{};let{round:r}=h;const{round:s}=n;0!=+s&&!1!==s||(r=0);const{decimals:a}=r&&(n||h);return this.round=0===r?0:a,this.segments=N(t),this.pathValue=t,this}toAbsolute(){const{segments:t}=this;return this.segments=S(t),this}toRelative(){const{segments:t}=this;return this.segments=U(t),this}reverse(t){this.toAbsolute();const{segments:e}=this,n=G(this.pathValue).length>1&&G(this.toString()),r=n&&x(n).map((e,n)=>t?n?W(e):N(e):W(e));let s=[];return s=n?r.flat(1):t?e:W(e),this.segments=x(s),this}normalize(){const{segments:t}=this;return this.segments=I(t),this}optimize(){const{segments:t}=this;return this.segments=K(t,this.round),this}transform(t){if(!t||"object"!=typeof t||"object"==typeof t&&!["translate","rotate","skew","scale"].some(e=>e in t))return this;const e=t||{},{segments:n}=this;if(!e.origin){const t=H(n);e.origin=[t.cx,t.cy,t.cx]}return this.segments=et(n,e),this}flipX(){return this.transform({rotate:[180,0,0]}),this}flipY(){return this.transform({rotate:[0,180,0]}),this}toString(){return B(this.segments,this.round)}}Object.keys(nt).forEach(t=>{rt[t]=nt[t]});export{rt as default};
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SVGPathCommander v0.1.9 (http://thednp.github.io/svg-path-commander)
2
+ * SVGPathCommander v0.1.10alpha1 (http://thednp.github.io/svg-path-commander)
3
3
  * Copyright 2021 © thednp
4
4
  * Licensed under MIT (https://github.com/thednp/svg-path-commander/blob/master/LICENSE)
5
5
  */
@@ -2890,7 +2890,7 @@
2890
2890
  return clonePath(absolutePath);
2891
2891
  }
2892
2892
 
2893
- var version = "0.1.9";
2893
+ var version = "0.1.10alpha1";
2894
2894
 
2895
2895
  // @ts-ignore
2896
2896
 
@@ -1,2 +1,2 @@
1
- // SVGPathCommander v0.1.9 | thednp © 2021 | MIT-License
2
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).SVGPathCommander=e()}(this,(function(){"use strict";function t(t){if(!t.every((function(t){return!Number.isNaN(t)})))throw TypeError('CSSMatrix: "'+t+'" must only have numbers.');var e=new m,r=Array.from(t);if(16===r.length){var n=r[0],a=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],h=r[7],l=r[8],f=r[9],p=r[10],y=r[11],v=r[12],x=r[13],M=r[14],d=r[15];e.m11=n,e.a=n,e.m21=o,e.c=o,e.m31=l,e.m41=v,e.e=v,e.m12=a,e.b=a,e.m22=c,e.d=c,e.m32=f,e.m42=x,e.f=x,e.m13=i,e.m23=u,e.m33=p,e.m43=M,e.m14=s,e.m24=h,e.m34=y,e.m44=d}else{if(6!==r.length)throw new TypeError("CSSMatrix: expecting an Array of 6/16 values.");var g=r[0],b=r[1],w=r[2],A=r[3],C=r[4],N=r[5];e.m11=g,e.a=g,e.m12=b,e.b=b,e.m21=w,e.c=w,e.m22=A,e.d=A,e.m41=C,e.e=C,e.m42=N,e.f=N}return e}function e(e){if(![m,DOMMatrix,Object].some((function(t){return e instanceof t})))throw TypeError('CSSMatrix: "'+e+'" is not a DOMMatrix / CSSMatrix compatible object.');return t([e.m11,e.m12,e.m13,e.m14,e.m21,e.m22,e.m23,e.m24,e.m31,e.m32,e.m33,e.m34,e.m41,e.m42,e.m43,e.m44])}function r(e){if("string"!=typeof e)throw TypeError('CSSMatrix: "'+e+'" is not a string.');var r=String(e).replace(/\s/g,""),n=new m;return r.split(")").filter((function(t){return t})).map((function(t){var e=t.split("("),r=e[0],n=e[1].split(",").map((function(t){return t.includes("rad")?parseFloat(t)*(180/Math.PI):parseFloat(t)}));return n[0],n[1],n[2],n[3],{prop:r,components:n}})).forEach((function(e){var r=e.prop,a=e.components,i=a[0],s=a[1],o=a[2],c=a[3],u=[i,s,o],m=[i,s,o,c];if(r.includes("matrix")){var h=a.map((function(t){return Math.abs(t)<1e-6?0:t}));[6,16].includes(h.length)&&(n=n.multiply(t(h)))}else if(["translate","translate3d"].some((function(t){return r===t}))&&i)n=n.translate(i,s||0,o||0);else if("rotate3d"===r&&m.every((function(t){return!Number.isNaN(+t)}))&&c)n=n.rotateAxisAngle(i,s,o,c);else if("scale3d"===r&&u.every((function(t){return!Number.isNaN(+t)}))&&u.some((function(t){return 1!==t})))n=n.scale(i,s,o);else if("rotate"===r&&i)n=n.rotate(0,0,i);else if("scale"!==r||Number.isNaN(i)||1===i){if("skew"===r&&(i||s))n=i?n.skewX(i):n,n=s?n.skewY(s):n;else if(/[XYZ]/.test(r)&&i)if(r.includes("skew"))n=n[r](i);else{var l=r.replace(/[XYZ]/,""),f=r.replace(l,""),p=["X","Y","Z"].indexOf(f),y=[0===p?i:0,1===p?i:0,2===p?i:0];n=n[l].apply(n,y)}}else{var v=Number.isNaN(+s)?i:s;n=n.scale(i,v,1)}})),n}function n(t,e,r){var n=new m;return n.m41=t,n.e=t,n.m42=e,n.f=e,n.m43=r,n}function a(t,e,r){var n=new m,a=Math.PI/180,i=t*a,s=e*a,o=r*a,c=Math.cos(i),u=-Math.sin(i),h=Math.cos(s),l=-Math.sin(s),f=Math.cos(o),p=-Math.sin(o),y=h*f,v=-h*p;n.m11=y,n.a=y,n.m12=v,n.b=v,n.m13=l;var x=u*l*f+c*p;n.m21=x,n.c=x;var M=c*f-u*l*p;return n.m22=M,n.d=M,n.m23=-u*h,n.m31=u*p-c*l*f,n.m32=u*f+c*l*p,n.m33=c*h,n}function i(t,e,r,n){var a=new m,i=n*(Math.PI/360),s=Math.sin(i),o=Math.cos(i),c=s*s,u=Math.sqrt(t*t+e*e+r*r),h=t,l=e,f=r;0===u?(h=0,l=0,f=1):(h/=u,l/=u,f/=u);var p=h*h,y=l*l,v=f*f,x=1-2*(y+v)*c;a.m11=x,a.a=x;var M=2*(h*l*c+f*s*o);a.m12=M,a.b=M,a.m13=2*(h*f*c-l*s*o);var d=2*(l*h*c-f*s*o);a.m21=d,a.c=d;var g=1-2*(v+p)*c;return a.m22=g,a.d=g,a.m23=2*(l*f*c+h*s*o),a.m31=2*(f*h*c+l*s*o),a.m32=2*(f*l*c-h*s*o),a.m33=1-2*(p+y)*c,a}function s(t,e,r){var n=new m;return n.m11=t,n.a=t,n.m22=e,n.d=e,n.m33=r,n}function o(t){var e=new m,r=t*Math.PI/180,n=Math.tan(r);return e.m21=n,e.c=n,e}function c(t){var e=new m,r=t*Math.PI/180,n=Math.tan(r);return e.m12=n,e.b=n,e}function u(e,r){return t([r.m11*e.m11+r.m12*e.m21+r.m13*e.m31+r.m14*e.m41,r.m11*e.m12+r.m12*e.m22+r.m13*e.m32+r.m14*e.m42,r.m11*e.m13+r.m12*e.m23+r.m13*e.m33+r.m14*e.m43,r.m11*e.m14+r.m12*e.m24+r.m13*e.m34+r.m14*e.m44,r.m21*e.m11+r.m22*e.m21+r.m23*e.m31+r.m24*e.m41,r.m21*e.m12+r.m22*e.m22+r.m23*e.m32+r.m24*e.m42,r.m21*e.m13+r.m22*e.m23+r.m23*e.m33+r.m24*e.m43,r.m21*e.m14+r.m22*e.m24+r.m23*e.m34+r.m24*e.m44,r.m31*e.m11+r.m32*e.m21+r.m33*e.m31+r.m34*e.m41,r.m31*e.m12+r.m32*e.m22+r.m33*e.m32+r.m34*e.m42,r.m31*e.m13+r.m32*e.m23+r.m33*e.m33+r.m34*e.m43,r.m31*e.m14+r.m32*e.m24+r.m33*e.m34+r.m34*e.m44,r.m41*e.m11+r.m42*e.m21+r.m43*e.m31+r.m44*e.m41,r.m41*e.m12+r.m42*e.m22+r.m43*e.m32+r.m44*e.m42,r.m41*e.m13+r.m42*e.m23+r.m43*e.m33+r.m44*e.m43,r.m41*e.m14+r.m42*e.m24+r.m43*e.m34+r.m44*e.m44])}var m=function t(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var n=this;if(n.a=1,n.b=0,n.c=0,n.d=1,n.e=0,n.f=0,n.m11=1,n.m12=0,n.m13=0,n.m14=0,n.m21=0,n.m22=1,n.m23=0,n.m24=0,n.m31=0,n.m32=0,n.m33=1,n.m34=0,n.m41=0,n.m42=0,n.m43=0,n.m44=1,e&&e.length){var a=e;return e instanceof Array&&(e[0]instanceof Array&&[16,6].includes(e[0].length)||"string"==typeof e[0]||[t,DOMMatrix].some((function(t){return e[0]instanceof t})))&&(a=e[0]),n.setMatrixValue(a)}return n},h={isIdentity:{configurable:!0},is2D:{configurable:!0}};h.isIdentity.set=function(t){this.isIdentity=t},h.isIdentity.get=function(){var t=this;return 1===t.m11&&0===t.m12&&0===t.m13&&0===t.m14&&0===t.m21&&1===t.m22&&0===t.m23&&0===t.m24&&0===t.m31&&0===t.m32&&1===t.m33&&0===t.m34&&0===t.m41&&0===t.m42&&0===t.m43&&1===t.m44},h.is2D.get=function(){var t=this;return 0===t.m31&&0===t.m32&&1===t.m33&&0===t.m34&&0===t.m43&&1===t.m44},h.is2D.set=function(t){this.is2D=t},m.prototype.setMatrixValue=function(n){return[DOMMatrix,m].some((function(t){return n instanceof t}))?e(n):"string"==typeof n&&n.length&&"none"!==n?r(n):Array.isArray(n)?t(n):this},m.prototype.toString=function(){var t=this.toArray().join(",");return(this.is2D?"matrix":"matrix3d")+"("+t+")"},m.prototype.toArray=function(){var t=this,e=Math.pow(10,6);return(t.is2D?[t.a,t.b,t.c,t.d,t.e,t.f]:[t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44]).map((function(t){return Math.abs(t)<1e-6?0:(t*e>>0)/e}))},m.prototype.toJSON=function(){return JSON.parse(JSON.stringify(this))},m.prototype.multiply=function(t){return u(this,t)},m.prototype.translate=function(t,e,r){var a=e,i=r;return null==i&&(i=0),null==a&&(a=0),u(this,n(t,a,i))},m.prototype.scale=function(t,e,r){var n=e,a=r;return null==n&&(n=t),null==a&&(a=t),u(this,s(t,n,a))},m.prototype.rotate=function(t,e,r){var n=t,i=e,s=r;return null==i&&(i=0),null==s&&(s=n,n=0),u(this,a(n,i,s))},m.prototype.rotateAxisAngle=function(t,e,r,n){if([t,e,r,n].some((function(t){return Number.isNaN(t)})))throw new TypeError("CSSMatrix: expecting 4 values");return u(this,i(t,e,r,n))},m.prototype.skewX=function(t){return u(this,o(t))},m.prototype.skewY=function(t){return u(this,c(t))},m.prototype.transformPoint=function(t){var e=n(t.x,t.y,t.z);return e.m44=t.w||1,{x:(e=this.multiply(e)).m41,y:e.m42,z:e.m43,w:e.m44}},m.prototype.transform=function(t){var e=this,r=e.m11*t.x+e.m12*t.y+e.m13*t.z+e.m14*t.w,n=e.m21*t.x+e.m22*t.y+e.m23*t.z+e.m24*t.w,a=e.m31*t.x+e.m32*t.y+e.m33*t.z+e.m34*t.w,i=e.m41*t.x+e.m42*t.y+e.m43*t.z+e.m44*t.w;return{x:r/i,y:n/i,z:a/i,w:i}},Object.defineProperties(m.prototype,h),m.Translate=n,m.Rotate=a,m.RotateAxisAngle=i,m.Scale=s,m.SkewX=o,m.SkewY=c,m.Multiply=u,m.fromArray=t,m.fromMatrix=e,m.fromString=r;var l={origin:null,decimals:4,round:1};function f(t,e,r){if(t[r].length>7){t[r].shift();for(var n=t[r],a=r;n.length;)e[r]="A",t.splice(a+=1,0,["C"].concat(n.splice(0,6)));t.splice(r,1)}}var p={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function y(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return p[e]===t.length-1&&/[achlmqstvz]/gi.test(e)}))}function v(t){return y(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}function x(t){return t.map((function(t){return Array.isArray(t)?x(t):Number.isNaN(+t)?t:+t}))}function M(t){var e=t.pathValue[t.segmentStart],r=e.toLowerCase(),n=t.data;if("m"===r&&n.length>2&&(t.segments.push([e,n[0],n[1]]),n=n.slice(2),r="l",e="m"===e?"l":"L"),"r"===r)t.segments.push([e].concat(n));else for(;n.length>=p[r]&&(t.segments.push([e].concat(n.splice(0,p[r]))),p[r]););}function d(t){var e=t.index,r=t.pathValue.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err="Invalid path value: invalid Arc flag "+r+", expecting 0 or 1 at index "+e)}function g(t){return t>=48&&t<=57}function b(t){var e,r=t.max,n=t.pathValue,a=t.index,i=a,s=!1,o=!1,c=!1,u=!1;if(i>=r)t.err="Invalid path value at "+i+": missing param "+n[i];else if(43!==(e=n.charCodeAt(i))&&45!==e||(e=(i+=1)<r?n.charCodeAt(i):0),g(e)||46===e){if(46!==e){if(s=48===e,e=(i+=1)<r?n.charCodeAt(i):0,s&&i<r&&e&&g(e))return void(t.err="Invalid path value at index "+a+": "+n[a]+" illegal number");for(;i<r&&g(n.charCodeAt(i));)i+=1,o=!0;e=i<r?n.charCodeAt(i):0}if(46===e){for(u=!0,i+=1;g(n.charCodeAt(i));)i+=1,c=!0;e=i<r?n.charCodeAt(i):0}if(101===e||69===e){if(u&&!o&&!c)return void(t.err="Invalid path value at index "+i+": "+n[i]+" invalid float exponent");if(43!==(e=(i+=1)<r?n.charCodeAt(i):0)&&45!==e||(i+=1),!(i<r&&g(n.charCodeAt(i))))return void(t.err="Invalid path value at index "+i+": "+n[i]+" invalid float exponent");for(;i<r&&g(n.charCodeAt(i));)i+=1}t.index=i,t.param=+t.pathValue.slice(a,i)}else t.err="Invalid path value at index "+i+": "+n[i]+" is not a number"}function w(t){for(var e,r=t.pathValue,n=t.max;t.index<n&&(10===(e=r.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index+=1}function A(t){return t>=48&&t<=57||43===t||45===t||46===t}function C(t){var e=t.max,r=t.pathValue,n=t.index,a=r.charCodeAt(n),i=p[r[n].toLowerCase()];if(t.segmentStart=n,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0;default:return!1}}(a))if(t.index+=1,w(t),t.data=[],i){for(;;){for(var s=i;s>0;s-=1){if(97!=(32|a)||3!==s&&4!==s?b(t):d(t),t.err.length)return;t.data.push(t.param),w(t),t.index<e&&44===r.charCodeAt(t.index)&&(t.index+=1,w(t))}if(t.index>=t.max)break;if(!A(r.charCodeAt(t.index)))break}M(t)}else M(t);else t.err="Invalid path value: "+r[n]+" not a path command"}function N(t){this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}function S(t){if(y(t))return x(t);var e=new N(t);for(w(e);e.index<e.max&&!e.err.length;)C(e);return e.err.length?e.segments=[]:e.segments.length&&("mM".indexOf(e.segments[0][0])<0?(e.err="Invalid path value: missing M/m",e.segments=[]):e.segments[0][0]="M"),e.segments}function k(t){return y(t)&&t.every((function(t){return t[0]===t[0].toUpperCase()}))}function q(t){if(k(t))return x(t);var e=S(t),r=e.length,n=[],a=0,i=0,s=0,o=0,c=0;"M"===e[0][0]&&(s=a=+e[0][1],o=i=+e[0][2],c+=1,n.push(["M",a,i]));for(var u=c;u<r;u+=1){var m=e[u],h=m[0],l=h.toUpperCase(),f=[],p=[];if(n.push(f),h!==l)switch(f[0]=l,l){case"A":p=m.slice(1,-2).concat([+m[6]+a,+m[7]+i]);for(var y=0;y<p.length;y+=1)f.push(p[y]);break;case"V":f[1]=+m[1]+i;break;case"H":f[1]=+m[1]+a;break;default:"M"===l&&(s=+m[1]+a,o=+m[2]+i);for(var v=1;v<m.length;v+=1)f.push(+m[v]+(v%2?a:i))}else for(var M=0;M<m.length;M+=1)f.push(m[M]);var d=f.length;switch(l){case"Z":a=s,i=o;break;case"H":a=+f[1];break;case"V":i=+f[1];break;default:a=+f[d-2],i=+f[d-1],"M"===l&&(s=a,o=i)}}return n}function P(t,e,r){var n=t[0],a=t.slice(1),i=t;if("TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null),"H"===n)i=["L",t[1],e.y1];else if("V"===n)i=["L",e.x1,t[1]];else if("S"===n){var s=function(t,e,r,n,a){return"CS".indexOf(a)>-1?{x1:2*t-r,y1:2*e-n}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,r),o=s.x1,c=s.y1;e.x1=o,e.y1=c,i=["C",o,c].concat(a)}else if("T"===n){var u=function(t,e,r,n,a){return"QT".indexOf(a)>-1?{qx:2*t-r,qy:2*e-n}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,r),m=u.qx,h=u.qy;e.qx=m,e.qy=h,i=["Q",m,h].concat(a)}else if("Q"===n){var l=a[0],f=a[1];e.qx=l,e.qy=f}return i}function I(t){return y(t)&&t.every((function(t){var e=t[0].toLowerCase();return p[e]===t.length-1&&"ACLMQZ".includes(t[0])}))}function T(t){if(I(t))return x(t);for(var e,r,n=q(t),a={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},i=[],s=n.length,o="",c=0;c<s;c+=1){var u=n[c][0];i[c]=u,c&&(o=i[c-1]),n[c]=P(n[c],a,o),r=(e=n[c]).length,a.x1=+e[r-2],a.y1=+e[r-1],a.x2=+e[r-4]||a.x1,a.y2=+e[r-3]||a.y1}return n}function O(t,e,r){return{x:t*Math.cos(r)-e*Math.sin(r),y:t*Math.sin(r)+e*Math.cos(r)}}function V(t,e,r,n,a,i,s,o,c,u){var m,h,l,f,p,y=120*Math.PI/180,v=Math.PI/180*(a||0),x=[],M=t,d=o,g=e,b=c,w=r,A=n;if(u){h=u[0],l=u[1],f=u[2],p=u[3]}else{M=(m=O(M,g,-v)).x,g=m.y;var C=(M-(d=(m=O(d,b,-v)).x))/2,N=(g-(b=m.y))/2,S=Math.pow(C,2)/Math.pow(w,2)+Math.pow(N,2)/Math.pow(A,2);S>1&&(w*=S=Math.sqrt(S),A*=S);var k=Math.pow(w,2),q=Math.pow(A,2),P=(i===s?-1:1)*Math.sqrt(Math.abs((k*q-k*N*N-q*C*C)/(k*N*N+q*C*C)));f=P*w*N/A+(M+d)/2,p=P*-A*C/w+(g+b)/2,h=Math.asin(((g-p)/A*Math.pow(10,9)>>0)/Math.pow(10,9)),l=Math.asin(((b-p)/A*Math.pow(10,9)>>0)/Math.pow(10,9)),h=M<f?Math.PI-h:h,l=d<f?Math.PI-l:l,h<0&&(h=2*Math.PI+h),l<0&&(l=2*Math.PI+l),s&&h>l&&(h-=2*Math.PI),!s&&l>h&&(l-=2*Math.PI)}var I=l-h;if(Math.abs(I)>y){var T=l,z=d,L=b;l=h+y*(s&&l>h?1:-1),d=f+w*Math.cos(l),b=p+A*Math.sin(l),x=V(d,b,w,A,a,0,s,z,L,[l,T,f,p])}I=l-h;var j=Math.cos(h),E=Math.sin(h),D=Math.cos(l),Z=Math.sin(l),Q=Math.tan(I/4),X=4/3*w*Q,Y=4/3*A*Q,H=[M,g],R=[M+X*E,g-Y*j],G=[d+X*Z,b-Y*D],J=[d,b];return R[0]=2*H[0]-R[0],R[1]=2*H[1]-R[1],u?[R,G,J].concat(x):(x=[R,G,J].concat(x).join().split(",")).map((function(t,e){return e%2?O(x[e-1],t,v).y:O(t,x[e+1],v).x}))}function z(t,e,r,n,a,i){return[1/3*t+2/3*r,1/3*e+2/3*n,1/3*a+2/3*r,1/3*i+2/3*n,a,i]}function L(t,e,r,n,a,i,s,o,c){var u=1-c;return{x:Math.pow(u,3)*t+u*u*3*c*r+3*u*c*c*a+Math.pow(c,3)*s,y:Math.pow(u,3)*e+u*u*3*c*n+3*u*c*c*i+Math.pow(c,3)*o}}function j(t,e,r){var n=t[0],a=t[1];return[n+(e[0]-n)*r,a+(e[1]-a)*r]}function E(t,e,r,n){var a=.5,i=[t,e],s=[r,n],o=j(i,s,a),c=j(s,o,a),u=j(o,c,a),m=j(c,u,a),h=j(u,m,a),l=L.apply(0,i.concat(o,u,h,a)),f=L.apply(0,h.concat(m,c,s,0));return[l.x,l.y,f.x,f.y,r,n]}function D(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);var r=t.slice(1),n=r[0],a=r[1];switch(t[0]){case"M":return e.x=n,e.y=a,t;case"A":return["C"].concat(V.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=n,e.qy=a,["C"].concat(z.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(E(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(E(e.x1,e.y1,e.x,e.y))}return t}function Z(t){if(v(t))return x(t);for(var e=T(t),r={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},n=[],a="",i=e.length,s=0;s<i;s+=1){var o=e[s],c=o.length;o&&(a=o[0]),n[s]=a,e[s]=D(o,r),f(e,n,s),i=e.length,r.x1=+o[c-2],r.y1=+o[c-1],r.x2=+o[c-4]||r.x1,r.y2=+o[c-3]||r.y1}return e}function Q(t,e,r,n,a,i,s,o){return 3*((o-e)*(r+a)-(s-t)*(n+i)+n*(t-a)-r*(e-i)+o*(a+t/3)-s*(i+e/3))/20}function X(t){var e=0,r=0,n=0,a=0,i=0;return Z(t).map((function(t){var s;switch(t[0]){case"M":case"Z":return n="M"===t[0]?t[1]:n,a="M"===t[0]?t[2]:a,e=n,r=a,0;default:return i=Q.apply(0,[e,r].concat(t.slice(1))),s=t.slice(-2),e=s[0],r=s[1],i}})).reduce((function(t,e){return t+e}),0)}function Y(t,e,r,n,a){return a*(a*(-3*t+9*e-9*r+3*n)+6*t-12*e+6*r)-3*t+3*e}function H(t,e,r,n,a,i,s,o,c){var u;(null===c||Number.isNaN(+c))&&(u=1),u>1&&(u=1),u<0&&(u=0);var m=u/2,h=0,l=0,f=0,p=0,y=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];return[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816].forEach((function(c,u){l=Y(t,r,a,s,h=m*c+m),f=Y(e,n,i,o,h),p+=y[u]*Math.sqrt(l*l+f*f)})),m*p}function R(t,e,r,n,a,i,s,o){var c,u=a-2*r+t-(s-2*a+r),m=2*(r-t)-2*(a-r),h=t-r,l=(-m+Math.sqrt(m*m-4*u*h))/2/u,f=(-m-Math.sqrt(m*m-4*u*h))/2/u,p=[e,o],y=[t,s];return Math.abs(l)>"1e12"&&(l=.5),Math.abs(f)>"1e12"&&(f=.5),l>0&&l<1&&(c=L(t,e,r,n,a,i,s,o,l),y.push(c.x),p.push(c.y)),f>0&&f<1&&(c=L(t,e,r,n,a,i,s,o,f),y.push(c.x),p.push(c.y)),u=i-2*n+e-(o-2*i+n),h=e-n,l=(-(m=2*(n-e)-2*(i-n))+Math.sqrt(m*m-4*u*h))/2/u,f=(-m-Math.sqrt(m*m-4*u*h))/2/u,Math.abs(l)>"1e12"&&(l=.5),Math.abs(f)>"1e12"&&(f=.5),l>0&&l<1&&(c=L(t,e,r,n,a,i,s,o,l),y.push(c.x),p.push(c.y)),f>0&&f<1&&(c=L(t,e,r,n,a,i,s,o,f),y.push(c.x),p.push(c.y)),{min:{x:Math.min.apply(0,y),y:Math.min.apply(0,p)},max:{x:Math.max.apply(0,y),y:Math.max.apply(0,p)}}}function G(t){if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0};var e=Z(t),r=0,n=0,a=[],i=[];e.forEach((function(t){var e=t.slice(-2),s=e[0],o=e[1];if("M"===t[0])r=s,n=o,a.push(s),i.push(o);else{var c=R.apply(0,[r,n].concat(t.slice(1)));a=a.concat(c.min.x,c.max.x),i=i.concat(c.min.y,c.max.y),r=s,n=o}}));var s=Math.min.apply(0,a),o=Math.min.apply(0,i),c=Math.max.apply(0,a),u=Math.max.apply(0,i),m=c-s,h=u-o;return{width:m,height:h,x:s,y:o,x2:c,y2:u,cx:s+m/2,cy:o+h/2}}function J(t){return y(t)&&t.slice(1).every((function(t){return t[0]===t[0].toLowerCase()}))}function B(t,e){var r=l.round,n=l.decimals,a=Number.isNaN(+e)?r&&n:+e;return a?t.map((function(t){return t.map((function(t){var e=+t,r=Math.pow(10,a);return e?e%1==0?e:Math.round(e*r)/r:t}))})):x(t)}function F(t,e){return B(t,e).map((function(t){return t[0].concat(t.slice(1).join(" "))})).join("")}var U={circle:["cx","cy","r"],ellipse:["cx","cy","rx","ry"],rect:["width","height","x","y","rx","ry"],polygon:["points"],polyline:["points"],glyph:[]};function $(t){return F(q(t)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t}))}function K(t){if(J(t))return x(t);var e=S(t),r=e.length,n=[],a=0,i=0,s=0,o=0,c=0;"M"===e[0][0]&&(s=a=+e[0][1],o=i=+e[0][2],c+=1,n.push(["M",a,i]));for(var u=c;u<r;u+=1){var m=e[u],h=m[0],l=h.toLowerCase(),f=[],p=[];if(n.push(f),h!==l)switch(f[0]=l,l){case"a":p=m.slice(1,-2).concat([+m[6]-a,+m[7]-i]);for(var y=0;y<p.length;y+=1)f.push(p[y]);break;case"v":f[1]=+m[1]-i;break;default:for(var v=1;v<m.length;v+=1)f.push(+m[v]-(v%2?a:i));"m"===l&&(s=+m[1],o=+m[2])}else{"m"===h&&(s=+m[1]+a,o=+m[2]+i);for(var M=0;M<m.length;M+=1)f.push(m[M])}var d=f.length;switch(f[0]){case"z":a=s,i=o;break;case"h":a+=f[d-1];break;case"v":i+=f[d-1];break;default:a+=n[u][d-2],i+=n[u][d-1]}}return n}function W(t,e){var r=B(q(t),e),n=B(K(t),e);return r.map((function(t,e){return e?t.join("").length<n[e].join("").length?t:n[e]:t}))}function _(t){var e=q(t),r="Z"===e.slice(-1)[0][0],n=[],a=0;return n=T(e).map((function(t,r){return a=t.length,{seg:e[r],n:t,c:e[r][0],x:t[a-2],y:t[a-1]}})).map((function(t,e,n){var a=t.seg,i=t.n,s=e&&n[e-1],o=n[e+1]&&n[e+1],c=t.c,u=n.length,m=e?n[e-1].x:n[u-1].x,h=e?n[e-1].y:n[u-1].y,l=[];switch(c){case"M":l=r?["Z"]:[c,m,h];break;case"A":l=a.slice(0,-3).concat([1===a[5]?0:1,m,h]);break;case"C":l=o&&"S"===o.c?["S",a[1],a[2],m,h]:[c,a[3],a[4],a[1],a[2],m,h];break;case"S":l=s&&"CS".indexOf(s.c)>-1&&(!o||o&&"S"!==o.c)?["C",i[3],i[4],i[1],i[2],m,h]:[c,i[1],i[2],m,h];break;case"Q":l=o&&"T"===o.c?["T",m,h]:a.slice(0,-2).concat([m,h]);break;case"T":l=s&&"QT".indexOf(s.c)>-1&&(!o||o&&"T"!==o.c)?["Q",i[1],i[2],m,h]:[c,m,h];break;case"Z":l=["M",m,h];break;case"H":l=[c,m];break;case"V":l=[c,h];break;default:l=a.slice(0,-2).concat([m,h])}return l})),r?n.reverse():[n[0]].concat(n.slice(1).reverse())}function tt(t){var e=new m,r=t.origin,n=+r[0],a=+r[1],i=t.translate,s=t.rotate,o=t.skew,c=t.scale;return(!Number.isNaN(i)||Array.isArray(i)&&i.some((function(t){return 0!=+t})))&&(e=Array.isArray(i)?e.translate(+i[0]||0,+i[1]||0,+i[2]||0):e.translate(+i||0,0,0)),(s||o||c)&&(e=e.translate(+n,+a),s&&(e=Array.isArray(s)&&s.some((function(t){return 0!=+t}))?e.rotate(+s[0]||0,+s[1]||0,+s[2]||0):e.rotate(+s||0)),Array.isArray(o)&&o.some((function(t){return 0!=+t}))&&(Array.isArray(o)?(e=o[0]?e.skewX(+o[0]||0):e,e=o[1]?e.skewY(+o[1]||0):e):e=e.skewX(+o||0)),(!Number.isNaN(c)||Array.isArray(c)&&c.some((function(t){return 1!=+t})))&&(e=Array.isArray(c)?e.scale(+c[0]||1,+c[1]||1,+c[2]||1):e.scale(+c||1)),e=e.translate(-n,-a)),e}function et(t,e,r){var n=t.transformPoint({x:e[0],y:e[1],z:0,w:1}),a=r[0]||0,i=r[1]||0,s=r[2]||0,o=n.x-a,c=n.y-i,u=n.z-s;return[o*(Math.abs(s)/Math.abs(u))+a,c*(Math.abs(s)/Math.abs(u))+i]}function rt(t,e){var r,n,a,i,s,o,c,u,m,h=q(t),l=T(h),p=tt(e),y=Object.keys(e),v=e.origin,M=[p.a,p.b,p.c,p.d,p.e,p.f],d={x1:0,y1:0,x2:0,y2:0,x:0,y:0},g=[],b=0,w="",A=[],C=[],N=[];if(!p.isIdentity){for(a=0,s=h.length;a<s;a+=1)g=h[a],h[a]&&(w=g[0]),C[a]=w,"A"!==w||p.is2D&&["skewX","skewY"].find((function(t){return y.includes(t)}))||(g=D(l[a],d),h[a]=D(l[a],d),f(h,C,a),l[a]=D(l[a],d),f(l,C,a),s=Math.max(h.length,l.length)),b=(g=l[a]).length,d.x1=+g[b-2],d.y1=+g[b-1],d.x2=+g[b-4]||d.x1,d.y2=+g[b-3]||d.y1,N={s:h[a],c:h[a][0]},"Z"!==w&&(N.x=d.x1,N.y=d.y1),A=A.concat(N);return A=A.map((function(t){var e,a,s;switch(w=t.c,g=t.s,w){case"A":return m=function(t,e,r,n){var a=Math.cos(n*Math.PI/180),i=Math.sin(n*Math.PI/180),s=[e*(t[0]*a+t[2]*i),e*(t[1]*a+t[3]*i),r*(-t[0]*i+t[2]*a),r*(-t[1]*i+t[3]*a)],o=s[0]*s[0]+s[2]*s[2],c=s[1]*s[1]+s[3]*s[3],u=((s[0]-s[3])*(s[0]-s[3])+(s[2]+s[1])*(s[2]+s[1]))*((s[0]+s[3])*(s[0]+s[3])+(s[2]-s[1])*(s[2]-s[1])),m=(o+c)/2;if(u<1e-9*m){var h=Math.sqrt(m);return{rx:h,ry:h,ax:0}}var l,f,p=s[0]*s[1]+s[2]*s[3],y=m+(u=Math.sqrt(u))/2,v=m-u/2,x=Math.abs(p)<1e-9&&Math.abs(y-c)<1e-9?90:Math.atan(Math.abs(p)>Math.abs(y-c)?(y-o)/p:p/(y-c)*180)/Math.PI;return x>=0?(l=Math.sqrt(y),f=Math.sqrt(v)):(x+=90,l=Math.sqrt(v),f=Math.sqrt(y)),{rx:l,ry:f,ax:x}}(M,g[1],g[2],g[3]),M[0]*M[3]-M[1]*M[2]<0&&(g[5]=+g[5]?0:1),e=et(p,[g[6],g[7]],v),c=e[0],u=e[1],g=r===c&&n===u||m.rx<1e-9*m.ry||m.ry<1e-9*m.rx?["L",c,u]:[w,m.rx,m.ry,m.ax,g[4],g[5],c,u],r=c,n=u,g;case"L":case"H":case"V":return a=et(p,[t.x,t.y],v),c=a[0],u=a[1],r!==c&&n!==u?g=["L",c,u]:n===u?g=["H",c]:r===c&&(g=["V",u]),r=c,n=u,g;default:for(i=1,o=g.length;i<o;i+=2)s=et(p,[g[i],g[i+1]],v),r=s[0],n=s[1],g[i]=r,g[i+1]=n;return g}}))}return x(h)}var nt={CSSMatrix:m,parsePathString:S,isPathArray:y,isCurveArray:v,isAbsoluteArray:k,isRelativeArray:J,isNormalizedArray:I,isValidPath:function(t){if("string"!=typeof t)return!1;var e=new N(t);for(w(e);e.index<e.max&&!e.err.length;)C(e);return!e.err.length&&"mM".includes(e.segments[0][0])},pathToAbsolute:q,pathToRelative:K,pathToCurve:Z,pathToString:F,getDrawDirection:function(t){return X(Z(t))>=0},getPathArea:X,getPathBBox:G,getPathLength:function(t){var e=0;return Z(t).forEach((function(t,r,n){e+="M"===t[0]?0:H.apply(0,n[r-1].slice(-2).concat(t.slice(1)))})),e},getPointAtLength:function(t,e){var r,n,a=0;return Z(t).map((function(t,i,s){return n=i?s[i-1].slice(-2).concat(t.slice(1)):t.slice(1),r=i?H.apply(0,n):0,a+=r,0===i?{x:n[0],y:n[1]}:a>e&&e>a-r?L.apply(0,n.concat(1-(a-e)/r)):null})).filter((function(t){return t})).slice(-1)[0]},clonePath:x,splitPath:$,roundPath:B,optimizePath:W,reverseCurve:function(t){var e=t.slice(1).map((function(e,r,n){return r?n[r-1].slice(-2).concat(e.slice(1)):t[0].slice(1).concat(e.slice(1))})).map((function(t){return t.map((function(e,r){return t[t.length-r-2*(1-r%2)]}))})).reverse();return[["M"].concat(e[0].slice(0,2))].concat(e.map((function(t){return["C"].concat(t.slice(2))})))},reversePath:_,normalizePath:T,transformPath:rt,getSVGMatrix:tt,shapeToPath:function(t,e){if(!Object.keys(U).concat(["glyph"]).some((function(e){return t.tagName===e})))throw TypeError("shapeToPath: "+t+" is not SVGElement");var r,n,a,i,s,o,c,u,m=document.createElementNS("http://www.w3.org/2000/svg","path"),h=t.tagName,l=U[h],f={type:h};return l.forEach((function(e){f[e]=t.getAttribute(e)})),Object.values(t.attributes).forEach((function(t){var e=t.name,r=t.value;l.includes(e)||m.setAttribute(e,r)})),["circle","ellipse"].includes(h)?r=F(function(t){var e=t.type,r=t.cx,n=t.cy,a=t.r,i=t.rx,s=t.ry;return"circle"===e&&a>0&&(i=a,s=a),[["M",r-i,n],["a",i,s,0,1,0,2*i,0],["a",i,s,0,1,0,-2*i,0]]}(f)):["polyline","polygon"].includes(h)?r=F(function(t){var e=[],r=t.points;r=r.split(/[\s|,]/).map(Number);for(var n=0;n<r.length;)e.push([n?"L":"M",r[n],r[n+1]]),n+=2;return"polygon"===t.type?e.concat([["z"]]):e}(f)):"rect"===h?r=F((a=+(n=f).x||0,i=+n.y||0,s=+n.width,o=+n.height,c=+n.rx,u=+n.ry,c||u?(c=c||u,u=u||c,2*c>s&&(c-=(2*c-s)/2),2*u>o&&(u-=(2*u-o)/2),[["M",a+c,i],["h",s-2*c],["s",c,0,c,u],["v",o-2*u],["s",0,u,-c,u],["h",2*c-s],["s",-c,0,-c,-u],["v",2*u-o],["s",0,-u,c,-u]]):[["M",a,i],["h",s],["v",o],["H",a],["Z"]])):"line"===h?r=F(function(t){return[["M",+t.x1,+t.y1],["L",+t.x2,+t.y2]]}(f)):"glyph"===h&&(r=t.getAttribute("d")),r?(m.setAttribute("d",r),e&&(t.before(m,t),t.remove()),m):null},options:l,Version:"0.1.9"},at=function(t,e){var r=e||{},n=l.round,a=r.round;0!=+a&&!1!==a||(n=0);var i=(n&&(r||l)).decimals;return this.round=0===n?0:i,this.segments=S(t),this.pathValue=t,this};return at.prototype.toAbsolute=function(){var t=this.segments;return this.segments=q(t),this},at.prototype.toRelative=function(){var t=this.segments;return this.segments=K(t),this},at.prototype.reverse=function(t){this.toAbsolute();var e=this.segments,r=$(this.pathValue).length>1&&$(this.toString()),n=r&&x(r).map((function(e,r){return t?r?_(e):S(e):_(e)})),a=[];return a=r?n.flat(1):t?e:_(e),this.segments=x(a),this},at.prototype.normalize=function(){var t=this.segments;return this.segments=T(t),this},at.prototype.optimize=function(){var t=this.segments;return this.segments=W(t,this.round),this},at.prototype.transform=function(t){if(!t||"object"!=typeof t||"object"==typeof t&&!["translate","rotate","skew","scale"].some((function(e){return e in t})))return this;var e=t||{},r=this.segments;if(!e.origin){var n=G(r);e.origin=[n.cx,n.cy,n.cx]}return this.segments=rt(r,e),this},at.prototype.flipX=function(){return this.transform({rotate:[180,0,0]}),this},at.prototype.flipY=function(){return this.transform({rotate:[0,180,0]}),this},at.prototype.toString=function(){return F(this.segments,this.round)},Object.keys(nt).forEach((function(t){at[t]=nt[t]})),at}));
1
+ // SVGPathCommander v0.1.10alpha1 | thednp © 2021 | MIT-License
2
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).SVGPathCommander=e()}(this,(function(){"use strict";function t(t){if(!t.every((function(t){return!Number.isNaN(t)})))throw TypeError('CSSMatrix: "'+t+'" must only have numbers.');var e=new m,r=Array.from(t);if(16===r.length){var n=r[0],a=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],h=r[7],l=r[8],f=r[9],p=r[10],y=r[11],v=r[12],x=r[13],M=r[14],d=r[15];e.m11=n,e.a=n,e.m21=o,e.c=o,e.m31=l,e.m41=v,e.e=v,e.m12=a,e.b=a,e.m22=c,e.d=c,e.m32=f,e.m42=x,e.f=x,e.m13=i,e.m23=u,e.m33=p,e.m43=M,e.m14=s,e.m24=h,e.m34=y,e.m44=d}else{if(6!==r.length)throw new TypeError("CSSMatrix: expecting an Array of 6/16 values.");var g=r[0],b=r[1],w=r[2],A=r[3],C=r[4],N=r[5];e.m11=g,e.a=g,e.m12=b,e.b=b,e.m21=w,e.c=w,e.m22=A,e.d=A,e.m41=C,e.e=C,e.m42=N,e.f=N}return e}function e(e){if(![m,DOMMatrix,Object].some((function(t){return e instanceof t})))throw TypeError('CSSMatrix: "'+e+'" is not a DOMMatrix / CSSMatrix compatible object.');return t([e.m11,e.m12,e.m13,e.m14,e.m21,e.m22,e.m23,e.m24,e.m31,e.m32,e.m33,e.m34,e.m41,e.m42,e.m43,e.m44])}function r(e){if("string"!=typeof e)throw TypeError('CSSMatrix: "'+e+'" is not a string.');var r=String(e).replace(/\s/g,""),n=new m;return r.split(")").filter((function(t){return t})).map((function(t){var e=t.split("("),r=e[0],n=e[1].split(",").map((function(t){return t.includes("rad")?parseFloat(t)*(180/Math.PI):parseFloat(t)}));return n[0],n[1],n[2],n[3],{prop:r,components:n}})).forEach((function(e){var r=e.prop,a=e.components,i=a[0],s=a[1],o=a[2],c=a[3],u=[i,s,o],m=[i,s,o,c];if(r.includes("matrix")){var h=a.map((function(t){return Math.abs(t)<1e-6?0:t}));[6,16].includes(h.length)&&(n=n.multiply(t(h)))}else if(["translate","translate3d"].some((function(t){return r===t}))&&i)n=n.translate(i,s||0,o||0);else if("rotate3d"===r&&m.every((function(t){return!Number.isNaN(+t)}))&&c)n=n.rotateAxisAngle(i,s,o,c);else if("scale3d"===r&&u.every((function(t){return!Number.isNaN(+t)}))&&u.some((function(t){return 1!==t})))n=n.scale(i,s,o);else if("rotate"===r&&i)n=n.rotate(0,0,i);else if("scale"!==r||Number.isNaN(i)||1===i){if("skew"===r&&(i||s))n=i?n.skewX(i):n,n=s?n.skewY(s):n;else if(/[XYZ]/.test(r)&&i)if(r.includes("skew"))n=n[r](i);else{var l=r.replace(/[XYZ]/,""),f=r.replace(l,""),p=["X","Y","Z"].indexOf(f),y=[0===p?i:0,1===p?i:0,2===p?i:0];n=n[l].apply(n,y)}}else{var v=Number.isNaN(+s)?i:s;n=n.scale(i,v,1)}})),n}function n(t,e,r){var n=new m;return n.m41=t,n.e=t,n.m42=e,n.f=e,n.m43=r,n}function a(t,e,r){var n=new m,a=Math.PI/180,i=t*a,s=e*a,o=r*a,c=Math.cos(i),u=-Math.sin(i),h=Math.cos(s),l=-Math.sin(s),f=Math.cos(o),p=-Math.sin(o),y=h*f,v=-h*p;n.m11=y,n.a=y,n.m12=v,n.b=v,n.m13=l;var x=u*l*f+c*p;n.m21=x,n.c=x;var M=c*f-u*l*p;return n.m22=M,n.d=M,n.m23=-u*h,n.m31=u*p-c*l*f,n.m32=u*f+c*l*p,n.m33=c*h,n}function i(t,e,r,n){var a=new m,i=n*(Math.PI/360),s=Math.sin(i),o=Math.cos(i),c=s*s,u=Math.sqrt(t*t+e*e+r*r),h=t,l=e,f=r;0===u?(h=0,l=0,f=1):(h/=u,l/=u,f/=u);var p=h*h,y=l*l,v=f*f,x=1-2*(y+v)*c;a.m11=x,a.a=x;var M=2*(h*l*c+f*s*o);a.m12=M,a.b=M,a.m13=2*(h*f*c-l*s*o);var d=2*(l*h*c-f*s*o);a.m21=d,a.c=d;var g=1-2*(v+p)*c;return a.m22=g,a.d=g,a.m23=2*(l*f*c+h*s*o),a.m31=2*(f*h*c+l*s*o),a.m32=2*(f*l*c-h*s*o),a.m33=1-2*(p+y)*c,a}function s(t,e,r){var n=new m;return n.m11=t,n.a=t,n.m22=e,n.d=e,n.m33=r,n}function o(t){var e=new m,r=t*Math.PI/180,n=Math.tan(r);return e.m21=n,e.c=n,e}function c(t){var e=new m,r=t*Math.PI/180,n=Math.tan(r);return e.m12=n,e.b=n,e}function u(e,r){return t([r.m11*e.m11+r.m12*e.m21+r.m13*e.m31+r.m14*e.m41,r.m11*e.m12+r.m12*e.m22+r.m13*e.m32+r.m14*e.m42,r.m11*e.m13+r.m12*e.m23+r.m13*e.m33+r.m14*e.m43,r.m11*e.m14+r.m12*e.m24+r.m13*e.m34+r.m14*e.m44,r.m21*e.m11+r.m22*e.m21+r.m23*e.m31+r.m24*e.m41,r.m21*e.m12+r.m22*e.m22+r.m23*e.m32+r.m24*e.m42,r.m21*e.m13+r.m22*e.m23+r.m23*e.m33+r.m24*e.m43,r.m21*e.m14+r.m22*e.m24+r.m23*e.m34+r.m24*e.m44,r.m31*e.m11+r.m32*e.m21+r.m33*e.m31+r.m34*e.m41,r.m31*e.m12+r.m32*e.m22+r.m33*e.m32+r.m34*e.m42,r.m31*e.m13+r.m32*e.m23+r.m33*e.m33+r.m34*e.m43,r.m31*e.m14+r.m32*e.m24+r.m33*e.m34+r.m34*e.m44,r.m41*e.m11+r.m42*e.m21+r.m43*e.m31+r.m44*e.m41,r.m41*e.m12+r.m42*e.m22+r.m43*e.m32+r.m44*e.m42,r.m41*e.m13+r.m42*e.m23+r.m43*e.m33+r.m44*e.m43,r.m41*e.m14+r.m42*e.m24+r.m43*e.m34+r.m44*e.m44])}var m=function t(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var n=this;if(n.a=1,n.b=0,n.c=0,n.d=1,n.e=0,n.f=0,n.m11=1,n.m12=0,n.m13=0,n.m14=0,n.m21=0,n.m22=1,n.m23=0,n.m24=0,n.m31=0,n.m32=0,n.m33=1,n.m34=0,n.m41=0,n.m42=0,n.m43=0,n.m44=1,e&&e.length){var a=e;return e instanceof Array&&(e[0]instanceof Array&&[16,6].includes(e[0].length)||"string"==typeof e[0]||[t,DOMMatrix].some((function(t){return e[0]instanceof t})))&&(a=e[0]),n.setMatrixValue(a)}return n},h={isIdentity:{configurable:!0},is2D:{configurable:!0}};h.isIdentity.set=function(t){this.isIdentity=t},h.isIdentity.get=function(){var t=this;return 1===t.m11&&0===t.m12&&0===t.m13&&0===t.m14&&0===t.m21&&1===t.m22&&0===t.m23&&0===t.m24&&0===t.m31&&0===t.m32&&1===t.m33&&0===t.m34&&0===t.m41&&0===t.m42&&0===t.m43&&1===t.m44},h.is2D.get=function(){var t=this;return 0===t.m31&&0===t.m32&&1===t.m33&&0===t.m34&&0===t.m43&&1===t.m44},h.is2D.set=function(t){this.is2D=t},m.prototype.setMatrixValue=function(n){return[DOMMatrix,m].some((function(t){return n instanceof t}))?e(n):"string"==typeof n&&n.length&&"none"!==n?r(n):Array.isArray(n)?t(n):this},m.prototype.toString=function(){var t=this.toArray().join(",");return(this.is2D?"matrix":"matrix3d")+"("+t+")"},m.prototype.toArray=function(){var t=this,e=Math.pow(10,6);return(t.is2D?[t.a,t.b,t.c,t.d,t.e,t.f]:[t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44]).map((function(t){return Math.abs(t)<1e-6?0:(t*e>>0)/e}))},m.prototype.toJSON=function(){return JSON.parse(JSON.stringify(this))},m.prototype.multiply=function(t){return u(this,t)},m.prototype.translate=function(t,e,r){var a=e,i=r;return null==i&&(i=0),null==a&&(a=0),u(this,n(t,a,i))},m.prototype.scale=function(t,e,r){var n=e,a=r;return null==n&&(n=t),null==a&&(a=t),u(this,s(t,n,a))},m.prototype.rotate=function(t,e,r){var n=t,i=e,s=r;return null==i&&(i=0),null==s&&(s=n,n=0),u(this,a(n,i,s))},m.prototype.rotateAxisAngle=function(t,e,r,n){if([t,e,r,n].some((function(t){return Number.isNaN(t)})))throw new TypeError("CSSMatrix: expecting 4 values");return u(this,i(t,e,r,n))},m.prototype.skewX=function(t){return u(this,o(t))},m.prototype.skewY=function(t){return u(this,c(t))},m.prototype.transformPoint=function(t){var e=n(t.x,t.y,t.z);return e.m44=t.w||1,{x:(e=this.multiply(e)).m41,y:e.m42,z:e.m43,w:e.m44}},m.prototype.transform=function(t){var e=this,r=e.m11*t.x+e.m12*t.y+e.m13*t.z+e.m14*t.w,n=e.m21*t.x+e.m22*t.y+e.m23*t.z+e.m24*t.w,a=e.m31*t.x+e.m32*t.y+e.m33*t.z+e.m34*t.w,i=e.m41*t.x+e.m42*t.y+e.m43*t.z+e.m44*t.w;return{x:r/i,y:n/i,z:a/i,w:i}},Object.defineProperties(m.prototype,h),m.Translate=n,m.Rotate=a,m.RotateAxisAngle=i,m.Scale=s,m.SkewX=o,m.SkewY=c,m.Multiply=u,m.fromArray=t,m.fromMatrix=e,m.fromString=r;var l={origin:null,decimals:4,round:1};function f(t,e,r){if(t[r].length>7){t[r].shift();for(var n=t[r],a=r;n.length;)e[r]="A",t.splice(a+=1,0,["C"].concat(n.splice(0,6)));t.splice(r,1)}}var p={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function y(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return p[e]===t.length-1&&/[achlmqstvz]/gi.test(e)}))}function v(t){return y(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}function x(t){return t.map((function(t){return Array.isArray(t)?x(t):Number.isNaN(+t)?t:+t}))}function M(t){var e=t.pathValue[t.segmentStart],r=e.toLowerCase(),n=t.data;if("m"===r&&n.length>2&&(t.segments.push([e,n[0],n[1]]),n=n.slice(2),r="l",e="m"===e?"l":"L"),"r"===r)t.segments.push([e].concat(n));else for(;n.length>=p[r]&&(t.segments.push([e].concat(n.splice(0,p[r]))),p[r]););}function d(t){var e=t.index,r=t.pathValue.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err="Invalid path value: invalid Arc flag "+r+", expecting 0 or 1 at index "+e)}function g(t){return t>=48&&t<=57}function b(t){var e,r=t.max,n=t.pathValue,a=t.index,i=a,s=!1,o=!1,c=!1,u=!1;if(i>=r)t.err="Invalid path value at "+i+": missing param "+n[i];else if(43!==(e=n.charCodeAt(i))&&45!==e||(e=(i+=1)<r?n.charCodeAt(i):0),g(e)||46===e){if(46!==e){if(s=48===e,e=(i+=1)<r?n.charCodeAt(i):0,s&&i<r&&e&&g(e))return void(t.err="Invalid path value at index "+a+": "+n[a]+" illegal number");for(;i<r&&g(n.charCodeAt(i));)i+=1,o=!0;e=i<r?n.charCodeAt(i):0}if(46===e){for(u=!0,i+=1;g(n.charCodeAt(i));)i+=1,c=!0;e=i<r?n.charCodeAt(i):0}if(101===e||69===e){if(u&&!o&&!c)return void(t.err="Invalid path value at index "+i+": "+n[i]+" invalid float exponent");if(43!==(e=(i+=1)<r?n.charCodeAt(i):0)&&45!==e||(i+=1),!(i<r&&g(n.charCodeAt(i))))return void(t.err="Invalid path value at index "+i+": "+n[i]+" invalid float exponent");for(;i<r&&g(n.charCodeAt(i));)i+=1}t.index=i,t.param=+t.pathValue.slice(a,i)}else t.err="Invalid path value at index "+i+": "+n[i]+" is not a number"}function w(t){for(var e,r=t.pathValue,n=t.max;t.index<n&&(10===(e=r.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index+=1}function A(t){return t>=48&&t<=57||43===t||45===t||46===t}function C(t){var e=t.max,r=t.pathValue,n=t.index,a=r.charCodeAt(n),i=p[r[n].toLowerCase()];if(t.segmentStart=n,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0;default:return!1}}(a))if(t.index+=1,w(t),t.data=[],i){for(;;){for(var s=i;s>0;s-=1){if(97!=(32|a)||3!==s&&4!==s?b(t):d(t),t.err.length)return;t.data.push(t.param),w(t),t.index<e&&44===r.charCodeAt(t.index)&&(t.index+=1,w(t))}if(t.index>=t.max)break;if(!A(r.charCodeAt(t.index)))break}M(t)}else M(t);else t.err="Invalid path value: "+r[n]+" not a path command"}function N(t){this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}function S(t){if(y(t))return x(t);var e=new N(t);for(w(e);e.index<e.max&&!e.err.length;)C(e);return e.err.length?e.segments=[]:e.segments.length&&("mM".indexOf(e.segments[0][0])<0?(e.err="Invalid path value: missing M/m",e.segments=[]):e.segments[0][0]="M"),e.segments}function k(t){return y(t)&&t.every((function(t){return t[0]===t[0].toUpperCase()}))}function q(t){if(k(t))return x(t);var e=S(t),r=e.length,n=[],a=0,i=0,s=0,o=0,c=0;"M"===e[0][0]&&(s=a=+e[0][1],o=i=+e[0][2],c+=1,n.push(["M",a,i]));for(var u=c;u<r;u+=1){var m=e[u],h=m[0],l=h.toUpperCase(),f=[],p=[];if(n.push(f),h!==l)switch(f[0]=l,l){case"A":p=m.slice(1,-2).concat([+m[6]+a,+m[7]+i]);for(var y=0;y<p.length;y+=1)f.push(p[y]);break;case"V":f[1]=+m[1]+i;break;case"H":f[1]=+m[1]+a;break;default:"M"===l&&(s=+m[1]+a,o=+m[2]+i);for(var v=1;v<m.length;v+=1)f.push(+m[v]+(v%2?a:i))}else for(var M=0;M<m.length;M+=1)f.push(m[M]);var d=f.length;switch(l){case"Z":a=s,i=o;break;case"H":a=+f[1];break;case"V":i=+f[1];break;default:a=+f[d-2],i=+f[d-1],"M"===l&&(s=a,o=i)}}return n}function P(t,e,r){var n=t[0],a=t.slice(1),i=t;if("TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null),"H"===n)i=["L",t[1],e.y1];else if("V"===n)i=["L",e.x1,t[1]];else if("S"===n){var s=function(t,e,r,n,a){return"CS".indexOf(a)>-1?{x1:2*t-r,y1:2*e-n}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,r),o=s.x1,c=s.y1;e.x1=o,e.y1=c,i=["C",o,c].concat(a)}else if("T"===n){var u=function(t,e,r,n,a){return"QT".indexOf(a)>-1?{qx:2*t-r,qy:2*e-n}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,r),m=u.qx,h=u.qy;e.qx=m,e.qy=h,i=["Q",m,h].concat(a)}else if("Q"===n){var l=a[0],f=a[1];e.qx=l,e.qy=f}return i}function I(t){return y(t)&&t.every((function(t){var e=t[0].toLowerCase();return p[e]===t.length-1&&"ACLMQZ".includes(t[0])}))}function T(t){if(I(t))return x(t);for(var e,r,n=q(t),a={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},i=[],s=n.length,o="",c=0;c<s;c+=1){var u=n[c][0];i[c]=u,c&&(o=i[c-1]),n[c]=P(n[c],a,o),r=(e=n[c]).length,a.x1=+e[r-2],a.y1=+e[r-1],a.x2=+e[r-4]||a.x1,a.y2=+e[r-3]||a.y1}return n}function O(t,e,r){return{x:t*Math.cos(r)-e*Math.sin(r),y:t*Math.sin(r)+e*Math.cos(r)}}function V(t,e,r,n,a,i,s,o,c,u){var m,h,l,f,p,y=120*Math.PI/180,v=Math.PI/180*(a||0),x=[],M=t,d=o,g=e,b=c,w=r,A=n;if(u){h=u[0],l=u[1],f=u[2],p=u[3]}else{M=(m=O(M,g,-v)).x,g=m.y;var C=(M-(d=(m=O(d,b,-v)).x))/2,N=(g-(b=m.y))/2,S=Math.pow(C,2)/Math.pow(w,2)+Math.pow(N,2)/Math.pow(A,2);S>1&&(w*=S=Math.sqrt(S),A*=S);var k=Math.pow(w,2),q=Math.pow(A,2),P=(i===s?-1:1)*Math.sqrt(Math.abs((k*q-k*N*N-q*C*C)/(k*N*N+q*C*C)));f=P*w*N/A+(M+d)/2,p=P*-A*C/w+(g+b)/2,h=Math.asin(((g-p)/A*Math.pow(10,9)>>0)/Math.pow(10,9)),l=Math.asin(((b-p)/A*Math.pow(10,9)>>0)/Math.pow(10,9)),h=M<f?Math.PI-h:h,l=d<f?Math.PI-l:l,h<0&&(h=2*Math.PI+h),l<0&&(l=2*Math.PI+l),s&&h>l&&(h-=2*Math.PI),!s&&l>h&&(l-=2*Math.PI)}var I=l-h;if(Math.abs(I)>y){var T=l,z=d,L=b;l=h+y*(s&&l>h?1:-1),d=f+w*Math.cos(l),b=p+A*Math.sin(l),x=V(d,b,w,A,a,0,s,z,L,[l,T,f,p])}I=l-h;var j=Math.cos(h),E=Math.sin(h),D=Math.cos(l),Z=Math.sin(l),Q=Math.tan(I/4),X=4/3*w*Q,Y=4/3*A*Q,H=[M,g],R=[M+X*E,g-Y*j],G=[d+X*Z,b-Y*D],J=[d,b];return R[0]=2*H[0]-R[0],R[1]=2*H[1]-R[1],u?[R,G,J].concat(x):(x=[R,G,J].concat(x).join().split(",")).map((function(t,e){return e%2?O(x[e-1],t,v).y:O(t,x[e+1],v).x}))}function z(t,e,r,n,a,i){return[1/3*t+2/3*r,1/3*e+2/3*n,1/3*a+2/3*r,1/3*i+2/3*n,a,i]}function L(t,e,r,n,a,i,s,o,c){var u=1-c;return{x:Math.pow(u,3)*t+u*u*3*c*r+3*u*c*c*a+Math.pow(c,3)*s,y:Math.pow(u,3)*e+u*u*3*c*n+3*u*c*c*i+Math.pow(c,3)*o}}function j(t,e,r){var n=t[0],a=t[1];return[n+(e[0]-n)*r,a+(e[1]-a)*r]}function E(t,e,r,n){var a=.5,i=[t,e],s=[r,n],o=j(i,s,a),c=j(s,o,a),u=j(o,c,a),m=j(c,u,a),h=j(u,m,a),l=L.apply(0,i.concat(o,u,h,a)),f=L.apply(0,h.concat(m,c,s,0));return[l.x,l.y,f.x,f.y,r,n]}function D(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);var r=t.slice(1),n=r[0],a=r[1];switch(t[0]){case"M":return e.x=n,e.y=a,t;case"A":return["C"].concat(V.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=n,e.qy=a,["C"].concat(z.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(E(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(E(e.x1,e.y1,e.x,e.y))}return t}function Z(t){if(v(t))return x(t);for(var e=T(t),r={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},n=[],a="",i=e.length,s=0;s<i;s+=1){var o=e[s],c=o.length;o&&(a=o[0]),n[s]=a,e[s]=D(o,r),f(e,n,s),i=e.length,r.x1=+o[c-2],r.y1=+o[c-1],r.x2=+o[c-4]||r.x1,r.y2=+o[c-3]||r.y1}return e}function Q(t,e,r,n,a,i,s,o){return 3*((o-e)*(r+a)-(s-t)*(n+i)+n*(t-a)-r*(e-i)+o*(a+t/3)-s*(i+e/3))/20}function X(t){var e=0,r=0,n=0,a=0,i=0;return Z(t).map((function(t){var s;switch(t[0]){case"M":case"Z":return n="M"===t[0]?t[1]:n,a="M"===t[0]?t[2]:a,e=n,r=a,0;default:return i=Q.apply(0,[e,r].concat(t.slice(1))),s=t.slice(-2),e=s[0],r=s[1],i}})).reduce((function(t,e){return t+e}),0)}function Y(t,e,r,n,a){return a*(a*(-3*t+9*e-9*r+3*n)+6*t-12*e+6*r)-3*t+3*e}function H(t,e,r,n,a,i,s,o,c){var u;(null===c||Number.isNaN(+c))&&(u=1),u>1&&(u=1),u<0&&(u=0);var m=u/2,h=0,l=0,f=0,p=0,y=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];return[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816].forEach((function(c,u){l=Y(t,r,a,s,h=m*c+m),f=Y(e,n,i,o,h),p+=y[u]*Math.sqrt(l*l+f*f)})),m*p}function R(t,e,r,n,a,i,s,o){var c,u=a-2*r+t-(s-2*a+r),m=2*(r-t)-2*(a-r),h=t-r,l=(-m+Math.sqrt(m*m-4*u*h))/2/u,f=(-m-Math.sqrt(m*m-4*u*h))/2/u,p=[e,o],y=[t,s];return Math.abs(l)>"1e12"&&(l=.5),Math.abs(f)>"1e12"&&(f=.5),l>0&&l<1&&(c=L(t,e,r,n,a,i,s,o,l),y.push(c.x),p.push(c.y)),f>0&&f<1&&(c=L(t,e,r,n,a,i,s,o,f),y.push(c.x),p.push(c.y)),u=i-2*n+e-(o-2*i+n),h=e-n,l=(-(m=2*(n-e)-2*(i-n))+Math.sqrt(m*m-4*u*h))/2/u,f=(-m-Math.sqrt(m*m-4*u*h))/2/u,Math.abs(l)>"1e12"&&(l=.5),Math.abs(f)>"1e12"&&(f=.5),l>0&&l<1&&(c=L(t,e,r,n,a,i,s,o,l),y.push(c.x),p.push(c.y)),f>0&&f<1&&(c=L(t,e,r,n,a,i,s,o,f),y.push(c.x),p.push(c.y)),{min:{x:Math.min.apply(0,y),y:Math.min.apply(0,p)},max:{x:Math.max.apply(0,y),y:Math.max.apply(0,p)}}}function G(t){if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0};var e=Z(t),r=0,n=0,a=[],i=[];e.forEach((function(t){var e=t.slice(-2),s=e[0],o=e[1];if("M"===t[0])r=s,n=o,a.push(s),i.push(o);else{var c=R.apply(0,[r,n].concat(t.slice(1)));a=a.concat(c.min.x,c.max.x),i=i.concat(c.min.y,c.max.y),r=s,n=o}}));var s=Math.min.apply(0,a),o=Math.min.apply(0,i),c=Math.max.apply(0,a),u=Math.max.apply(0,i),m=c-s,h=u-o;return{width:m,height:h,x:s,y:o,x2:c,y2:u,cx:s+m/2,cy:o+h/2}}function J(t){return y(t)&&t.slice(1).every((function(t){return t[0]===t[0].toLowerCase()}))}function B(t,e){var r=l.round,n=l.decimals,a=Number.isNaN(+e)?r&&n:+e;return a?t.map((function(t){return t.map((function(t){var e=+t,r=Math.pow(10,a);return e?e%1==0?e:Math.round(e*r)/r:t}))})):x(t)}function F(t,e){return B(t,e).map((function(t){return t[0].concat(t.slice(1).join(" "))})).join("")}var U={circle:["cx","cy","r"],ellipse:["cx","cy","rx","ry"],rect:["width","height","x","y","rx","ry"],polygon:["points"],polyline:["points"],glyph:[]};function $(t){return F(q(t)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t}))}function K(t){if(J(t))return x(t);var e=S(t),r=e.length,n=[],a=0,i=0,s=0,o=0,c=0;"M"===e[0][0]&&(s=a=+e[0][1],o=i=+e[0][2],c+=1,n.push(["M",a,i]));for(var u=c;u<r;u+=1){var m=e[u],h=m[0],l=h.toLowerCase(),f=[],p=[];if(n.push(f),h!==l)switch(f[0]=l,l){case"a":p=m.slice(1,-2).concat([+m[6]-a,+m[7]-i]);for(var y=0;y<p.length;y+=1)f.push(p[y]);break;case"v":f[1]=+m[1]-i;break;default:for(var v=1;v<m.length;v+=1)f.push(+m[v]-(v%2?a:i));"m"===l&&(s=+m[1],o=+m[2])}else{"m"===h&&(s=+m[1]+a,o=+m[2]+i);for(var M=0;M<m.length;M+=1)f.push(m[M])}var d=f.length;switch(f[0]){case"z":a=s,i=o;break;case"h":a+=f[d-1];break;case"v":i+=f[d-1];break;default:a+=n[u][d-2],i+=n[u][d-1]}}return n}function W(t,e){var r=B(q(t),e),n=B(K(t),e);return r.map((function(t,e){return e?t.join("").length<n[e].join("").length?t:n[e]:t}))}function _(t){var e=q(t),r="Z"===e.slice(-1)[0][0],n=[],a=0;return n=T(e).map((function(t,r){return a=t.length,{seg:e[r],n:t,c:e[r][0],x:t[a-2],y:t[a-1]}})).map((function(t,e,n){var a=t.seg,i=t.n,s=e&&n[e-1],o=n[e+1]&&n[e+1],c=t.c,u=n.length,m=e?n[e-1].x:n[u-1].x,h=e?n[e-1].y:n[u-1].y,l=[];switch(c){case"M":l=r?["Z"]:[c,m,h];break;case"A":l=a.slice(0,-3).concat([1===a[5]?0:1,m,h]);break;case"C":l=o&&"S"===o.c?["S",a[1],a[2],m,h]:[c,a[3],a[4],a[1],a[2],m,h];break;case"S":l=s&&"CS".indexOf(s.c)>-1&&(!o||o&&"S"!==o.c)?["C",i[3],i[4],i[1],i[2],m,h]:[c,i[1],i[2],m,h];break;case"Q":l=o&&"T"===o.c?["T",m,h]:a.slice(0,-2).concat([m,h]);break;case"T":l=s&&"QT".indexOf(s.c)>-1&&(!o||o&&"T"!==o.c)?["Q",i[1],i[2],m,h]:[c,m,h];break;case"Z":l=["M",m,h];break;case"H":l=[c,m];break;case"V":l=[c,h];break;default:l=a.slice(0,-2).concat([m,h])}return l})),r?n.reverse():[n[0]].concat(n.slice(1).reverse())}function tt(t){var e=new m,r=t.origin,n=+r[0],a=+r[1],i=t.translate,s=t.rotate,o=t.skew,c=t.scale;return(!Number.isNaN(i)||Array.isArray(i)&&i.some((function(t){return 0!=+t})))&&(e=Array.isArray(i)?e.translate(+i[0]||0,+i[1]||0,+i[2]||0):e.translate(+i||0,0,0)),(s||o||c)&&(e=e.translate(+n,+a),s&&(e=Array.isArray(s)&&s.some((function(t){return 0!=+t}))?e.rotate(+s[0]||0,+s[1]||0,+s[2]||0):e.rotate(+s||0)),Array.isArray(o)&&o.some((function(t){return 0!=+t}))&&(Array.isArray(o)?(e=o[0]?e.skewX(+o[0]||0):e,e=o[1]?e.skewY(+o[1]||0):e):e=e.skewX(+o||0)),(!Number.isNaN(c)||Array.isArray(c)&&c.some((function(t){return 1!=+t})))&&(e=Array.isArray(c)?e.scale(+c[0]||1,+c[1]||1,+c[2]||1):e.scale(+c||1)),e=e.translate(-n,-a)),e}function et(t,e,r){var n=t.transformPoint({x:e[0],y:e[1],z:0,w:1}),a=r[0]||0,i=r[1]||0,s=r[2]||0,o=n.x-a,c=n.y-i,u=n.z-s;return[o*(Math.abs(s)/Math.abs(u))+a,c*(Math.abs(s)/Math.abs(u))+i]}function rt(t,e){var r,n,a,i,s,o,c,u,m,h=q(t),l=T(h),p=tt(e),y=Object.keys(e),v=e.origin,M=[p.a,p.b,p.c,p.d,p.e,p.f],d={x1:0,y1:0,x2:0,y2:0,x:0,y:0},g=[],b=0,w="",A=[],C=[],N=[];if(!p.isIdentity){for(a=0,s=h.length;a<s;a+=1)g=h[a],h[a]&&(w=g[0]),C[a]=w,"A"!==w||p.is2D&&["skewX","skewY"].find((function(t){return y.includes(t)}))||(g=D(l[a],d),h[a]=D(l[a],d),f(h,C,a),l[a]=D(l[a],d),f(l,C,a),s=Math.max(h.length,l.length)),b=(g=l[a]).length,d.x1=+g[b-2],d.y1=+g[b-1],d.x2=+g[b-4]||d.x1,d.y2=+g[b-3]||d.y1,N={s:h[a],c:h[a][0]},"Z"!==w&&(N.x=d.x1,N.y=d.y1),A=A.concat(N);return A=A.map((function(t){var e,a,s;switch(w=t.c,g=t.s,w){case"A":return m=function(t,e,r,n){var a=Math.cos(n*Math.PI/180),i=Math.sin(n*Math.PI/180),s=[e*(t[0]*a+t[2]*i),e*(t[1]*a+t[3]*i),r*(-t[0]*i+t[2]*a),r*(-t[1]*i+t[3]*a)],o=s[0]*s[0]+s[2]*s[2],c=s[1]*s[1]+s[3]*s[3],u=((s[0]-s[3])*(s[0]-s[3])+(s[2]+s[1])*(s[2]+s[1]))*((s[0]+s[3])*(s[0]+s[3])+(s[2]-s[1])*(s[2]-s[1])),m=(o+c)/2;if(u<1e-9*m){var h=Math.sqrt(m);return{rx:h,ry:h,ax:0}}var l,f,p=s[0]*s[1]+s[2]*s[3],y=m+(u=Math.sqrt(u))/2,v=m-u/2,x=Math.abs(p)<1e-9&&Math.abs(y-c)<1e-9?90:Math.atan(Math.abs(p)>Math.abs(y-c)?(y-o)/p:p/(y-c)*180)/Math.PI;return x>=0?(l=Math.sqrt(y),f=Math.sqrt(v)):(x+=90,l=Math.sqrt(v),f=Math.sqrt(y)),{rx:l,ry:f,ax:x}}(M,g[1],g[2],g[3]),M[0]*M[3]-M[1]*M[2]<0&&(g[5]=+g[5]?0:1),e=et(p,[g[6],g[7]],v),c=e[0],u=e[1],g=r===c&&n===u||m.rx<1e-9*m.ry||m.ry<1e-9*m.rx?["L",c,u]:[w,m.rx,m.ry,m.ax,g[4],g[5],c,u],r=c,n=u,g;case"L":case"H":case"V":return a=et(p,[t.x,t.y],v),c=a[0],u=a[1],r!==c&&n!==u?g=["L",c,u]:n===u?g=["H",c]:r===c&&(g=["V",u]),r=c,n=u,g;default:for(i=1,o=g.length;i<o;i+=2)s=et(p,[g[i],g[i+1]],v),r=s[0],n=s[1],g[i]=r,g[i+1]=n;return g}}))}return x(h)}var nt={CSSMatrix:m,parsePathString:S,isPathArray:y,isCurveArray:v,isAbsoluteArray:k,isRelativeArray:J,isNormalizedArray:I,isValidPath:function(t){if("string"!=typeof t)return!1;var e=new N(t);for(w(e);e.index<e.max&&!e.err.length;)C(e);return!e.err.length&&"mM".includes(e.segments[0][0])},pathToAbsolute:q,pathToRelative:K,pathToCurve:Z,pathToString:F,getDrawDirection:function(t){return X(Z(t))>=0},getPathArea:X,getPathBBox:G,getPathLength:function(t){var e=0;return Z(t).forEach((function(t,r,n){e+="M"===t[0]?0:H.apply(0,n[r-1].slice(-2).concat(t.slice(1)))})),e},getPointAtLength:function(t,e){var r,n,a=0;return Z(t).map((function(t,i,s){return n=i?s[i-1].slice(-2).concat(t.slice(1)):t.slice(1),r=i?H.apply(0,n):0,a+=r,0===i?{x:n[0],y:n[1]}:a>e&&e>a-r?L.apply(0,n.concat(1-(a-e)/r)):null})).filter((function(t){return t})).slice(-1)[0]},clonePath:x,splitPath:$,roundPath:B,optimizePath:W,reverseCurve:function(t){var e=t.slice(1).map((function(e,r,n){return r?n[r-1].slice(-2).concat(e.slice(1)):t[0].slice(1).concat(e.slice(1))})).map((function(t){return t.map((function(e,r){return t[t.length-r-2*(1-r%2)]}))})).reverse();return[["M"].concat(e[0].slice(0,2))].concat(e.map((function(t){return["C"].concat(t.slice(2))})))},reversePath:_,normalizePath:T,transformPath:rt,getSVGMatrix:tt,shapeToPath:function(t,e){if(!Object.keys(U).concat(["glyph"]).some((function(e){return t.tagName===e})))throw TypeError("shapeToPath: "+t+" is not SVGElement");var r,n,a,i,s,o,c,u,m=document.createElementNS("http://www.w3.org/2000/svg","path"),h=t.tagName,l=U[h],f={type:h};return l.forEach((function(e){f[e]=t.getAttribute(e)})),Object.values(t.attributes).forEach((function(t){var e=t.name,r=t.value;l.includes(e)||m.setAttribute(e,r)})),["circle","ellipse"].includes(h)?r=F(function(t){var e=t.type,r=t.cx,n=t.cy,a=t.r,i=t.rx,s=t.ry;return"circle"===e&&a>0&&(i=a,s=a),[["M",r-i,n],["a",i,s,0,1,0,2*i,0],["a",i,s,0,1,0,-2*i,0]]}(f)):["polyline","polygon"].includes(h)?r=F(function(t){var e=[],r=t.points;r=r.split(/[\s|,]/).map(Number);for(var n=0;n<r.length;)e.push([n?"L":"M",r[n],r[n+1]]),n+=2;return"polygon"===t.type?e.concat([["z"]]):e}(f)):"rect"===h?r=F((a=+(n=f).x||0,i=+n.y||0,s=+n.width,o=+n.height,c=+n.rx,u=+n.ry,c||u?(c=c||u,u=u||c,2*c>s&&(c-=(2*c-s)/2),2*u>o&&(u-=(2*u-o)/2),[["M",a+c,i],["h",s-2*c],["s",c,0,c,u],["v",o-2*u],["s",0,u,-c,u],["h",2*c-s],["s",-c,0,-c,-u],["v",2*u-o],["s",0,-u,c,-u]]):[["M",a,i],["h",s],["v",o],["H",a],["Z"]])):"line"===h?r=F(function(t){return[["M",+t.x1,+t.y1],["L",+t.x2,+t.y2]]}(f)):"glyph"===h&&(r=t.getAttribute("d")),r?(m.setAttribute("d",r),e&&(t.before(m,t),t.remove()),m):null},options:l,Version:"0.1.10alpha1"},at=function(t,e){var r=e||{},n=l.round,a=r.round;0!=+a&&!1!==a||(n=0);var i=(n&&(r||l)).decimals;return this.round=0===n?0:i,this.segments=S(t),this.pathValue=t,this};return at.prototype.toAbsolute=function(){var t=this.segments;return this.segments=q(t),this},at.prototype.toRelative=function(){var t=this.segments;return this.segments=K(t),this},at.prototype.reverse=function(t){this.toAbsolute();var e=this.segments,r=$(this.pathValue).length>1&&$(this.toString()),n=r&&x(r).map((function(e,r){return t?r?_(e):S(e):_(e)})),a=[];return a=r?n.flat(1):t?e:_(e),this.segments=x(a),this},at.prototype.normalize=function(){var t=this.segments;return this.segments=T(t),this},at.prototype.optimize=function(){var t=this.segments;return this.segments=W(t,this.round),this},at.prototype.transform=function(t){if(!t||"object"!=typeof t||"object"==typeof t&&!["translate","rotate","skew","scale"].some((function(e){return e in t})))return this;var e=t||{},r=this.segments;if(!e.origin){var n=G(r);e.origin=[n.cx,n.cy,n.cx]}return this.segments=rt(r,e),this},at.prototype.flipX=function(){return this.transform({rotate:[180,0,0]}),this},at.prototype.flipY=function(){return this.transform({rotate:[0,180,0]}),this},at.prototype.toString=function(){return F(this.segments,this.round)},Object.keys(nt).forEach((function(t){at[t]=nt[t]})),at}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svg-path-commander",
3
- "version": "0.1.9",
3
+ "version": "0.1.10alpha1",
4
4
  "description": "ES6+ JavaScript tools for manipulating SVG path data",
5
5
  "main": "dist/svg-path-commander.min.js",
6
6
  "module": "dist/svg-path-commander.esm.js",
package/src/index.js CHANGED
@@ -1,9 +1,6 @@
1
1
  import Util from './util/util';
2
- import SVGPathCommander from './class/svg-path-commander';
2
+ import SVGPathCommander from './svg-path-commander';
3
3
 
4
4
  Object.keys(Util).forEach((x) => { SVGPathCommander[x] = Util[x]; });
5
5
 
6
- /**
7
- * @typedef {import("../types/types")} SVGPC shows types in src/ sources
8
- */
9
6
  export default SVGPathCommander;
@@ -1,18 +1,18 @@
1
- import SVGPCO from '../options/options';
1
+ import SVGPCO from './options/options';
2
2
 
3
- import pathToAbsolute from '../convert/pathToAbsolute';
4
- import pathToRelative from '../convert/pathToRelative';
5
- import pathToString from '../convert/pathToString';
3
+ import pathToAbsolute from './convert/pathToAbsolute';
4
+ import pathToRelative from './convert/pathToRelative';
5
+ import pathToString from './convert/pathToString';
6
6
 
7
- import parsePathString from '../parser/parsePathString';
8
- import reversePath from '../process/reversePath';
7
+ import parsePathString from './parser/parsePathString';
8
+ import reversePath from './process/reversePath';
9
9
 
10
- import clonePath from '../process/clonePath';
11
- import splitPath from '../process/splitPath';
12
- import optimizePath from '../process/optimizePath';
13
- import normalizePath from '../process/normalizePath';
14
- import transformPath from '../process/transformPath';
15
- import getPathBBox from '../util/getPathBBox';
10
+ import clonePath from './process/clonePath';
11
+ import splitPath from './process/splitPath';
12
+ import optimizePath from './process/optimizePath';
13
+ import normalizePath from './process/normalizePath';
14
+ import transformPath from './process/transformPath';
15
+ import getPathBBox from './util/getPathBBox';
16
16
 
17
17
  /**
18
18
  * Creates a new SVGPathCommander instance.
package/src/util/util.js CHANGED
@@ -28,7 +28,7 @@ import pathToAbsolute from '../convert/pathToAbsolute';
28
28
  import pathToRelative from '../convert/pathToRelative';
29
29
  import pathToCurve from '../convert/pathToCurve';
30
30
  import pathToString from '../convert/pathToString';
31
- import Version from '../class/version';
31
+ import Version from './version';
32
32
 
33
33
  const Util = {
34
34
  CSSMatrix,
File without changes
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- declare module "src/options/options" {
1
+ declare module "options/options" {
2
2
  export default SVGPCO;
3
3
  /**
4
4
  * SVGPathCommander default options
@@ -9,7 +9,7 @@ declare module "src/options/options" {
9
9
  [x: string]: (boolean | number | number[]);
10
10
  };
11
11
  }
12
- declare module "src/process/fixArc" {
12
+ declare module "process/fixArc" {
13
13
  /**
14
14
  * Splits an extended A (arc-to) segment into two cubic-bezier segments.
15
15
  *
@@ -17,9 +17,9 @@ declare module "src/process/fixArc" {
17
17
  * @param {string[]} allPathCommands all previous path commands
18
18
  * @param {Number} i the index of the segment
19
19
  */
20
- export default function fixArc(path: import("types/types").pathArray, allPathCommands: string[], i: number): void;
20
+ export default function fixArc(path: SVGPC.pathArray, allPathCommands: string[], i: number): void;
21
21
  }
22
- declare module "src/parser/paramsCount" {
22
+ declare module "parser/paramsCount" {
23
23
  export default paramsCount;
24
24
  /**
25
25
  * @type {Object.<string, number>}
@@ -28,16 +28,16 @@ declare module "src/parser/paramsCount" {
28
28
  [x: string]: number;
29
29
  };
30
30
  }
31
- declare module "src/util/isPathArray" {
31
+ declare module "util/isPathArray" {
32
32
  /**
33
33
  * Iterates an array to check if it's an actual `pathArray`.
34
34
  *
35
35
  * @param {SVGPC.pathArray} path the `pathArray` to be checked
36
36
  * @returns {boolean} iteration result
37
37
  */
38
- export default function isPathArray(path: import("types/types").pathArray): boolean;
38
+ export default function isPathArray(path: SVGPC.pathArray): boolean;
39
39
  }
40
- declare module "src/util/isCurveArray" {
40
+ declare module "util/isCurveArray" {
41
41
  /**
42
42
  * Iterates an array to check if it's a `pathArray`
43
43
  * with all C (cubic bezier) segments.
@@ -45,18 +45,18 @@ declare module "src/util/isCurveArray" {
45
45
  * @param {SVGPC.pathArray} path the `Array` to be checked
46
46
  * @returns {boolean} iteration result
47
47
  */
48
- export default function isCurveArray(path: import("types/types").pathArray): boolean;
48
+ export default function isCurveArray(path: SVGPC.pathArray): boolean;
49
49
  }
50
- declare module "src/process/clonePath" {
50
+ declare module "process/clonePath" {
51
51
  /**
52
52
  * Returns a clone of an existing `pathArray`.
53
53
  *
54
54
  * @param {SVGPC.pathArray} path the original `pathArray`
55
55
  * @returns {SVGPC.pathArray} the cloned `pathArray`
56
56
  */
57
- export default function clonePath(path: import("types/types").pathArray): import("types/types").pathArray;
57
+ export default function clonePath(path: SVGPC.pathArray): SVGPC.pathArray;
58
58
  }
59
- declare module "src/parser/finalizeSegment" {
59
+ declare module "parser/finalizeSegment" {
60
60
  /**
61
61
  * Breaks the parsing of a pathString once a segment is finalized.
62
62
  *
@@ -64,11 +64,11 @@ declare module "src/parser/finalizeSegment" {
64
64
  */
65
65
  export default function finalizeSegment(path: SVGPC.parserPathArray): void;
66
66
  }
67
- declare module "src/parser/invalidPathValue" {
67
+ declare module "parser/invalidPathValue" {
68
68
  export default invalidPathValue;
69
69
  const invalidPathValue: "Invalid path value";
70
70
  }
71
- declare module "src/parser/scanFlag" {
71
+ declare module "parser/scanFlag" {
72
72
  /**
73
73
  * Validates an A (arc-to) specific path command value.
74
74
  * Usually a `large-arc-flag` or `sweep-flag`.
@@ -77,7 +77,7 @@ declare module "src/parser/scanFlag" {
77
77
  */
78
78
  export default function scanFlag(path: SVGPC.parserPathArray): void;
79
79
  }
80
- declare module "src/parser/isDigit" {
80
+ declare module "parser/isDigit" {
81
81
  /**
82
82
  * Checks if a character is a digit.
83
83
  *
@@ -86,7 +86,7 @@ declare module "src/parser/isDigit" {
86
86
  */
87
87
  export default function isDigit(code: string): boolean;
88
88
  }
89
- declare module "src/parser/scanParam" {
89
+ declare module "parser/scanParam" {
90
90
  /**
91
91
  * Validates every character of the path string,
92
92
  * every path command, negative numbers or floating point numbers.
@@ -95,7 +95,7 @@ declare module "src/parser/scanParam" {
95
95
  */
96
96
  export default function scanParam(path: SVGPC.parserPathArray): void;
97
97
  }
98
- declare module "src/parser/isSpace" {
98
+ declare module "parser/isSpace" {
99
99
  /**
100
100
  * Checks if the character is a space.
101
101
  *
@@ -104,7 +104,7 @@ declare module "src/parser/isSpace" {
104
104
  */
105
105
  export default function isSpace(code: string): boolean;
106
106
  }
107
- declare module "src/parser/skipSpaces" {
107
+ declare module "parser/skipSpaces" {
108
108
  /**
109
109
  * Points the parser to the next character in the
110
110
  * path string every time it encounters any kind of
@@ -114,7 +114,7 @@ declare module "src/parser/skipSpaces" {
114
114
  */
115
115
  export default function skipSpaces(path: SVGPC.parserPathArray): void;
116
116
  }
117
- declare module "src/parser/isPathCommand" {
117
+ declare module "parser/isPathCommand" {
118
118
  /**
119
119
  * Checks if the character is a path command.
120
120
  *
@@ -123,7 +123,7 @@ declare module "src/parser/isPathCommand" {
123
123
  */
124
124
  export default function isPathCommand(code: string): boolean;
125
125
  }
126
- declare module "src/parser/isDigitStart" {
126
+ declare module "parser/isDigitStart" {
127
127
  /**
128
128
  * Checks if the character is or belongs to a number.
129
129
  * [0-9]|+|-|.
@@ -133,7 +133,7 @@ declare module "src/parser/isDigitStart" {
133
133
  */
134
134
  export default function isDigitStart(code: string): boolean;
135
135
  }
136
- declare module "src/parser/isArcCommand" {
136
+ declare module "parser/isArcCommand" {
137
137
  /**
138
138
  * Checks if the character is an A (arc-to) path command.
139
139
  *
@@ -142,7 +142,7 @@ declare module "src/parser/isArcCommand" {
142
142
  */
143
143
  export default function isArcCommand(code: string): boolean;
144
144
  }
145
- declare module "src/parser/scanSegment" {
145
+ declare module "parser/scanSegment" {
146
146
  /**
147
147
  * Scans every character in the path string to determine
148
148
  * where a segment starts and where it ends.
@@ -151,7 +151,7 @@ declare module "src/parser/scanSegment" {
151
151
  */
152
152
  export default function scanSegment(path: SVGPC.parserPathArray): void;
153
153
  }
154
- declare module "src/parser/svgPathArray" {
154
+ declare module "parser/svgPathArray" {
155
155
  /**
156
156
  * The `parserPathArray` used by the parser.
157
157
  *
@@ -183,7 +183,7 @@ declare module "src/parser/svgPathArray" {
183
183
  err: string;
184
184
  }
185
185
  }
186
- declare module "src/parser/parsePathString" {
186
+ declare module "parser/parsePathString" {
187
187
  /**
188
188
  * Parses a path string value and returns an array
189
189
  * of segments we like to call `pathArray`.
@@ -191,9 +191,9 @@ declare module "src/parser/parsePathString" {
191
191
  * @param {string | SVGPC.pathArray} pathInput the string to be parsed
192
192
  * @returns {SVGPC.pathArray} the resulted `pathArray`
193
193
  */
194
- export default function parsePathString(pathInput: string | import("types/types").pathArray): import("types/types").pathArray;
194
+ export default function parsePathString(pathInput: string | SVGPC.pathArray): SVGPC.pathArray;
195
195
  }
196
- declare module "src/util/isAbsoluteArray" {
196
+ declare module "util/isAbsoluteArray" {
197
197
  /**
198
198
  * Iterates an array to check if it's a `pathArray`
199
199
  * with all absolute values.
@@ -201,9 +201,9 @@ declare module "src/util/isAbsoluteArray" {
201
201
  * @param {SVGPC.pathArray} path the `pathArray` to be checked
202
202
  * @returns {boolean} iteration result
203
203
  */
204
- export default function isAbsoluteArray(path: import("types/types").pathArray): boolean;
204
+ export default function isAbsoluteArray(path: SVGPC.pathArray): boolean;
205
205
  }
206
- declare module "src/convert/pathToAbsolute" {
206
+ declare module "convert/pathToAbsolute" {
207
207
  /**
208
208
  * Parses a path string value or object and returns an array
209
209
  * of segments, all converted to absolute values.
@@ -211,9 +211,9 @@ declare module "src/convert/pathToAbsolute" {
211
211
  * @param {string | SVGPC.pathArray} pathInput the path string | object
212
212
  * @returns {SVGPC.pathArray} the resulted `pathArray` with absolute values
213
213
  */
214
- export default function pathToAbsolute(pathInput: string | import("types/types").pathArray): import("types/types").pathArray;
214
+ export default function pathToAbsolute(pathInput: string | SVGPC.pathArray): SVGPC.pathArray;
215
215
  }
216
- declare module "src/process/shorthandToQuad" {
216
+ declare module "process/shorthandToQuad" {
217
217
  /**
218
218
  * Returns the missing control point from an
219
219
  * T (shorthand quadratic bezier) segment.
@@ -227,7 +227,7 @@ declare module "src/process/shorthandToQuad" {
227
227
  */
228
228
  export default function shorthandToQuad(x1: number, y1: number, qx: number, qy: number, prevCommand: string): Object;
229
229
  }
230
- declare module "src/process/shorthandToCubic" {
230
+ declare module "process/shorthandToCubic" {
231
231
  /**
232
232
  * Returns the missing control point from an
233
233
  * S (shorthand cubic bezier) segment.
@@ -241,7 +241,7 @@ declare module "src/process/shorthandToCubic" {
241
241
  */
242
242
  export default function shorthandToCubic(x1: number, y1: number, x2: number, y2: number, prevCommand: string): Object;
243
243
  }
244
- declare module "src/process/normalizeSegment" {
244
+ declare module "process/normalizeSegment" {
245
245
  /**
246
246
  * Normalizes a single segment of a `pathArray` object.
247
247
  *
@@ -250,9 +250,9 @@ declare module "src/process/normalizeSegment" {
250
250
  * @param {String} prevCommand the path command of the previous segment
251
251
  * @returns {SVGPC.pathSegment} the normalized segment
252
252
  */
253
- export default function normalizeSegment(segment: import("types/types").pathSegment, params: Object, prevCommand: string): import("types/types").pathSegment;
253
+ export default function normalizeSegment(segment: SVGPC.pathSegment, params: Object, prevCommand: string): SVGPC.pathSegment;
254
254
  }
255
- declare module "src/util/isNormalizedArray" {
255
+ declare module "util/isNormalizedArray" {
256
256
  /**
257
257
  * Iterates an array to check if it's a `pathArray`
258
258
  * with all segments are in non-shorthand notation
@@ -261,9 +261,9 @@ declare module "src/util/isNormalizedArray" {
261
261
  * @param {SVGPC.pathArray} path the `pathArray` to be checked
262
262
  * @returns {boolean} iteration result
263
263
  */
264
- export default function isNormalizedArray(path: import("types/types").pathArray): boolean;
264
+ export default function isNormalizedArray(path: SVGPC.pathArray): boolean;
265
265
  }
266
- declare module "src/process/normalizePath" {
266
+ declare module "process/normalizePath" {
267
267
  /**
268
268
  * Normalizes a `path` object for further processing:
269
269
  * * convert segments to absolute values
@@ -272,9 +272,9 @@ declare module "src/process/normalizePath" {
272
272
  * @param {String | SVGPC.pathArray} pathInput the string to be parsed or 'pathArray'
273
273
  * @returns {SVGPC.pathArray} the normalized `pathArray`
274
274
  */
275
- export default function normalizePath(pathInput: string | import("types/types").pathArray): import("types/types").pathArray;
275
+ export default function normalizePath(pathInput: string | SVGPC.pathArray): SVGPC.pathArray;
276
276
  }
277
- declare module "src/math/rotateVector" {
277
+ declare module "math/rotateVector" {
278
278
  /**
279
279
  * Returns an {x,y} vector rotated by a given
280
280
  * angle in radian.
@@ -288,7 +288,7 @@ declare module "src/math/rotateVector" {
288
288
  y: number;
289
289
  };
290
290
  }
291
- declare module "src/process/arcToCubic" {
291
+ declare module "process/arcToCubic" {
292
292
  /**
293
293
  * Converts A (arc-to) segments to C (cubic-bezier-to).
294
294
  *
@@ -309,7 +309,7 @@ declare module "src/process/arcToCubic" {
309
309
  */
310
310
  export default function arcToCubic(x1: number, y1: number, rx: number, ry: number, angle: number, LAF: number, SF: number, x2: number, y2: number, recursive: number[] | null): number[] | number[][];
311
311
  }
312
- declare module "src/process/quadToCubic" {
312
+ declare module "process/quadToCubic" {
313
313
  /**
314
314
  * Converts a Q (quadratic-bezier) segment to C (cubic-bezier).
315
315
  *
@@ -323,7 +323,7 @@ declare module "src/process/quadToCubic" {
323
323
  */
324
324
  export default function quadToCubic(x1: number, y1: number, qx: number, qy: number, x2: number, y2: number): number[];
325
325
  }
326
- declare module "src/util/getPointAtSegLength" {
326
+ declare module "util/getPointAtSegLength" {
327
327
  /**
328
328
  * Returns the {x,y} coordinates of a point at a
329
329
  * given length of a cubic-bezier segment.
@@ -344,7 +344,7 @@ declare module "src/util/getPointAtSegLength" {
344
344
  y: number;
345
345
  };
346
346
  }
347
- declare module "src/math/midPoint" {
347
+ declare module "math/midPoint" {
348
348
  /**
349
349
  * Returns the coordinates of a specified distance
350
350
  * ratio between two points.
@@ -356,7 +356,7 @@ declare module "src/math/midPoint" {
356
356
  */
357
357
  export default function midPoint(a: number[], b: number[], t: number): number[];
358
358
  }
359
- declare module "src/process/lineToCubic" {
359
+ declare module "process/lineToCubic" {
360
360
  /**
361
361
  * Converts an L (line-to) segment to C (cubic-bezier).
362
362
  *
@@ -368,7 +368,7 @@ declare module "src/process/lineToCubic" {
368
368
  */
369
369
  export default function lineToCubic(x1: number, y1: number, x2: number, y2: number): number[];
370
370
  }
371
- declare module "src/process/segmentToCubic" {
371
+ declare module "process/segmentToCubic" {
372
372
  /**
373
373
  * Converts any segment to C (cubic-bezier).
374
374
  *
@@ -376,11 +376,11 @@ declare module "src/process/segmentToCubic" {
376
376
  * @param {Object.<string, number>} params the source segment parameters
377
377
  * @returns {SVGPC.pathSegment} the cubic-bezier segment
378
378
  */
379
- export default function segmentToCubic(segment: import("types/types").pathSegment, params: {
379
+ export default function segmentToCubic(segment: SVGPC.pathSegment, params: {
380
380
  [x: string]: number;
381
- }): import("types/types").pathSegment;
381
+ }): SVGPC.pathSegment;
382
382
  }
383
- declare module "src/convert/pathToCurve" {
383
+ declare module "convert/pathToCurve" {
384
384
  /**
385
385
  * Parses a path string value or 'pathArray' and returns a new one
386
386
  * in which all segments are converted to cubic-bezier.
@@ -388,9 +388,9 @@ declare module "src/convert/pathToCurve" {
388
388
  * @param {String | SVGPC.pathArray} pathInput the string to be parsed or object
389
389
  * @returns {SVGPC.pathArray} the resulted `pathArray` converted to cubic-bezier
390
390
  */
391
- export default function pathToCurve(pathInput: string | import("types/types").pathArray): import("types/types").pathArray;
391
+ export default function pathToCurve(pathInput: string | SVGPC.pathArray): SVGPC.pathArray;
392
392
  }
393
- declare module "src/util/getPathArea" {
393
+ declare module "util/getPathArea" {
394
394
  /**
395
395
  * Returns the area of a shape.
396
396
  * @author Jürg Lehni & Jonathan Puckey
@@ -400,9 +400,9 @@ declare module "src/util/getPathArea" {
400
400
  * @param {SVGPC.pathArray} path the shape `pathArray`
401
401
  * @returns {SVGPC.pathBBox} the length of the cubic-bezier segment
402
402
  */
403
- export default function getPathArea(path: import("types/types").pathArray): SVGPC.pathBBox;
403
+ export default function getPathArea(path: SVGPC.pathArray): SVGPC.pathBBox;
404
404
  }
405
- declare module "src/util/getSegCubicLength" {
405
+ declare module "util/getSegCubicLength" {
406
406
  /**
407
407
  * Returns the C (cubic-bezier) segment length.
408
408
  *
@@ -419,7 +419,7 @@ declare module "src/util/getSegCubicLength" {
419
419
  */
420
420
  export default function getSegCubicLength(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number, z: number): number;
421
421
  }
422
- declare module "src/util/getPathLength" {
422
+ declare module "util/getPathLength" {
423
423
  /**
424
424
  * Returns the shape total length,
425
425
  * or the equivalent to `shape.getTotalLength()`
@@ -428,9 +428,9 @@ declare module "src/util/getPathLength" {
428
428
  * @param {SVGPC.pathArray} path the ending point Y
429
429
  * @returns {Number} the shape total length
430
430
  */
431
- export default function getPathLength(path: import("types/types").pathArray): number;
431
+ export default function getPathLength(path: SVGPC.pathArray): number;
432
432
  }
433
- declare module "src/util/getDrawDirection" {
433
+ declare module "util/getDrawDirection" {
434
434
  /**
435
435
  * Check if a path is drawn clockwise and returns true if so,
436
436
  * false otherwise.
@@ -438,9 +438,9 @@ declare module "src/util/getDrawDirection" {
438
438
  * @param {string | SVGPC.pathArray} path the path string or `pathArray`
439
439
  * @returns {boolean} true when clockwise or false if not
440
440
  */
441
- export default function getDrawDirection(path: string | import("types/types").pathArray): boolean;
441
+ export default function getDrawDirection(path: string | SVGPC.pathArray): boolean;
442
442
  }
443
- declare module "src/util/getPointAtLength" {
443
+ declare module "util/getPointAtLength" {
444
444
  /**
445
445
  * Returns [x,y] coordinates of a point at a given length of a shape.
446
446
  *
@@ -448,9 +448,9 @@ declare module "src/util/getPointAtLength" {
448
448
  * @param {Number} length the length of the shape to look at
449
449
  * @returns {Number[]} the requested [x,y] coordinates
450
450
  */
451
- export default function getPointAtLength(path: string | import("types/types").pathArray, length: number): number[];
451
+ export default function getPointAtLength(path: string | SVGPC.pathArray, length: number): number[];
452
452
  }
453
- declare module "src/util/getCubicSize" {
453
+ declare module "util/getCubicSize" {
454
454
  /**
455
455
  * Returns the cubic-bezier segment length.
456
456
  *
@@ -466,16 +466,16 @@ declare module "src/util/getCubicSize" {
466
466
  */
467
467
  export default function getCubicSize(p1x: number, p1y: number, c1x: number, c1y: number, c2x: number, c2y: number, p2x: number, p2y: number): SVGPC.segmentLimits;
468
468
  }
469
- declare module "src/util/getPathBBox" {
469
+ declare module "util/getPathBBox" {
470
470
  /**
471
471
  * Returns the bounding box of a shape.
472
472
  *
473
473
  * @param {SVGPC.pathArray} path the shape `pathArray`
474
474
  * @returns {SVGPC.pathBBox} the length of the cubic-bezier segment
475
475
  */
476
- export default function getPathBBox(path: import("types/types").pathArray): SVGPC.pathBBox;
476
+ export default function getPathBBox(path: SVGPC.pathArray): SVGPC.pathBBox;
477
477
  }
478
- declare module "src/util/isValidPath" {
478
+ declare module "util/isValidPath" {
479
479
  /**
480
480
  * Parses a path string value to determine its validity
481
481
  * then returns true if it's valid or false otherwise.
@@ -485,7 +485,7 @@ declare module "src/util/isValidPath" {
485
485
  */
486
486
  export default function isValidPath(pathString: string): boolean;
487
487
  }
488
- declare module "src/util/isRelativeArray" {
488
+ declare module "util/isRelativeArray" {
489
489
  /**
490
490
  * Iterates an array to check if it's a `pathArray`
491
491
  * with relative values.
@@ -493,9 +493,9 @@ declare module "src/util/isRelativeArray" {
493
493
  * @param {SVGPC.pathArray} path the `pathArray` to be checked
494
494
  * @returns {boolean} iteration result
495
495
  */
496
- export default function isRelativeArray(path: import("types/types").pathArray): boolean;
496
+ export default function isRelativeArray(path: SVGPC.pathArray): boolean;
497
497
  }
498
- declare module "src/process/roundPath" {
498
+ declare module "process/roundPath" {
499
499
  /**
500
500
  * Rounds the values of a `pathArray` instance to
501
501
  * a specified amount of decimals and returns it.
@@ -504,9 +504,9 @@ declare module "src/process/roundPath" {
504
504
  * @param {Number | null} round the amount of decimals to round numbers to
505
505
  * @returns {SVGPC.pathArray} the resulted `pathArray` with rounded values
506
506
  */
507
- export default function roundPath(path: import("types/types").pathArray, round: number | null): import("types/types").pathArray;
507
+ export default function roundPath(path: SVGPC.pathArray, round: number | null): SVGPC.pathArray;
508
508
  }
509
- declare module "src/convert/pathToString" {
509
+ declare module "convert/pathToString" {
510
510
  /**
511
511
  * Returns a valid `d` attribute string value created
512
512
  * by rounding values and concatenating the `pathArray` segments.
@@ -515,37 +515,37 @@ declare module "src/convert/pathToString" {
515
515
  * @param {Number} round amount of decimals to round values to
516
516
  * @returns {String} the concatenated path string
517
517
  */
518
- export default function pathToString(path: import("types/types").pathArray, round: number): string;
518
+ export default function pathToString(path: SVGPC.pathArray, round: number): string;
519
519
  }
520
- declare module "src/util/shapeToPath" {
520
+ declare module "util/shapeToPath" {
521
521
  /**
522
522
  * Returns a new `pathArray` from line attributes.
523
523
  *
524
524
  * @param {SVGPC.lineAttr} attr shape configuration
525
525
  * @return {SVGPC.pathArray} a new line `pathArray`
526
526
  */
527
- export function getLinePath(attr: SVGPC.lineAttr): import("types/types").pathArray;
527
+ export function getLinePath(attr: SVGPC.lineAttr): SVGPC.pathArray;
528
528
  /**
529
529
  * Returns a new `pathArray` like from polyline/polygon attributes.
530
530
  *
531
531
  * @param {SVGPC.polyAttr} attr shape configuration
532
532
  * @return {SVGPC.pathArray} a new polygon/polyline `pathArray`
533
533
  */
534
- export function getPolyPath(attr: SVGPC.polyAttr): import("types/types").pathArray;
534
+ export function getPolyPath(attr: SVGPC.polyAttr): SVGPC.pathArray;
535
535
  /**
536
536
  * Returns a new `pathArray` from circle/ellipse attributes.
537
537
  *
538
538
  * @param {SVGPC.ellipseAttr | SVGPC.circleAttr} attr shape configuration
539
539
  * @return {SVGPC.pathArray} a circle/ellipse `pathArray`
540
540
  */
541
- export function getEllipsePath(attr: SVGPC.ellipseAttr | SVGPC.circleAttr): import("types/types").pathArray;
541
+ export function getEllipsePath(attr: SVGPC.ellipseAttr | SVGPC.circleAttr): SVGPC.pathArray;
542
542
  /**
543
543
  * Returns a new `pathArray` like from rect attributes.
544
544
  *
545
545
  * @param {SVGPC.rectAttr} attr object with properties above
546
546
  * @return {SVGPC.pathArray} a new `pathArray` from `<rect>` attributes
547
547
  */
548
- export function getRectanglePath(attr: SVGPC.rectAttr): import("types/types").pathArray;
548
+ export function getRectanglePath(attr: SVGPC.rectAttr): SVGPC.pathArray;
549
549
  /**
550
550
  * Returns a new `<path>` element created from attributes of a `<line>`, `<polyline>`,
551
551
  * `<polygon>`, `<rect>`, `<ellipse>`, `<circle>` or `<glyph>`. If `replace` parameter
@@ -560,7 +560,7 @@ declare module "src/util/shapeToPath" {
560
560
  */
561
561
  export default function shapeToPath(element: SVGPC.shapeTypes, replace: boolean): SVGPathElement | null;
562
562
  }
563
- declare module "src/process/splitPath" {
563
+ declare module "process/splitPath" {
564
564
  /**
565
565
  * Split a path into an `Array` of sub-path strings.
566
566
  *
@@ -572,7 +572,7 @@ declare module "src/process/splitPath" {
572
572
  */
573
573
  export default function splitPath(pathInput: Object | string): Object;
574
574
  }
575
- declare module "src/convert/pathToRelative" {
575
+ declare module "convert/pathToRelative" {
576
576
  /**
577
577
  * Parses a path string value or object and returns an array
578
578
  * of segments, all converted to relative values.
@@ -580,9 +580,9 @@ declare module "src/convert/pathToRelative" {
580
580
  * @param {string | SVGPC.pathArray} pathInput the path string | object
581
581
  * @returns {SVGPC.pathArray} the resulted `pathArray` with relative values
582
582
  */
583
- export default function pathToRelative(pathInput: string | import("types/types").pathArray): import("types/types").pathArray;
583
+ export default function pathToRelative(pathInput: string | SVGPC.pathArray): SVGPC.pathArray;
584
584
  }
585
- declare module "src/process/optimizePath" {
585
+ declare module "process/optimizePath" {
586
586
  /**
587
587
  * Optimizes a `pathArray` object:
588
588
  * * convert segments to absolute and relative values
@@ -593,9 +593,9 @@ declare module "src/process/optimizePath" {
593
593
  * @param {number} round the amount of decimals to round values to
594
594
  * @returns {SVGPC.pathArray} the optimized `pathArray`
595
595
  */
596
- export default function optimizePath(pathInput: string | import("types/types").pathArray, round: number): import("types/types").pathArray;
596
+ export default function optimizePath(pathInput: string | SVGPC.pathArray, round: number): SVGPC.pathArray;
597
597
  }
598
- declare module "src/process/reverseCurve" {
598
+ declare module "process/reverseCurve" {
599
599
  /**
600
600
  * Reverses all segments and their values from a `pathArray`
601
601
  * which consists of only C (cubic-bezier) path commands.
@@ -603,9 +603,9 @@ declare module "src/process/reverseCurve" {
603
603
  * @param {SVGPC.pathArray} path the source `pathArray`
604
604
  * @returns {SVGPC.pathArray} the reversed `pathArray`
605
605
  */
606
- export default function reverseCurve(path: import("types/types").pathArray): import("types/types").pathArray;
606
+ export default function reverseCurve(path: SVGPC.pathArray): SVGPC.pathArray;
607
607
  }
608
- declare module "src/process/reversePath" {
608
+ declare module "process/reversePath" {
609
609
  /**
610
610
  * Reverses all segments and their values of a `pathArray`
611
611
  * and returns a new instance.
@@ -613,9 +613,9 @@ declare module "src/process/reversePath" {
613
613
  * @param {SVGPC.pathArray} pathInput the source `pathArray`
614
614
  * @returns {SVGPC.pathArray} the reversed `pathArray`
615
615
  */
616
- export default function reversePath(pathInput: import("types/types").pathArray): import("types/types").pathArray;
616
+ export default function reversePath(pathInput: SVGPC.pathArray): SVGPC.pathArray;
617
617
  }
618
- declare module "src/math/epsilon" {
618
+ declare module "math/epsilon" {
619
619
  export default epsilon;
620
620
  /**
621
621
  * A global namespace for epsilon.
@@ -624,7 +624,7 @@ declare module "src/math/epsilon" {
624
624
  */
625
625
  const epsilon: number;
626
626
  }
627
- declare module "src/process/getSVGMatrix" {
627
+ declare module "process/getSVGMatrix" {
628
628
  /**
629
629
  * Returns a transformation matrix to apply to `<path>` elements.
630
630
  *
@@ -634,7 +634,7 @@ declare module "src/process/getSVGMatrix" {
634
634
  export default function getSVGMatrix(transform: SVGPC.transformObject): CSSMatrix;
635
635
  import CSSMatrix from "dommatrix";
636
636
  }
637
- declare module "src/process/transformEllipse" {
637
+ declare module "process/transformEllipse" {
638
638
  /**
639
639
  * Apply a 2D transformation matrix to an ellipse.
640
640
  *
@@ -649,7 +649,7 @@ declare module "src/process/transformEllipse" {
649
649
  ax: number;
650
650
  };
651
651
  }
652
- declare module "src/process/projection2d" {
652
+ declare module "process/projection2d" {
653
653
  /**
654
654
  * Returns the [x,y] projected coordinates for a given an [x,y] point
655
655
  * and an [x,y,z] perspective origin point.
@@ -665,7 +665,7 @@ declare module "src/process/projection2d" {
665
665
  */
666
666
  export default function projection2d(m: number[], point2D: number[], origin: any): number[];
667
667
  }
668
- declare module "src/process/transformPath" {
668
+ declare module "process/transformPath" {
669
669
  /**
670
670
  * Apply a 2D / 3D transformation to a `pathArray` instance.
671
671
  *
@@ -676,9 +676,9 @@ declare module "src/process/transformPath" {
676
676
  * @param {SVGPC.transformObject} transform the transform functions `Object`
677
677
  * @returns {SVGPC.pathArray} the resulted `pathArray`
678
678
  */
679
- export default function transformPath(path: import("types/types").pathArray, transform: SVGPC.transformObject): import("types/types").pathArray;
679
+ export default function transformPath(path: SVGPC.pathArray, transform: SVGPC.transformObject): SVGPC.pathArray;
680
680
  }
681
- declare module "src/class/version" {
681
+ declare module "util/version" {
682
682
  export default Version;
683
683
  /**
684
684
  * A global namespace for library version.
@@ -686,7 +686,7 @@ declare module "src/class/version" {
686
686
  */
687
687
  const Version: string;
688
688
  }
689
- declare module "src/util/util" {
689
+ declare module "util/util" {
690
690
  export default Util;
691
691
  namespace Util {
692
692
  export { CSSMatrix };
@@ -720,36 +720,36 @@ declare module "src/util/util" {
720
720
  export { Version };
721
721
  }
722
722
  import CSSMatrix from "dommatrix";
723
- import parsePathString from "src/parser/parsePathString";
724
- import isPathArray from "src/util/isPathArray";
725
- import isCurveArray from "src/util/isCurveArray";
726
- import isAbsoluteArray from "src/util/isAbsoluteArray";
727
- import isRelativeArray from "src/util/isRelativeArray";
728
- import isNormalizedArray from "src/util/isNormalizedArray";
729
- import isValidPath from "src/util/isValidPath";
730
- import pathToAbsolute from "src/convert/pathToAbsolute";
731
- import pathToRelative from "src/convert/pathToRelative";
732
- import pathToCurve from "src/convert/pathToCurve";
733
- import pathToString from "src/convert/pathToString";
734
- import getDrawDirection from "src/util/getDrawDirection";
735
- import getPathArea from "src/util/getPathArea";
736
- import getPathBBox from "src/util/getPathBBox";
737
- import getPathLength from "src/util/getPathLength";
738
- import getPointAtLength from "src/util/getPointAtLength";
739
- import clonePath from "src/process/clonePath";
740
- import splitPath from "src/process/splitPath";
741
- import roundPath from "src/process/roundPath";
742
- import optimizePath from "src/process/optimizePath";
743
- import reverseCurve from "src/process/reverseCurve";
744
- import reversePath from "src/process/reversePath";
745
- import normalizePath from "src/process/normalizePath";
746
- import transformPath from "src/process/transformPath";
747
- import getSVGMatrix from "src/process/getSVGMatrix";
748
- import shapeToPath from "src/util/shapeToPath";
749
- import SVGPCO from "src/options/options";
750
- import Version from "src/class/version";
751
- }
752
- declare module "src/class/svg-path-commander" {
723
+ import parsePathString from "parser/parsePathString";
724
+ import isPathArray from "util/isPathArray";
725
+ import isCurveArray from "util/isCurveArray";
726
+ import isAbsoluteArray from "util/isAbsoluteArray";
727
+ import isRelativeArray from "util/isRelativeArray";
728
+ import isNormalizedArray from "util/isNormalizedArray";
729
+ import isValidPath from "util/isValidPath";
730
+ import pathToAbsolute from "convert/pathToAbsolute";
731
+ import pathToRelative from "convert/pathToRelative";
732
+ import pathToCurve from "convert/pathToCurve";
733
+ import pathToString from "convert/pathToString";
734
+ import getDrawDirection from "util/getDrawDirection";
735
+ import getPathArea from "util/getPathArea";
736
+ import getPathBBox from "util/getPathBBox";
737
+ import getPathLength from "util/getPathLength";
738
+ import getPointAtLength from "util/getPointAtLength";
739
+ import clonePath from "process/clonePath";
740
+ import splitPath from "process/splitPath";
741
+ import roundPath from "process/roundPath";
742
+ import optimizePath from "process/optimizePath";
743
+ import reverseCurve from "process/reverseCurve";
744
+ import reversePath from "process/reversePath";
745
+ import normalizePath from "process/normalizePath";
746
+ import transformPath from "process/transformPath";
747
+ import getSVGMatrix from "process/getSVGMatrix";
748
+ import shapeToPath from "util/shapeToPath";
749
+ import SVGPCO from "options/options";
750
+ import Version from "util/version";
751
+ }
752
+ declare module "svg-path-commander" {
753
753
  /**
754
754
  * Creates a new SVGPathCommander instance.
755
755
  *
@@ -764,7 +764,7 @@ declare module "src/class/svg-path-commander" {
764
764
  /** @type {number | boolean | undefined} */
765
765
  round: number | boolean | undefined;
766
766
  /** @type {SVGPC.pathArray} */
767
- segments: import("types/types").pathArray;
767
+ segments: SVGPC.pathArray;
768
768
  /** * @type {string} */
769
769
  pathValue: string;
770
770
  /**
@@ -825,15 +825,11 @@ declare module "src/class/svg-path-commander" {
825
825
  public toString(): string;
826
826
  }
827
827
  }
828
- declare module "src/index" {
828
+ declare module "index" {
829
829
  export default SVGPathCommander;
830
- /**
831
- * shows types in src/ sources
832
- */
833
- export type SVGPC = typeof import("types/types");
834
- import SVGPathCommander from "src/class/svg-path-commander";
830
+ import SVGPathCommander from "svg-path-commander";
835
831
  }
836
- declare module "src/math/distanceSquareRoot" {
832
+ declare module "math/distanceSquareRoot" {
837
833
  /**
838
834
  * Returns the square root of the distance
839
835
  * between two given points.
@@ -844,7 +840,7 @@ declare module "src/math/distanceSquareRoot" {
844
840
  */
845
841
  export default function distanceSquareRoot(a: number[][], b: number[][]): number;
846
842
  }
847
- declare module "src/math/polygonArea" {
843
+ declare module "math/polygonArea" {
848
844
  /**
849
845
  * d3-polygon-area
850
846
  * https://github.com/d3/d3-polygon
@@ -856,7 +852,7 @@ declare module "src/math/polygonArea" {
856
852
  */
857
853
  export default function polygonArea(polygon: number[][]): number;
858
854
  }
859
- declare module "src/math/polygonLength" {
855
+ declare module "math/polygonLength" {
860
856
  /**
861
857
  * d3-polygon-length
862
858
  * https://github.com/d3/d3-polygon
@@ -868,7 +864,7 @@ declare module "src/math/polygonLength" {
868
864
  */
869
865
  export default function polygonLength(polygon: number[][]): number;
870
866
  }
871
- declare module "src/process/splitCubic" {
867
+ declare module "process/splitCubic" {
872
868
  /**
873
869
  * Split a cubic-bezier segment into two.
874
870
  *
@@ -877,7 +873,7 @@ declare module "src/process/splitCubic" {
877
873
  */
878
874
  export default function splitCubic(pts: number[]): Object;
879
875
  }
880
- declare module "src/util/createPath" {
876
+ declare module "util/createPath" {
881
877
  /**
882
878
  * Returns a new `<path>` from a `<glyph>` element, only using its `d` attribute,
883
879
  * all other attributes are ignored.
@@ -892,7 +888,7 @@ declare module "src/util/createPath" {
892
888
  */
893
889
  export default function createPath(pathInput: SVGElement | string): SVGPathElement;
894
890
  }
895
- declare module "src/util/getSegArcLength" {
891
+ declare module "util/getSegArcLength" {
896
892
  /**
897
893
  * Returns the A (arc-to) segment length.
898
894
  *
@@ -901,7 +897,7 @@ declare module "src/util/getSegArcLength" {
901
897
  */
902
898
  export default function getSegArcLength(...args: any[]): number;
903
899
  }
904
- declare module "src/util/getSegLineLength" {
900
+ declare module "util/getSegLineLength" {
905
901
  /**
906
902
  * Returns the L (line-to) segment length.
907
903
  *
@@ -913,7 +909,7 @@ declare module "src/util/getSegLineLength" {
913
909
  */
914
910
  export default function getSegLineLength(ax: number, ay: number, bx: number, by: number): number;
915
911
  }
916
- declare module "src/util/getSegQuadLength" {
912
+ declare module "util/getSegQuadLength" {
917
913
  /**
918
914
  * Returns the Q (quadratic-bezier) segment length.
919
915
  * https://gist.github.com/tunght13488/6744e77c242cc7a94859#gistcomment-2047251