Socket
Socket
Sign inDemoInstall

svg-pathdata

Package Overview
Dependencies
Maintainers
3
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svg-pathdata - npm Package Compare versions

Comparing version 5.0.2 to 5.0.3

4

CHANGELOG.md

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

## [5.0.3](https://github.com/nfroidure/svg-pathdata/compare/v4.0.0...v5.0.3) (2020-02-04)
<a name="5.0.2"></a>

@@ -2,0 +6,0 @@ ## [5.0.2](https://github.com/nfroidure/svg-pathdata/compare/v5.0.1...v5.0.2) (2018-06-05)

2

lib/mathUtils.d.ts

@@ -22,3 +22,3 @@ import { CommandA, CommandC } from "./types";

*/
export declare function intersectionUnitCircleLine(a: number, b: number, c: number): Array<[number, number]>;
export declare function intersectionUnitCircleLine(a: number, b: number, c: number): [number, number][];
export declare const DEG: number;

@@ -25,0 +25,0 @@ export declare function lerp(a: number, b: number, t: number): number;

@@ -1,2 +0,16 @@

!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(t.svgpathdata={})}(this,function(t){"use strict";var r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])};function e(t,e){function a(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(a.prototype=e.prototype,new a)}function a(t,r){var e=t[0],a=t[1];return[e*Math.cos(r)-a*Math.sin(r),e*Math.sin(r)+a*Math.cos(r)]}function n(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var e=0;e<t.length;e++)if("number"!=typeof t[e])throw new Error("assertNumbers arguments["+e+"] is not a number. "+typeof t[e]+" == typeof "+t[e]);return!0}var i=Math.PI;function o(t,r,e){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;var n=t.rX,o=t.rY,s=t.x,u=t.y;n=Math.abs(t.rX),o=Math.abs(t.rY);var h=a([(r-s)/2,(e-u)/2],-t.xRot/180*i),c=h[0],m=h[1],y=Math.pow(c,2)/Math.pow(n,2)+Math.pow(m,2)/Math.pow(o,2);1<y&&(n*=Math.sqrt(y),o*=Math.sqrt(y)),t.rX=n,t.rY=o;var p=Math.pow(n,2)*Math.pow(m,2)+Math.pow(o,2)*Math.pow(c,2),T=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(n,2)*Math.pow(o,2)-p)/p)),O=n*m/o*T,_=-o*c/n*T,f=a([O,_],t.xRot/180*i);t.cX=f[0]+(r+s)/2,t.cY=f[1]+(e+u)/2,t.phi1=Math.atan2((m-_)/o,(c-O)/n),t.phi2=Math.atan2((-m-_)/o,(-c-O)/n),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*i),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*i),t.phi1*=180/i,t.phi2*=180/i}function s(t,r,e){n(t,r,e);var a=t*t+r*r-e*e;if(0>a)return[];if(0===a)return[[t*e/(t*t+r*r),r*e/(t*t+r*r)]];var i=Math.sqrt(a);return[[(t*e+r*i)/(t*t+r*r),(r*e-t*i)/(t*t+r*r)],[(t*e-r*i)/(t*t+r*r),(r*e+t*i)/(t*t+r*r)]]}var u=Math.PI/180;function h(t,r,e){return(1-e)*t+e*r}function c(t,r,e,a){return t+Math.cos(a/180*i)*r+Math.sin(a/180*i)*e}function m(t,r,e,a){var n=r-t,i=e-r,o=3*n+3*(a-e)-6*i,s=6*(i-n),u=3*n;return Math.abs(o)<1e-6?[-u/s]:function(t,r,e){void 0===e&&(e=1e-6);var a=t*t/4-r;if(a<-e)return[];if(a<=e)return[-t/2];var n=Math.sqrt(a);return[-t/2-n,-t/2+n]}(s/o,u/o,1e-6)}function y(t,r,e,a,n){var i=1-n;return t*(i*i*i)+r*(3*i*i*n)+e*(3*i*n*n)+a*(n*n*n)}!function(t){function r(){return p(function(t,r,e){return t.relative&&(void 0!==t.x1&&(t.x1+=r),void 0!==t.y1&&(t.y1+=e),void 0!==t.x2&&(t.x2+=r),void 0!==t.y2&&(t.y2+=e),void 0!==t.x&&(t.x+=r),void 0!==t.y&&(t.y+=e),t.relative=!1),t})}function e(){var t=NaN,r=NaN,e=NaN,a=NaN;return p(function(n,i,o){return n.type&l.SMOOTH_CURVE_TO&&(n.type=l.CURVE_TO,t=isNaN(t)?i:t,r=isNaN(r)?o:r,n.x1=n.relative?i-t:2*i-t,n.y1=n.relative?o-r:2*o-r),n.type&l.CURVE_TO?(t=n.relative?i+n.x2:n.x2,r=n.relative?o+n.y2:n.y2):(t=NaN,r=NaN),n.type&l.SMOOTH_QUAD_TO&&(n.type=l.QUAD_TO,e=isNaN(e)?i:e,a=isNaN(a)?o:a,n.x1=n.relative?i-e:2*i-e,n.y1=n.relative?o-a:2*o-a),n.type&l.QUAD_TO?(e=n.relative?i+n.x1:n.x1,a=n.relative?o+n.y1:n.y1):(e=NaN,a=NaN),n})}function i(){var t=NaN,r=NaN;return p(function(e,a,n){if(e.type&l.SMOOTH_QUAD_TO&&(e.type=l.QUAD_TO,t=isNaN(t)?a:t,r=isNaN(r)?n:r,e.x1=e.relative?a-t:2*a-t,e.y1=e.relative?n-r:2*n-r),e.type&l.QUAD_TO){t=e.relative?a+e.x1:e.x1,r=e.relative?n+e.y1:e.y1;var i=e.x1,o=e.y1;e.type=l.CURVE_TO,e.x1=((e.relative?0:a)+2*i)/3,e.y1=((e.relative?0:n)+2*o)/3,e.x2=(e.x+2*i)/3,e.y2=(e.y+2*o)/3}else t=NaN,r=NaN;return e})}function p(t){var r=0,e=0,a=NaN,n=NaN;return function(i){if(isNaN(a)&&!(i.type&l.MOVE_TO))throw new Error("path must start with moveto");var o=t(i,r,e,a,n);return i.type&l.CLOSE_PATH&&(r=a,e=n),void 0!==i.x&&(r=i.relative?r+i.x:i.x),void 0!==i.y&&(e=i.relative?e+i.y:i.y),i.type&l.MOVE_TO&&(a=r,n=e),o}}function T(t,r,e,a,i,o){return n(t,r,e,a,i,o),p(function(n,s,u,h){var c=n.x1,m=n.x2,y=n.relative&&!isNaN(h),p=void 0!==n.x?n.x:y?0:s,T=void 0!==n.y?n.y:y?0:u;function O(t){return t*t}n.type&l.HORIZ_LINE_TO&&0!==r&&(n.type=l.LINE_TO,n.y=n.relative?0:u),n.type&l.VERT_LINE_TO&&0!==e&&(n.type=l.LINE_TO,n.x=n.relative?0:s),void 0!==n.x&&(n.x=n.x*t+T*e+(y?0:i)),void 0!==n.y&&(n.y=p*r+n.y*a+(y?0:o)),void 0!==n.x1&&(n.x1=n.x1*t+n.y1*e+(y?0:i)),void 0!==n.y1&&(n.y1=c*r+n.y1*a+(y?0:o)),void 0!==n.x2&&(n.x2=n.x2*t+n.y2*e+(y?0:i)),void 0!==n.y2&&(n.y2=m*r+n.y2*a+(y?0:o));var _=t*a-r*e;if(void 0!==n.xRot&&(1!==t||0!==r||0!==e||1!==a))if(0===_)delete n.rX,delete n.rY,delete n.xRot,delete n.lArcFlag,delete n.sweepFlag,n.type=l.LINE_TO;else{var f=n.xRot*Math.PI/180,v=Math.sin(f),N=Math.cos(f),E=1/O(n.rX),d=1/O(n.rY),A=O(N)*E+O(v)*d,x=2*v*N*(E-d),C=O(v)*E+O(N)*d,M=A*a*a-x*r*a+C*r*r,R=x*(t*a+r*e)-2*(A*e*a+C*t*r),S=A*e*e-x*t*e+C*t*t,I=(Math.atan2(R,M-S)+Math.PI)%Math.PI/2,g=Math.sin(I),V=Math.cos(I);n.rX=Math.abs(_)/Math.sqrt(M*O(V)+R*g*V+S*O(g)),n.rY=Math.abs(_)/Math.sqrt(M*O(g)-R*g*V+S*O(V)),n.xRot=180*I/Math.PI}return void 0!==n.sweepFlag&&0>_&&(n.sweepFlag=+!n.sweepFlag),n})}function O(){return function(t){var r={};for(var e in t)r[e]=t[e];return r}}t.ROUND=function(t){function r(r){return Math.round(r*t)/t}return void 0===t&&(t=1e13),n(t),function(t){return void 0!==t.x1&&(t.x1=r(t.x1)),void 0!==t.y1&&(t.y1=r(t.y1)),void 0!==t.x2&&(t.x2=r(t.x2)),void 0!==t.y2&&(t.y2=r(t.y2)),void 0!==t.x&&(t.x=r(t.x)),void 0!==t.y&&(t.y=r(t.y)),t}},t.TO_ABS=r,t.TO_REL=function(){return p(function(t,r,e){return t.relative||(void 0!==t.x1&&(t.x1-=r),void 0!==t.y1&&(t.y1-=e),void 0!==t.x2&&(t.x2-=r),void 0!==t.y2&&(t.y2-=e),void 0!==t.x&&(t.x-=r),void 0!==t.y&&(t.y-=e),t.relative=!0),t})},t.NORMALIZE_HVZ=function(t,r,e){return void 0===t&&(t=!0),void 0===r&&(r=!0),void 0===e&&(e=!0),p(function(a,n,i,o,s){if(isNaN(o)&&!(a.type&l.MOVE_TO))throw new Error("path must start with moveto");return r&&a.type&l.HORIZ_LINE_TO&&(a.type=l.LINE_TO,a.y=a.relative?0:i),e&&a.type&l.VERT_LINE_TO&&(a.type=l.LINE_TO,a.x=a.relative?0:n),t&&a.type&l.CLOSE_PATH&&(a.type=l.LINE_TO,a.x=a.relative?o-n:o,a.y=a.relative?s-i:s),a.type&l.ARC&&(0===a.rX||0===a.rY)&&(a.type=l.LINE_TO,delete a.rX,delete a.rY,delete a.xRot,delete a.lArcFlag,delete a.sweepFlag),a})},t.NORMALIZE_ST=e,t.QT_TO_C=i,t.INFO=p,t.SANITIZE=function(t){void 0===t&&(t=0),n(t);var r=NaN,e=NaN,a=NaN,i=NaN;return p(function(n,o,s,u,h){var c=Math.abs,m=!1,y=0,p=0;if(n.type&l.SMOOTH_CURVE_TO&&(y=isNaN(r)?0:o-r,p=isNaN(e)?0:s-e),n.type&(l.CURVE_TO|l.SMOOTH_CURVE_TO)?(r=n.relative?o+n.x2:n.x2,e=n.relative?s+n.y2:n.y2):(r=NaN,e=NaN),n.type&l.SMOOTH_QUAD_TO?(a=isNaN(a)?o:2*o-a,i=isNaN(i)?s:2*s-i):n.type&l.QUAD_TO?(a=n.relative?o+n.x1:n.x1,i=n.relative?s+n.y1:n.y2):(a=NaN,i=NaN),n.type&l.LINE_COMMANDS||n.type&l.ARC&&(0===n.rX||0===n.rY||!n.lArcFlag)||n.type&l.CURVE_TO||n.type&l.SMOOTH_CURVE_TO||n.type&l.QUAD_TO||n.type&l.SMOOTH_QUAD_TO){var T=void 0===n.x?0:n.relative?n.x:n.x-o,O=void 0===n.y?0:n.relative?n.y:n.y-s;y=isNaN(a)?void 0===n.x1?y:n.relative?n.x:n.x1-o:a-o,p=isNaN(i)?void 0===n.y1?p:n.relative?n.y:n.y1-s:i-s;var _=void 0===n.x2?0:n.relative?n.x:n.x2-o,f=void 0===n.y2?0:n.relative?n.y:n.y2-s;c(T)<=t&&c(O)<=t&&c(y)<=t&&c(p)<=t&&c(_)<=t&&c(f)<=t&&(m=!0)}return n.type&l.CLOSE_PATH&&c(o-u)<=t&&c(s-h)<=t&&(m=!0),m?[]:n})},t.MATRIX=T,t.ROTATE=function(t,r,e){void 0===r&&(r=0),void 0===e&&(e=0),n(t,r,e);var a=Math.sin(t),i=Math.cos(t);return T(i,a,-a,i,r-r*i+e*a,e-r*a-e*i)},t.TRANSLATE=function(t,r){return void 0===r&&(r=0),n(t,r),T(1,0,0,1,t,r)},t.SCALE=function(t,r){return void 0===r&&(r=t),n(t,r),T(t,0,0,r,0,0)},t.SKEW_X=function(t){return n(t),T(1,0,Math.atan(t),1,0,0)},t.SKEW_Y=function(t){return n(t),T(1,Math.atan(t),0,1,0,0)},t.X_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),n(t),T(-1,0,0,1,t,0)},t.Y_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),n(t),T(1,0,0,-1,0,t)},t.A_TO_C=function(){return p(function(t,r,e){return l.ARC===t.type?function(t,r,e){var n,i,s,c;t.cX||o(t,r,e);for(var m=Math.min(t.phi1,t.phi2),y=Math.max(t.phi1,t.phi2)-m,p=Math.ceil(y/90),T=new Array(p),O=r,_=e,f=0;f<p;f++){var v=h(t.phi1,t.phi2,f/p),N=h(t.phi1,t.phi2,(f+1)/p),E=N-v,d=4/3*Math.tan(E*u/4),A=[Math.cos(v*u)-d*Math.sin(v*u),Math.sin(v*u)+d*Math.cos(v*u)],x=A[0],C=A[1],M=[Math.cos(N*u),Math.sin(N*u)],R=M[0],S=M[1],I=[R+d*Math.sin(N*u),S-d*Math.cos(N*u)],g=I[0],V=I[1];T[f]={relative:t.relative,type:l.CURVE_TO};var L=function(r,e){var n=a([r*t.rX,e*t.rY],t.xRot),i=n[0],o=n[1];return[t.cX+i,t.cY+o]};n=L(x,C),T[f].x1=n[0],T[f].y1=n[1],i=L(g,V),T[f].x2=i[0],T[f].y2=i[1],s=L(R,S),T[f].x=s[0],T[f].y=s[1],t.relative&&(T[f].x1-=O,T[f].y1-=_,T[f].x2-=O,T[f].y2-=_,T[f].x-=O,T[f].y-=_),O=(c=[T[f].x,T[f].y])[0],_=c[1]}return T}(t,t.relative?0:r,t.relative?0:e):t})},t.ANNOTATE_ARCS=function(){return p(function(t,r,e){return t.relative&&(r=0,e=0),l.ARC===t.type&&o(t,r,e),t})},t.CLONE=O,t.CALCULATE_BOUNDS=function(){var t=function(t){var r={};for(var e in t)r[e]=t[e];return r},a=r(),n=i(),u=e(),h=p(function(r,e,i){var p=u(n(a(t(r))));function T(t){t>h.maxX&&(h.maxX=t),t<h.minX&&(h.minX=t)}function O(t){t>h.maxY&&(h.maxY=t),t<h.minY&&(h.minY=t)}if(p.type&l.DRAWING_COMMANDS&&(T(e),O(i)),p.type&l.HORIZ_LINE_TO&&T(p.x),p.type&l.VERT_LINE_TO&&O(p.y),p.type&l.LINE_TO&&(T(p.x),O(p.y)),p.type&l.CURVE_TO){T(p.x),O(p.y);for(var _=0,f=m(e,p.x1,p.x2,p.x);_<f.length;_++)0<(U=f[_])&&1>U&&T(y(e,p.x1,p.x2,p.x,U));for(var v=0,N=m(i,p.y1,p.y2,p.y);v<N.length;v++)0<(U=N[v])&&1>U&&O(y(i,p.y1,p.y2,p.y,U))}if(p.type&l.ARC){T(p.x),O(p.y),o(p,e,i);for(var E=p.xRot/180*Math.PI,d=Math.cos(E)*p.rX,A=Math.sin(E)*p.rX,x=-Math.sin(E)*p.rY,C=Math.cos(E)*p.rY,M=p.phi1<p.phi2?[p.phi1,p.phi2]:-180>p.phi2?[p.phi2+360,p.phi1+360]:[p.phi2,p.phi1],R=M[0],S=M[1],I=function(t){var r=t[0],e=t[1],a=180*Math.atan2(e,r)/Math.PI;return a<R?a+360:a},g=0,V=s(x,-d,0).map(I);g<V.length;g++)(U=V[g])>R&&U<S&&T(c(p.cX,d,x,U));for(var L=0,D=s(C,-A,0).map(I);L<D.length;L++){var U;(U=D[L])>R&&U<S&&O(c(p.cY,A,C,U))}}return r});return h.minX=1/0,h.maxX=-1/0,h.minY=1/0,h.maxY=-1/0,h}}(t.SVGPathDataTransformer||(t.SVGPathDataTransformer={}));var p,T,O=function(){function r(){}return r.prototype.round=function(r){return this.transform(t.SVGPathDataTransformer.ROUND(r))},r.prototype.toAbs=function(){return this.transform(t.SVGPathDataTransformer.TO_ABS())},r.prototype.toRel=function(){return this.transform(t.SVGPathDataTransformer.TO_REL())},r.prototype.normalizeHVZ=function(r,e,a){return this.transform(t.SVGPathDataTransformer.NORMALIZE_HVZ(r,e,a))},r.prototype.normalizeST=function(){return this.transform(t.SVGPathDataTransformer.NORMALIZE_ST())},r.prototype.qtToC=function(){return this.transform(t.SVGPathDataTransformer.QT_TO_C())},r.prototype.aToC=function(){return this.transform(t.SVGPathDataTransformer.A_TO_C())},r.prototype.sanitize=function(r){return this.transform(t.SVGPathDataTransformer.SANITIZE(r))},r.prototype.translate=function(r,e){return this.transform(t.SVGPathDataTransformer.TRANSLATE(r,e))},r.prototype.scale=function(r,e){return this.transform(t.SVGPathDataTransformer.SCALE(r,e))},r.prototype.rotate=function(r,e,a){return this.transform(t.SVGPathDataTransformer.ROTATE(r,e,a))},r.prototype.matrix=function(r,e,a,n,i,o){return this.transform(t.SVGPathDataTransformer.MATRIX(r,e,a,n,i,o))},r.prototype.skewX=function(r){return this.transform(t.SVGPathDataTransformer.SKEW_X(r))},r.prototype.skewY=function(r){return this.transform(t.SVGPathDataTransformer.SKEW_Y(r))},r.prototype.xSymmetry=function(r){return this.transform(t.SVGPathDataTransformer.X_AXIS_SYMMETRY(r))},r.prototype.ySymmetry=function(r){return this.transform(t.SVGPathDataTransformer.Y_AXIS_SYMMETRY(r))},r.prototype.annotateArcs=function(){return this.transform(t.SVGPathDataTransformer.ANNOTATE_ARCS())},r}(),_=function(t){return" "===t||"\t"===t||"\r"===t||"\n"===t},f=function(t){return"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0)},v=function(t){function r(){var r=t.call(this)||this;return r.curNumber="",r.curCommandType=-1,r.curCommandRelative=!1,r.canParseCommandOrComma=!0,r.curNumberHasExp=!1,r.curNumberHasExpDigits=!1,r.curNumberHasDecimal=!1,r.curArgs=[],r}return e(r,t),r.prototype.finish=function(t){if(void 0===t&&(t=[]),this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t},r.prototype.parse=function(t,r){var e=this;void 0===r&&(r=[]);for(var a=function(t){r.push(t),e.curArgs.length=0,e.canParseCommandOrComma=!0},n=0;n<t.length;n++){var i=t[n];if(f(i))this.curNumber+=i,this.curNumberHasExpDigits=this.curNumberHasExp;else if("e"!==i&&"E"!==i)if("-"!==i&&"+"!==i||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==i||this.curNumberHasExp||this.curNumberHasDecimal){if(this.curNumber&&-1!==this.curCommandType){var o=Number(this.curNumber);if(isNaN(o))throw new SyntaxError("Invalid number ending at "+n);if(this.curCommandType===l.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>o)throw new SyntaxError('Expected positive number, got "'+o+'" at index "'+n+'"')}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+n+'"');this.curArgs.push(o),this.curArgs.length===N[this.curCommandType]&&(l.HORIZ_LINE_TO===this.curCommandType?a({type:l.HORIZ_LINE_TO,relative:this.curCommandRelative,x:o}):l.VERT_LINE_TO===this.curCommandType?a({type:l.VERT_LINE_TO,relative:this.curCommandRelative,y:o}):this.curCommandType===l.MOVE_TO||this.curCommandType===l.LINE_TO||this.curCommandType===l.SMOOTH_QUAD_TO?(a({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),l.MOVE_TO===this.curCommandType&&(this.curCommandType=l.LINE_TO)):this.curCommandType===l.CURVE_TO?a({type:l.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===l.SMOOTH_CURVE_TO?a({type:l.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===l.QUAD_TO?a({type:l.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===l.ARC&&a({type:l.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!_(i))if(","===i&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==i&&"-"!==i&&"."!==i){if(0!==this.curArgs.length)throw new SyntaxError("Unterminated command at index "+n+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+i+'" at index '+n+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,"z"!==i&&"Z"!==i)if("h"===i||"H"===i)this.curCommandType=l.HORIZ_LINE_TO,this.curCommandRelative="h"===i;else if("v"===i||"V"===i)this.curCommandType=l.VERT_LINE_TO,this.curCommandRelative="v"===i;else if("m"===i||"M"===i)this.curCommandType=l.MOVE_TO,this.curCommandRelative="m"===i;else if("l"===i||"L"===i)this.curCommandType=l.LINE_TO,this.curCommandRelative="l"===i;else if("c"===i||"C"===i)this.curCommandType=l.CURVE_TO,this.curCommandRelative="c"===i;else if("s"===i||"S"===i)this.curCommandType=l.SMOOTH_CURVE_TO,this.curCommandRelative="s"===i;else if("q"===i||"Q"===i)this.curCommandType=l.QUAD_TO,this.curCommandRelative="q"===i;else if("t"===i||"T"===i)this.curCommandType=l.SMOOTH_QUAD_TO,this.curCommandRelative="t"===i;else{if("a"!==i&&"A"!==i)throw new SyntaxError('Unexpected character "'+i+'" at index '+n+".");this.curCommandType=l.ARC,this.curCommandRelative="a"===i}else r.push({type:l.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=i,this.curNumberHasDecimal="."===i}else this.curNumber+=i,this.curNumberHasDecimal=!0;else this.curNumber+=i;else this.curNumber+=i,this.curNumberHasExp=!0}return r},r.prototype.transform=function(t){return Object.create(this,{parse:{value:function(r,e){void 0===e&&(e=[]);for(var a=0,n=Object.getPrototypeOf(this).parse.call(this,r);a<n.length;a++){var i=n[a],o=t(i);Array.isArray(o)?e.push.apply(e,o):e.push(o)}return e}}})},r}(O),l=function(r){function a(t){var e=r.call(this)||this;return e.commands="string"==typeof t?a.parse(t):t,e}return e(a,r),a.prototype.encode=function(){return a.encode(this.commands)},a.prototype.getBounds=function(){var r=t.SVGPathDataTransformer.CALCULATE_BOUNDS();return this.transform(r),r},a.prototype.transform=function(t){for(var r=[],e=0,a=this.commands;e<a.length;e++){var n=t(a[e]);Array.isArray(n)?r.push.apply(r,n):r.push(n)}return this.commands=r,this},a.encode=function(t){return d(t)},a.parse=function(t){var r=new v,e=[];return r.parse(t,e),r.finish(e),e},a.CLOSE_PATH=1,a.MOVE_TO=2,a.HORIZ_LINE_TO=4,a.VERT_LINE_TO=8,a.LINE_TO=16,a.CURVE_TO=32,a.SMOOTH_CURVE_TO=64,a.QUAD_TO=128,a.SMOOTH_QUAD_TO=256,a.ARC=512,a.LINE_COMMANDS=a.LINE_TO|a.HORIZ_LINE_TO|a.VERT_LINE_TO,a.DRAWING_COMMANDS=a.HORIZ_LINE_TO|a.VERT_LINE_TO|a.LINE_TO|a.CURVE_TO|a.SMOOTH_CURVE_TO|a.QUAD_TO|a.SMOOTH_QUAD_TO|a.ARC,a}(O),N=((p={})[l.MOVE_TO]=2,p[l.LINE_TO]=2,p[l.HORIZ_LINE_TO]=1,p[l.VERT_LINE_TO]=1,p[l.CLOSE_PATH]=0,p[l.QUAD_TO]=4,p[l.SMOOTH_QUAD_TO]=2,p[l.CURVE_TO]=6,p[l.SMOOTH_CURVE_TO]=4,p[l.ARC]=7,p),E=" ";function d(t){var r="";Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var a=t[e];if(a.type===l.CLOSE_PATH)r+="z";else if(a.type===l.HORIZ_LINE_TO)r+=(a.relative?"h":"H")+a.x;else if(a.type===l.VERT_LINE_TO)r+=(a.relative?"v":"V")+a.y;else if(a.type===l.MOVE_TO)r+=(a.relative?"m":"M")+a.x+E+a.y;else if(a.type===l.LINE_TO)r+=(a.relative?"l":"L")+a.x+E+a.y;else if(a.type===l.CURVE_TO)r+=(a.relative?"c":"C")+a.x1+E+a.y1+E+a.x2+E+a.y2+E+a.x+E+a.y;else if(a.type===l.SMOOTH_CURVE_TO)r+=(a.relative?"s":"S")+a.x2+E+a.y2+E+a.x+E+a.y;else if(a.type===l.QUAD_TO)r+=(a.relative?"q":"Q")+a.x1+E+a.y1+E+a.x+E+a.y;else if(a.type===l.SMOOTH_QUAD_TO)r+=(a.relative?"t":"T")+a.x+E+a.y;else{if(a.type!==l.ARC)throw new Error('Unexpected command type "'+a.type+'" at index '+e+".");r+=(a.relative?"a":"A")+a.rX+E+a.rY+E+a.xRot+E+ +a.lArcFlag+E+ +a.sweepFlag+E+a.x+E+a.y}}return r}var A=function(r){function a(t){var e=r.call(this)||this;return e.commands="string"==typeof t?a.parse(t):t,e}return e(a,r),a.prototype.encode=function(){return a.encode(this.commands)},a.prototype.getBounds=function(){var r=t.SVGPathDataTransformer.CALCULATE_BOUNDS();return this.transform(r),r},a.prototype.transform=function(t){for(var r=[],e=0,a=this.commands;e<a.length;e++){var n=t(a[e]);Array.isArray(n)?r.push.apply(r,n):r.push(n)}return this.commands=r,this},a.encode=function(t){return d(t)},a.parse=function(t){var r=new v,e=[];return r.parse(t,e),r.finish(e),e},a.CLOSE_PATH=1,a.MOVE_TO=2,a.HORIZ_LINE_TO=4,a.VERT_LINE_TO=8,a.LINE_TO=16,a.CURVE_TO=32,a.SMOOTH_CURVE_TO=64,a.QUAD_TO=128,a.SMOOTH_QUAD_TO=256,a.ARC=512,a.LINE_COMMANDS=a.LINE_TO|a.HORIZ_LINE_TO|a.VERT_LINE_TO,a.DRAWING_COMMANDS=a.HORIZ_LINE_TO|a.VERT_LINE_TO|a.LINE_TO|a.CURVE_TO|a.SMOOTH_CURVE_TO|a.QUAD_TO|a.SMOOTH_QUAD_TO|a.ARC,a}(O),x=((T={})[A.MOVE_TO]=2,T[A.LINE_TO]=2,T[A.HORIZ_LINE_TO]=1,T[A.VERT_LINE_TO]=1,T[A.CLOSE_PATH]=0,T[A.QUAD_TO]=4,T[A.SMOOTH_QUAD_TO]=2,T[A.CURVE_TO]=6,T[A.SMOOTH_CURVE_TO]=4,T[A.ARC]=7,T);t.SVGPathData=A,t.COMMAND_ARG_COUNTS=x,t.encodeSVGPath=d,t.SVGPathDataParser=v,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((t=t||self).svgpathdata={})}(this,(function(t){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(t,e)};function e(t,e){function a(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(a.prototype=e.prototype,new a)}function a(t,r){var e=t[0],a=t[1];return[e*Math.cos(r)-a*Math.sin(r),e*Math.sin(r)+a*Math.cos(r)]}function n(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var e=0;e<t.length;e++)if("number"!=typeof t[e])throw new Error("assertNumbers arguments["+e+"] is not a number. "+typeof t[e]+" == typeof "+t[e]);return!0}var i=Math.PI;function o(t,r,e){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;var n=t.rX,o=t.rY,s=t.x,u=t.y;n=Math.abs(t.rX),o=Math.abs(t.rY);var h=a([(r-s)/2,(e-u)/2],-t.xRot/180*i),c=h[0],m=h[1],y=Math.pow(c,2)/Math.pow(n,2)+Math.pow(m,2)/Math.pow(o,2);1<y&&(n*=Math.sqrt(y),o*=Math.sqrt(y)),t.rX=n,t.rY=o;var p=Math.pow(n,2)*Math.pow(m,2)+Math.pow(o,2)*Math.pow(c,2),T=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(n,2)*Math.pow(o,2)-p)/p)),O=n*m/o*T,_=-o*c/n*T,f=a([O,_],t.xRot/180*i);t.cX=f[0]+(r+s)/2,t.cY=f[1]+(e+u)/2,t.phi1=Math.atan2((m-_)/o,(c-O)/n),t.phi2=Math.atan2((-m-_)/o,(-c-O)/n),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*i),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*i),t.phi1*=180/i,t.phi2*=180/i}function s(t,r,e){n(t,r,e);var a=t*t+r*r-e*e;if(0>a)return[];if(0===a)return[[t*e/(t*t+r*r),r*e/(t*t+r*r)]];var i=Math.sqrt(a);return[[(t*e+r*i)/(t*t+r*r),(r*e-t*i)/(t*t+r*r)],[(t*e-r*i)/(t*t+r*r),(r*e+t*i)/(t*t+r*r)]]}var u=Math.PI/180;function h(t,r,e){return(1-e)*t+e*r}function c(t,r,e,a){return t+Math.cos(a/180*i)*r+Math.sin(a/180*i)*e}function m(t,r,e,a){var n=r-t,i=e-r,o=3*n+3*(a-e)-6*i,s=6*(i-n),u=3*n;return Math.abs(o)<1e-6?[-u/s]:function(t,r,e){void 0===e&&(e=1e-6);var a=t*t/4-r;if(a<-e)return[];if(a<=e)return[-t/2];var n=Math.sqrt(a);return[-t/2-n,-t/2+n]}(s/o,u/o,1e-6)}function y(t,r,e,a,n){var i=1-n;return t*(i*i*i)+r*(3*i*i*n)+e*(3*i*n*n)+a*(n*n*n)}!function(t){function r(){return p((function(t,r,e){return t.relative&&(void 0!==t.x1&&(t.x1+=r),void 0!==t.y1&&(t.y1+=e),void 0!==t.x2&&(t.x2+=r),void 0!==t.y2&&(t.y2+=e),void 0!==t.x&&(t.x+=r),void 0!==t.y&&(t.y+=e),t.relative=!1),t}))}function e(){var t=NaN,r=NaN,e=NaN,a=NaN;return p((function(n,i,o){return n.type&l.SMOOTH_CURVE_TO&&(n.type=l.CURVE_TO,t=isNaN(t)?i:t,r=isNaN(r)?o:r,n.x1=n.relative?i-t:2*i-t,n.y1=n.relative?o-r:2*o-r),n.type&l.CURVE_TO?(t=n.relative?i+n.x2:n.x2,r=n.relative?o+n.y2:n.y2):(t=NaN,r=NaN),n.type&l.SMOOTH_QUAD_TO&&(n.type=l.QUAD_TO,e=isNaN(e)?i:e,a=isNaN(a)?o:a,n.x1=n.relative?i-e:2*i-e,n.y1=n.relative?o-a:2*o-a),n.type&l.QUAD_TO?(e=n.relative?i+n.x1:n.x1,a=n.relative?o+n.y1:n.y1):(e=NaN,a=NaN),n}))}function i(){var t=NaN,r=NaN;return p((function(e,a,n){if(e.type&l.SMOOTH_QUAD_TO&&(e.type=l.QUAD_TO,t=isNaN(t)?a:t,r=isNaN(r)?n:r,e.x1=e.relative?a-t:2*a-t,e.y1=e.relative?n-r:2*n-r),e.type&l.QUAD_TO){t=e.relative?a+e.x1:e.x1,r=e.relative?n+e.y1:e.y1;var i=e.x1,o=e.y1;e.type=l.CURVE_TO,e.x1=((e.relative?0:a)+2*i)/3,e.y1=((e.relative?0:n)+2*o)/3,e.x2=(e.x+2*i)/3,e.y2=(e.y+2*o)/3}else t=NaN,r=NaN;return e}))}function p(t){var r=0,e=0,a=NaN,n=NaN;return function(i){if(isNaN(a)&&!(i.type&l.MOVE_TO))throw new Error("path must start with moveto");var o=t(i,r,e,a,n);return i.type&l.CLOSE_PATH&&(r=a,e=n),void 0!==i.x&&(r=i.relative?r+i.x:i.x),void 0!==i.y&&(e=i.relative?e+i.y:i.y),i.type&l.MOVE_TO&&(a=r,n=e),o}}function T(t,r,e,a,i,o){return n(t,r,e,a,i,o),p((function(n,s,u,h){var c=n.x1,m=n.x2,y=n.relative&&!isNaN(h),p=void 0!==n.x?n.x:y?0:s,T=void 0!==n.y?n.y:y?0:u;function O(t){return t*t}n.type&l.HORIZ_LINE_TO&&0!==r&&(n.type=l.LINE_TO,n.y=n.relative?0:u),n.type&l.VERT_LINE_TO&&0!==e&&(n.type=l.LINE_TO,n.x=n.relative?0:s),void 0!==n.x&&(n.x=n.x*t+T*e+(y?0:i)),void 0!==n.y&&(n.y=p*r+n.y*a+(y?0:o)),void 0!==n.x1&&(n.x1=n.x1*t+n.y1*e+(y?0:i)),void 0!==n.y1&&(n.y1=c*r+n.y1*a+(y?0:o)),void 0!==n.x2&&(n.x2=n.x2*t+n.y2*e+(y?0:i)),void 0!==n.y2&&(n.y2=m*r+n.y2*a+(y?0:o));var _=t*a-r*e;if(void 0!==n.xRot&&(1!==t||0!==r||0!==e||1!==a))if(0===_)delete n.rX,delete n.rY,delete n.xRot,delete n.lArcFlag,delete n.sweepFlag,n.type=l.LINE_TO;else{var f=n.xRot*Math.PI/180,v=Math.sin(f),N=Math.cos(f),E=1/O(n.rX),d=1/O(n.rY),A=O(N)*E+O(v)*d,x=2*v*N*(E-d),C=O(v)*E+O(N)*d,M=A*a*a-x*r*a+C*r*r,R=x*(t*a+r*e)-2*(A*e*a+C*t*r),S=A*e*e-x*t*e+C*t*t,I=(Math.atan2(R,M-S)+Math.PI)%Math.PI/2,g=Math.sin(I),V=Math.cos(I);n.rX=Math.abs(_)/Math.sqrt(M*O(V)+R*g*V+S*O(g)),n.rY=Math.abs(_)/Math.sqrt(M*O(g)-R*g*V+S*O(V)),n.xRot=180*I/Math.PI}return void 0!==n.sweepFlag&&0>_&&(n.sweepFlag=+!n.sweepFlag),n}))}function O(){return function(t){var r={};for(var e in t)r[e]=t[e];return r}}t.ROUND=function(t){function r(r){return Math.round(r*t)/t}return void 0===t&&(t=1e13),n(t),function(t){return void 0!==t.x1&&(t.x1=r(t.x1)),void 0!==t.y1&&(t.y1=r(t.y1)),void 0!==t.x2&&(t.x2=r(t.x2)),void 0!==t.y2&&(t.y2=r(t.y2)),void 0!==t.x&&(t.x=r(t.x)),void 0!==t.y&&(t.y=r(t.y)),void 0!==t.rX&&(t.rX=r(t.rX)),void 0!==t.rY&&(t.rY=r(t.rY)),t}},t.TO_ABS=r,t.TO_REL=function(){return p((function(t,r,e){return t.relative||(void 0!==t.x1&&(t.x1-=r),void 0!==t.y1&&(t.y1-=e),void 0!==t.x2&&(t.x2-=r),void 0!==t.y2&&(t.y2-=e),void 0!==t.x&&(t.x-=r),void 0!==t.y&&(t.y-=e),t.relative=!0),t}))},t.NORMALIZE_HVZ=function(t,r,e){return void 0===t&&(t=!0),void 0===r&&(r=!0),void 0===e&&(e=!0),p((function(a,n,i,o,s){if(isNaN(o)&&!(a.type&l.MOVE_TO))throw new Error("path must start with moveto");return r&&a.type&l.HORIZ_LINE_TO&&(a.type=l.LINE_TO,a.y=a.relative?0:i),e&&a.type&l.VERT_LINE_TO&&(a.type=l.LINE_TO,a.x=a.relative?0:n),t&&a.type&l.CLOSE_PATH&&(a.type=l.LINE_TO,a.x=a.relative?o-n:o,a.y=a.relative?s-i:s),a.type&l.ARC&&(0===a.rX||0===a.rY)&&(a.type=l.LINE_TO,delete a.rX,delete a.rY,delete a.xRot,delete a.lArcFlag,delete a.sweepFlag),a}))},t.NORMALIZE_ST=e,t.QT_TO_C=i,t.INFO=p,t.SANITIZE=function(t){void 0===t&&(t=0),n(t);var r=NaN,e=NaN,a=NaN,i=NaN;return p((function(n,o,s,u,h){var c=Math.abs,m=!1,y=0,p=0;if(n.type&l.SMOOTH_CURVE_TO&&(y=isNaN(r)?0:o-r,p=isNaN(e)?0:s-e),n.type&(l.CURVE_TO|l.SMOOTH_CURVE_TO)?(r=n.relative?o+n.x2:n.x2,e=n.relative?s+n.y2:n.y2):(r=NaN,e=NaN),n.type&l.SMOOTH_QUAD_TO?(a=isNaN(a)?o:2*o-a,i=isNaN(i)?s:2*s-i):n.type&l.QUAD_TO?(a=n.relative?o+n.x1:n.x1,i=n.relative?s+n.y1:n.y2):(a=NaN,i=NaN),n.type&l.LINE_COMMANDS||n.type&l.ARC&&(0===n.rX||0===n.rY||!n.lArcFlag)||n.type&l.CURVE_TO||n.type&l.SMOOTH_CURVE_TO||n.type&l.QUAD_TO||n.type&l.SMOOTH_QUAD_TO){var T=void 0===n.x?0:n.relative?n.x:n.x-o,O=void 0===n.y?0:n.relative?n.y:n.y-s;y=isNaN(a)?void 0===n.x1?y:n.relative?n.x:n.x1-o:a-o,p=isNaN(i)?void 0===n.y1?p:n.relative?n.y:n.y1-s:i-s;var _=void 0===n.x2?0:n.relative?n.x:n.x2-o,f=void 0===n.y2?0:n.relative?n.y:n.y2-s;c(T)<=t&&c(O)<=t&&c(y)<=t&&c(p)<=t&&c(_)<=t&&c(f)<=t&&(m=!0)}return n.type&l.CLOSE_PATH&&c(o-u)<=t&&c(s-h)<=t&&(m=!0),m?[]:n}))},t.MATRIX=T,t.ROTATE=function(t,r,e){void 0===r&&(r=0),void 0===e&&(e=0),n(t,r,e);var a=Math.sin(t),i=Math.cos(t);return T(i,a,-a,i,r-r*i+e*a,e-r*a-e*i)},t.TRANSLATE=function(t,r){return void 0===r&&(r=0),n(t,r),T(1,0,0,1,t,r)},t.SCALE=function(t,r){return void 0===r&&(r=t),n(t,r),T(t,0,0,r,0,0)},t.SKEW_X=function(t){return n(t),T(1,0,Math.atan(t),1,0,0)},t.SKEW_Y=function(t){return n(t),T(1,Math.atan(t),0,1,0,0)},t.X_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),n(t),T(-1,0,0,1,t,0)},t.Y_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),n(t),T(1,0,0,-1,0,t)},t.A_TO_C=function(){return p((function(t,r,e){return l.ARC===t.type?function(t,r,e){var n,i,s,c;t.cX||o(t,r,e);for(var m=Math.min(t.phi1,t.phi2),y=Math.max(t.phi1,t.phi2)-m,p=Math.ceil(y/90),T=new Array(p),O=r,_=e,f=0;f<p;f++){var v=h(t.phi1,t.phi2,f/p),N=h(t.phi1,t.phi2,(f+1)/p),E=N-v,d=4/3*Math.tan(E*u/4),A=[Math.cos(v*u)-d*Math.sin(v*u),Math.sin(v*u)+d*Math.cos(v*u)],x=A[0],C=A[1],M=[Math.cos(N*u),Math.sin(N*u)],R=M[0],S=M[1],I=[R+d*Math.sin(N*u),S-d*Math.cos(N*u)],g=I[0],V=I[1];T[f]={relative:t.relative,type:l.CURVE_TO};var L=function(r,e){var n=a([r*t.rX,e*t.rY],t.xRot),i=n[0],o=n[1];return[t.cX+i,t.cY+o]};n=L(x,C),T[f].x1=n[0],T[f].y1=n[1],i=L(g,V),T[f].x2=i[0],T[f].y2=i[1],s=L(R,S),T[f].x=s[0],T[f].y=s[1],t.relative&&(T[f].x1-=O,T[f].y1-=_,T[f].x2-=O,T[f].y2-=_,T[f].x-=O,T[f].y-=_),O=(c=[T[f].x,T[f].y])[0],_=c[1]}return T}(t,t.relative?0:r,t.relative?0:e):t}))},t.ANNOTATE_ARCS=function(){return p((function(t,r,e){return t.relative&&(r=0,e=0),l.ARC===t.type&&o(t,r,e),t}))},t.CLONE=O,t.CALCULATE_BOUNDS=function(){var t=function(t){var r={};for(var e in t)r[e]=t[e];return r},a=r(),n=i(),u=e(),h=p((function(r,e,i){var p=u(n(a(t(r))));function T(t){t>h.maxX&&(h.maxX=t),t<h.minX&&(h.minX=t)}function O(t){t>h.maxY&&(h.maxY=t),t<h.minY&&(h.minY=t)}if(p.type&l.DRAWING_COMMANDS&&(T(e),O(i)),p.type&l.HORIZ_LINE_TO&&T(p.x),p.type&l.VERT_LINE_TO&&O(p.y),p.type&l.LINE_TO&&(T(p.x),O(p.y)),p.type&l.CURVE_TO){T(p.x),O(p.y);for(var _=0,f=m(e,p.x1,p.x2,p.x);_<f.length;_++){0<(U=f[_])&&1>U&&T(y(e,p.x1,p.x2,p.x,U))}for(var v=0,N=m(i,p.y1,p.y2,p.y);v<N.length;v++){0<(U=N[v])&&1>U&&O(y(i,p.y1,p.y2,p.y,U))}}if(p.type&l.ARC){T(p.x),O(p.y),o(p,e,i);for(var E=p.xRot/180*Math.PI,d=Math.cos(E)*p.rX,A=Math.sin(E)*p.rX,x=-Math.sin(E)*p.rY,C=Math.cos(E)*p.rY,M=p.phi1<p.phi2?[p.phi1,p.phi2]:-180>p.phi2?[p.phi2+360,p.phi1+360]:[p.phi2,p.phi1],R=M[0],S=M[1],I=function(t){var r=t[0],e=t[1],a=180*Math.atan2(e,r)/Math.PI;return a<R?a+360:a},g=0,V=s(x,-d,0).map(I);g<V.length;g++){(U=V[g])>R&&U<S&&T(c(p.cX,d,x,U))}for(var L=0,D=s(C,-A,0).map(I);L<D.length;L++){var U;(U=D[L])>R&&U<S&&O(c(p.cY,A,C,U))}}return r}));return h.minX=1/0,h.maxX=-1/0,h.minY=1/0,h.maxY=-1/0,h}}(t.SVGPathDataTransformer||(t.SVGPathDataTransformer={}));var p,T,O=function(){function r(){}return r.prototype.round=function(r){return this.transform(t.SVGPathDataTransformer.ROUND(r))},r.prototype.toAbs=function(){return this.transform(t.SVGPathDataTransformer.TO_ABS())},r.prototype.toRel=function(){return this.transform(t.SVGPathDataTransformer.TO_REL())},r.prototype.normalizeHVZ=function(r,e,a){return this.transform(t.SVGPathDataTransformer.NORMALIZE_HVZ(r,e,a))},r.prototype.normalizeST=function(){return this.transform(t.SVGPathDataTransformer.NORMALIZE_ST())},r.prototype.qtToC=function(){return this.transform(t.SVGPathDataTransformer.QT_TO_C())},r.prototype.aToC=function(){return this.transform(t.SVGPathDataTransformer.A_TO_C())},r.prototype.sanitize=function(r){return this.transform(t.SVGPathDataTransformer.SANITIZE(r))},r.prototype.translate=function(r,e){return this.transform(t.SVGPathDataTransformer.TRANSLATE(r,e))},r.prototype.scale=function(r,e){return this.transform(t.SVGPathDataTransformer.SCALE(r,e))},r.prototype.rotate=function(r,e,a){return this.transform(t.SVGPathDataTransformer.ROTATE(r,e,a))},r.prototype.matrix=function(r,e,a,n,i,o){return this.transform(t.SVGPathDataTransformer.MATRIX(r,e,a,n,i,o))},r.prototype.skewX=function(r){return this.transform(t.SVGPathDataTransformer.SKEW_X(r))},r.prototype.skewY=function(r){return this.transform(t.SVGPathDataTransformer.SKEW_Y(r))},r.prototype.xSymmetry=function(r){return this.transform(t.SVGPathDataTransformer.X_AXIS_SYMMETRY(r))},r.prototype.ySymmetry=function(r){return this.transform(t.SVGPathDataTransformer.Y_AXIS_SYMMETRY(r))},r.prototype.annotateArcs=function(){return this.transform(t.SVGPathDataTransformer.ANNOTATE_ARCS())},r}(),_=function(t){return" "===t||"\t"===t||"\r"===t||"\n"===t},f=function(t){return"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0)},v=function(t){function r(){var r=t.call(this)||this;return r.curNumber="",r.curCommandType=-1,r.curCommandRelative=!1,r.canParseCommandOrComma=!0,r.curNumberHasExp=!1,r.curNumberHasExpDigits=!1,r.curNumberHasDecimal=!1,r.curArgs=[],r}return e(r,t),r.prototype.finish=function(t){if(void 0===t&&(t=[]),this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t},r.prototype.parse=function(t,r){var e=this;void 0===r&&(r=[]);for(var a=function(t){r.push(t),e.curArgs.length=0,e.canParseCommandOrComma=!0},n=0;n<t.length;n++){var i=t[n];if(f(i))this.curNumber+=i,this.curNumberHasExpDigits=this.curNumberHasExp;else if("e"!==i&&"E"!==i)if("-"!==i&&"+"!==i||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==i||this.curNumberHasExp||this.curNumberHasDecimal){if(this.curNumber&&-1!==this.curCommandType){var o=Number(this.curNumber);if(isNaN(o))throw new SyntaxError("Invalid number ending at "+n);if(this.curCommandType===l.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>o)throw new SyntaxError('Expected positive number, got "'+o+'" at index "'+n+'"')}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+n+'"');this.curArgs.push(o),this.curArgs.length===N[this.curCommandType]&&(l.HORIZ_LINE_TO===this.curCommandType?a({type:l.HORIZ_LINE_TO,relative:this.curCommandRelative,x:o}):l.VERT_LINE_TO===this.curCommandType?a({type:l.VERT_LINE_TO,relative:this.curCommandRelative,y:o}):this.curCommandType===l.MOVE_TO||this.curCommandType===l.LINE_TO||this.curCommandType===l.SMOOTH_QUAD_TO?(a({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),l.MOVE_TO===this.curCommandType&&(this.curCommandType=l.LINE_TO)):this.curCommandType===l.CURVE_TO?a({type:l.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===l.SMOOTH_CURVE_TO?a({type:l.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===l.QUAD_TO?a({type:l.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===l.ARC&&a({type:l.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!_(i))if(","===i&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==i&&"-"!==i&&"."!==i){if(0!==this.curArgs.length)throw new SyntaxError("Unterminated command at index "+n+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+i+'" at index '+n+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,"z"!==i&&"Z"!==i)if("h"===i||"H"===i)this.curCommandType=l.HORIZ_LINE_TO,this.curCommandRelative="h"===i;else if("v"===i||"V"===i)this.curCommandType=l.VERT_LINE_TO,this.curCommandRelative="v"===i;else if("m"===i||"M"===i)this.curCommandType=l.MOVE_TO,this.curCommandRelative="m"===i;else if("l"===i||"L"===i)this.curCommandType=l.LINE_TO,this.curCommandRelative="l"===i;else if("c"===i||"C"===i)this.curCommandType=l.CURVE_TO,this.curCommandRelative="c"===i;else if("s"===i||"S"===i)this.curCommandType=l.SMOOTH_CURVE_TO,this.curCommandRelative="s"===i;else if("q"===i||"Q"===i)this.curCommandType=l.QUAD_TO,this.curCommandRelative="q"===i;else if("t"===i||"T"===i)this.curCommandType=l.SMOOTH_QUAD_TO,this.curCommandRelative="t"===i;else{if("a"!==i&&"A"!==i)throw new SyntaxError('Unexpected character "'+i+'" at index '+n+".");this.curCommandType=l.ARC,this.curCommandRelative="a"===i}else r.push({type:l.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=i,this.curNumberHasDecimal="."===i}else this.curNumber+=i,this.curNumberHasDecimal=!0;else this.curNumber+=i;else this.curNumber+=i,this.curNumberHasExp=!0}return r},r.prototype.transform=function(t){return Object.create(this,{parse:{value:function(r,e){void 0===e&&(e=[]);for(var a=0,n=Object.getPrototypeOf(this).parse.call(this,r);a<n.length;a++){var i=n[a],o=t(i);Array.isArray(o)?e.push.apply(e,o):e.push(o)}return e}}})},r}(O),l=function(r){function a(t){var e=r.call(this)||this;return e.commands="string"==typeof t?a.parse(t):t,e}return e(a,r),a.prototype.encode=function(){return a.encode(this.commands)},a.prototype.getBounds=function(){var r=t.SVGPathDataTransformer.CALCULATE_BOUNDS();return this.transform(r),r},a.prototype.transform=function(t){for(var r=[],e=0,a=this.commands;e<a.length;e++){var n=t(a[e]);Array.isArray(n)?r.push.apply(r,n):r.push(n)}return this.commands=r,this},a.encode=function(t){return E(t)},a.parse=function(t){var r=new v,e=[];return r.parse(t,e),r.finish(e),e},a.CLOSE_PATH=1,a.MOVE_TO=2,a.HORIZ_LINE_TO=4,a.VERT_LINE_TO=8,a.LINE_TO=16,a.CURVE_TO=32,a.SMOOTH_CURVE_TO=64,a.QUAD_TO=128,a.SMOOTH_QUAD_TO=256,a.ARC=512,a.LINE_COMMANDS=a.LINE_TO|a.HORIZ_LINE_TO|a.VERT_LINE_TO,a.DRAWING_COMMANDS=a.HORIZ_LINE_TO|a.VERT_LINE_TO|a.LINE_TO|a.CURVE_TO|a.SMOOTH_CURVE_TO|a.QUAD_TO|a.SMOOTH_QUAD_TO|a.ARC,a}(O),N=((p={})[l.MOVE_TO]=2,p[l.LINE_TO]=2,p[l.HORIZ_LINE_TO]=1,p[l.VERT_LINE_TO]=1,p[l.CLOSE_PATH]=0,p[l.QUAD_TO]=4,p[l.SMOOTH_QUAD_TO]=2,p[l.CURVE_TO]=6,p[l.SMOOTH_CURVE_TO]=4,p[l.ARC]=7,p);function E(t){var r="";Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var a=t[e];if(a.type===l.CLOSE_PATH)r+="z";else if(a.type===l.HORIZ_LINE_TO)r+=(a.relative?"h":"H")+a.x;else if(a.type===l.VERT_LINE_TO)r+=(a.relative?"v":"V")+a.y;else if(a.type===l.MOVE_TO)r+=(a.relative?"m":"M")+a.x+" "+a.y;else if(a.type===l.LINE_TO)r+=(a.relative?"l":"L")+a.x+" "+a.y;else if(a.type===l.CURVE_TO)r+=(a.relative?"c":"C")+a.x1+" "+a.y1+" "+a.x2+" "+a.y2+" "+a.x+" "+a.y;else if(a.type===l.SMOOTH_CURVE_TO)r+=(a.relative?"s":"S")+a.x2+" "+a.y2+" "+a.x+" "+a.y;else if(a.type===l.QUAD_TO)r+=(a.relative?"q":"Q")+a.x1+" "+a.y1+" "+a.x+" "+a.y;else if(a.type===l.SMOOTH_QUAD_TO)r+=(a.relative?"t":"T")+a.x+" "+a.y;else{if(a.type!==l.ARC)throw new Error('Unexpected command type "'+a.type+'" at index '+e+".");r+=(a.relative?"a":"A")+a.rX+" "+a.rY+" "+a.xRot+" "+ +a.lArcFlag+" "+ +a.sweepFlag+" "+a.x+" "+a.y}}return r}var d=function(r){function a(t){var e=r.call(this)||this;return e.commands="string"==typeof t?a.parse(t):t,e}return e(a,r),a.prototype.encode=function(){return a.encode(this.commands)},a.prototype.getBounds=function(){var r=t.SVGPathDataTransformer.CALCULATE_BOUNDS();return this.transform(r),r},a.prototype.transform=function(t){for(var r=[],e=0,a=this.commands;e<a.length;e++){var n=t(a[e]);Array.isArray(n)?r.push.apply(r,n):r.push(n)}return this.commands=r,this},a.encode=function(t){return E(t)},a.parse=function(t){var r=new v,e=[];return r.parse(t,e),r.finish(e),e},a.CLOSE_PATH=1,a.MOVE_TO=2,a.HORIZ_LINE_TO=4,a.VERT_LINE_TO=8,a.LINE_TO=16,a.CURVE_TO=32,a.SMOOTH_CURVE_TO=64,a.QUAD_TO=128,a.SMOOTH_QUAD_TO=256,a.ARC=512,a.LINE_COMMANDS=a.LINE_TO|a.HORIZ_LINE_TO|a.VERT_LINE_TO,a.DRAWING_COMMANDS=a.HORIZ_LINE_TO|a.VERT_LINE_TO|a.LINE_TO|a.CURVE_TO|a.SMOOTH_CURVE_TO|a.QUAD_TO|a.SMOOTH_QUAD_TO|a.ARC,a}(O),A=((T={})[d.MOVE_TO]=2,T[d.LINE_TO]=2,T[d.HORIZ_LINE_TO]=1,T[d.VERT_LINE_TO]=1,T[d.CLOSE_PATH]=0,T[d.QUAD_TO]=4,T[d.SMOOTH_QUAD_TO]=2,T[d.CURVE_TO]=6,T[d.SMOOTH_CURVE_TO]=4,T[d.ARC]=7,T);t.COMMAND_ARG_COUNTS=A,t.SVGPathData=d,t.SVGPathDataParser=v,t.encodeSVGPath=E,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=SVGPathData.js.map

@@ -1,2 +0,16 @@

var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var r in a)a.hasOwnProperty(r)&&(t[r]=a[r])};function __extends(t,a){function r(){this.constructor=t}extendStatics(t,a),t.prototype=null===a?Object.create(a):(r.prototype=a.prototype,new r)}function rotate(t,a){var r=t[0],e=t[1];return[r*Math.cos(a)-e*Math.sin(a),r*Math.sin(a)+e*Math.cos(a)]}function assertNumbers(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];for(var r=0;r<t.length;r++)if("number"!=typeof t[r])throw new Error("assertNumbers arguments["+r+"] is not a number. "+typeof t[r]+" == typeof "+t[r]);return!0}var PI=Math.PI;function annotateArcCommand(t,a,r){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;var e=t.rX,n=t.rY,i=t.x,o=t.y;e=Math.abs(t.rX),n=Math.abs(t.rY);var s=rotate([(a-i)/2,(r-o)/2],-t.xRot/180*PI),h=s[0],u=s[1],c=Math.pow(h,2)/Math.pow(e,2)+Math.pow(u,2)/Math.pow(n,2);1<c&&(e*=Math.sqrt(c),n*=Math.sqrt(c)),t.rX=e,t.rY=n;var m=Math.pow(e,2)*Math.pow(u,2)+Math.pow(n,2)*Math.pow(h,2),_=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(e,2)*Math.pow(n,2)-m)/m)),T=e*u/n*_,O=-n*h/e*_,p=rotate([T,O],t.xRot/180*PI);t.cX=p[0]+(a+i)/2,t.cY=p[1]+(r+o)/2,t.phi1=Math.atan2((u-O)/n,(h-T)/e),t.phi2=Math.atan2((-u-O)/n,(-h-T)/e),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*PI),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*PI),t.phi1*=180/PI,t.phi2*=180/PI}function intersectionUnitCircleLine(t,a,r){assertNumbers(t,a,r);var e=t*t+a*a-r*r;if(0>e)return[];if(0===e)return[[t*r/(t*t+a*a),a*r/(t*t+a*a)]];var n=Math.sqrt(e);return[[(t*r+a*n)/(t*t+a*a),(a*r-t*n)/(t*t+a*a)],[(t*r-a*n)/(t*t+a*a),(a*r+t*n)/(t*t+a*a)]]}var SVGPathDataTransformer,DEG=Math.PI/180;function lerp(t,a,r){return(1-r)*t+r*a}function arcAt(t,a,r,e){return t+Math.cos(e/180*PI)*a+Math.sin(e/180*PI)*r}function bezierRoot(t,a,r,e){var n=a-t,i=r-a,o=3*n+3*(e-r)-6*i,s=6*(i-n),h=3*n;return Math.abs(o)<1e-6?[-h/s]:pqFormula(s/o,h/o,1e-6)}function bezierAt(t,a,r,e,n){var i=1-n;return t*(i*i*i)+a*(3*i*i*n)+r*(3*i*n*n)+e*(n*n*n)}function pqFormula(t,a,r){void 0===r&&(r=1e-6);var e=t*t/4-a;if(e<-r)return[];if(e<=r)return[-t/2];var n=Math.sqrt(e);return[-t/2-n,-t/2+n]}function a2c(t,a,r){var e,n,i,o;t.cX||annotateArcCommand(t,a,r);for(var s=Math.min(t.phi1,t.phi2),h=Math.max(t.phi1,t.phi2)-s,u=Math.ceil(h/90),c=new Array(u),m=a,_=r,T=0;T<u;T++){var O=lerp(t.phi1,t.phi2,T/u),p=lerp(t.phi1,t.phi2,(T+1)/u),y=p-O,S=4/3*Math.tan(y*DEG/4),f=[Math.cos(O*DEG)-S*Math.sin(O*DEG),Math.sin(O*DEG)+S*Math.cos(O*DEG)],V=f[0],N=f[1],D=[Math.cos(p*DEG),Math.sin(p*DEG)],P=D[0],l=D[1],v=[P+S*Math.sin(p*DEG),l-S*Math.cos(p*DEG)],E=v[0],A=v[1];c[T]={relative:t.relative,type:SVGPathData.CURVE_TO};var d=function(a,r){var e=rotate([a*t.rX,r*t.rY],t.xRot),n=e[0],i=e[1];return[t.cX+n,t.cY+i]};e=d(V,N),c[T].x1=e[0],c[T].y1=e[1],n=d(E,A),c[T].x2=n[0],c[T].y2=n[1],i=d(P,l),c[T].x=i[0],c[T].y=i[1],t.relative&&(c[T].x1-=m,c[T].y1-=_,c[T].x2-=m,c[T].y2-=_,c[T].x-=m,c[T].y-=_),m=(o=[c[T].x,c[T].y])[0],_=o[1]}return c}!function(t){function a(){return n(function(t,a,r){return t.relative&&(void 0!==t.x1&&(t.x1+=a),void 0!==t.y1&&(t.y1+=r),void 0!==t.x2&&(t.x2+=a),void 0!==t.y2&&(t.y2+=r),void 0!==t.x&&(t.x+=a),void 0!==t.y&&(t.y+=r),t.relative=!1),t})}function r(){var t=NaN,a=NaN,r=NaN,e=NaN;return n(function(n,i,o){return n.type&SVGPathData.SMOOTH_CURVE_TO&&(n.type=SVGPathData.CURVE_TO,t=isNaN(t)?i:t,a=isNaN(a)?o:a,n.x1=n.relative?i-t:2*i-t,n.y1=n.relative?o-a:2*o-a),n.type&SVGPathData.CURVE_TO?(t=n.relative?i+n.x2:n.x2,a=n.relative?o+n.y2:n.y2):(t=NaN,a=NaN),n.type&SVGPathData.SMOOTH_QUAD_TO&&(n.type=SVGPathData.QUAD_TO,r=isNaN(r)?i:r,e=isNaN(e)?o:e,n.x1=n.relative?i-r:2*i-r,n.y1=n.relative?o-e:2*o-e),n.type&SVGPathData.QUAD_TO?(r=n.relative?i+n.x1:n.x1,e=n.relative?o+n.y1:n.y1):(r=NaN,e=NaN),n})}function e(){var t=NaN,a=NaN;return n(function(r,e,n){if(r.type&SVGPathData.SMOOTH_QUAD_TO&&(r.type=SVGPathData.QUAD_TO,t=isNaN(t)?e:t,a=isNaN(a)?n:a,r.x1=r.relative?e-t:2*e-t,r.y1=r.relative?n-a:2*n-a),r.type&SVGPathData.QUAD_TO){t=r.relative?e+r.x1:r.x1,a=r.relative?n+r.y1:r.y1;var i=r.x1,o=r.y1;r.type=SVGPathData.CURVE_TO,r.x1=((r.relative?0:e)+2*i)/3,r.y1=((r.relative?0:n)+2*o)/3,r.x2=(r.x+2*i)/3,r.y2=(r.y+2*o)/3}else t=NaN,a=NaN;return r})}function n(t){var a=0,r=0,e=NaN,n=NaN;return function(i){if(isNaN(e)&&!(i.type&SVGPathData.MOVE_TO))throw new Error("path must start with moveto");var o=t(i,a,r,e,n);return i.type&SVGPathData.CLOSE_PATH&&(a=e,r=n),void 0!==i.x&&(a=i.relative?a+i.x:i.x),void 0!==i.y&&(r=i.relative?r+i.y:i.y),i.type&SVGPathData.MOVE_TO&&(e=a,n=r),o}}function i(t,a,r,e,i,o){return assertNumbers(t,a,r,e,i,o),n(function(n,s,h,u){var c=n.x1,m=n.x2,_=n.relative&&!isNaN(u),T=void 0!==n.x?n.x:_?0:s,O=void 0!==n.y?n.y:_?0:h;function p(t){return t*t}n.type&SVGPathData.HORIZ_LINE_TO&&0!==a&&(n.type=SVGPathData.LINE_TO,n.y=n.relative?0:h),n.type&SVGPathData.VERT_LINE_TO&&0!==r&&(n.type=SVGPathData.LINE_TO,n.x=n.relative?0:s),void 0!==n.x&&(n.x=n.x*t+O*r+(_?0:i)),void 0!==n.y&&(n.y=T*a+n.y*e+(_?0:o)),void 0!==n.x1&&(n.x1=n.x1*t+n.y1*r+(_?0:i)),void 0!==n.y1&&(n.y1=c*a+n.y1*e+(_?0:o)),void 0!==n.x2&&(n.x2=n.x2*t+n.y2*r+(_?0:i)),void 0!==n.y2&&(n.y2=m*a+n.y2*e+(_?0:o));var y=t*e-a*r;if(void 0!==n.xRot&&(1!==t||0!==a||0!==r||1!==e))if(0===y)delete n.rX,delete n.rY,delete n.xRot,delete n.lArcFlag,delete n.sweepFlag,n.type=SVGPathData.LINE_TO;else{var S=n.xRot*Math.PI/180,f=Math.sin(S),V=Math.cos(S),N=1/p(n.rX),D=1/p(n.rY),P=p(V)*N+p(f)*D,l=2*f*V*(N-D),v=p(f)*N+p(V)*D,E=P*e*e-l*a*e+v*a*a,A=l*(t*e+a*r)-2*(P*r*e+v*t*a),d=P*r*r-l*t*r+v*t*t,G=(Math.atan2(A,E-d)+Math.PI)%Math.PI/2,C=Math.sin(G),x=Math.cos(G);n.rX=Math.abs(y)/Math.sqrt(E*p(x)+A*C*x+d*p(C)),n.rY=Math.abs(y)/Math.sqrt(E*p(C)-A*C*x+d*p(x)),n.xRot=180*G/Math.PI}return void 0!==n.sweepFlag&&0>y&&(n.sweepFlag=+!n.sweepFlag),n})}function o(){return function(t){var a={};for(var r in t)a[r]=t[r];return a}}t.ROUND=function(t){function a(a){return Math.round(a*t)/t}return void 0===t&&(t=1e13),assertNumbers(t),function(t){return void 0!==t.x1&&(t.x1=a(t.x1)),void 0!==t.y1&&(t.y1=a(t.y1)),void 0!==t.x2&&(t.x2=a(t.x2)),void 0!==t.y2&&(t.y2=a(t.y2)),void 0!==t.x&&(t.x=a(t.x)),void 0!==t.y&&(t.y=a(t.y)),t}},t.TO_ABS=a,t.TO_REL=function(){return n(function(t,a,r){return t.relative||(void 0!==t.x1&&(t.x1-=a),void 0!==t.y1&&(t.y1-=r),void 0!==t.x2&&(t.x2-=a),void 0!==t.y2&&(t.y2-=r),void 0!==t.x&&(t.x-=a),void 0!==t.y&&(t.y-=r),t.relative=!0),t})},t.NORMALIZE_HVZ=function(t,a,r){return void 0===t&&(t=!0),void 0===a&&(a=!0),void 0===r&&(r=!0),n(function(e,n,i,o,s){if(isNaN(o)&&!(e.type&SVGPathData.MOVE_TO))throw new Error("path must start with moveto");return a&&e.type&SVGPathData.HORIZ_LINE_TO&&(e.type=SVGPathData.LINE_TO,e.y=e.relative?0:i),r&&e.type&SVGPathData.VERT_LINE_TO&&(e.type=SVGPathData.LINE_TO,e.x=e.relative?0:n),t&&e.type&SVGPathData.CLOSE_PATH&&(e.type=SVGPathData.LINE_TO,e.x=e.relative?o-n:o,e.y=e.relative?s-i:s),e.type&SVGPathData.ARC&&(0===e.rX||0===e.rY)&&(e.type=SVGPathData.LINE_TO,delete e.rX,delete e.rY,delete e.xRot,delete e.lArcFlag,delete e.sweepFlag),e})},t.NORMALIZE_ST=r,t.QT_TO_C=e,t.INFO=n,t.SANITIZE=function(t){void 0===t&&(t=0),assertNumbers(t);var a=NaN,r=NaN,e=NaN,i=NaN;return n(function(n,o,s,h,u){var c=Math.abs,m=!1,_=0,T=0;if(n.type&SVGPathData.SMOOTH_CURVE_TO&&(_=isNaN(a)?0:o-a,T=isNaN(r)?0:s-r),n.type&(SVGPathData.CURVE_TO|SVGPathData.SMOOTH_CURVE_TO)?(a=n.relative?o+n.x2:n.x2,r=n.relative?s+n.y2:n.y2):(a=NaN,r=NaN),n.type&SVGPathData.SMOOTH_QUAD_TO?(e=isNaN(e)?o:2*o-e,i=isNaN(i)?s:2*s-i):n.type&SVGPathData.QUAD_TO?(e=n.relative?o+n.x1:n.x1,i=n.relative?s+n.y1:n.y2):(e=NaN,i=NaN),n.type&SVGPathData.LINE_COMMANDS||n.type&SVGPathData.ARC&&(0===n.rX||0===n.rY||!n.lArcFlag)||n.type&SVGPathData.CURVE_TO||n.type&SVGPathData.SMOOTH_CURVE_TO||n.type&SVGPathData.QUAD_TO||n.type&SVGPathData.SMOOTH_QUAD_TO){var O=void 0===n.x?0:n.relative?n.x:n.x-o,p=void 0===n.y?0:n.relative?n.y:n.y-s;_=isNaN(e)?void 0===n.x1?_:n.relative?n.x:n.x1-o:e-o,T=isNaN(i)?void 0===n.y1?T:n.relative?n.y:n.y1-s:i-s;var y=void 0===n.x2?0:n.relative?n.x:n.x2-o,S=void 0===n.y2?0:n.relative?n.y:n.y2-s;c(O)<=t&&c(p)<=t&&c(_)<=t&&c(T)<=t&&c(y)<=t&&c(S)<=t&&(m=!0)}return n.type&SVGPathData.CLOSE_PATH&&c(o-h)<=t&&c(s-u)<=t&&(m=!0),m?[]:n})},t.MATRIX=i,t.ROTATE=function(t,a,r){void 0===a&&(a=0),void 0===r&&(r=0),assertNumbers(t,a,r);var e=Math.sin(t),n=Math.cos(t);return i(n,e,-e,n,a-a*n+r*e,r-a*e-r*n)},t.TRANSLATE=function(t,a){return void 0===a&&(a=0),assertNumbers(t,a),i(1,0,0,1,t,a)},t.SCALE=function(t,a){return void 0===a&&(a=t),assertNumbers(t,a),i(t,0,0,a,0,0)},t.SKEW_X=function(t){return assertNumbers(t),i(1,0,Math.atan(t),1,0,0)},t.SKEW_Y=function(t){return assertNumbers(t),i(1,Math.atan(t),0,1,0,0)},t.X_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),assertNumbers(t),i(-1,0,0,1,t,0)},t.Y_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),assertNumbers(t),i(1,0,0,-1,0,t)},t.A_TO_C=function(){return n(function(t,a,r){return SVGPathData.ARC===t.type?a2c(t,t.relative?0:a,t.relative?0:r):t})},t.ANNOTATE_ARCS=function(){return n(function(t,a,r){return t.relative&&(a=0,r=0),SVGPathData.ARC===t.type&&annotateArcCommand(t,a,r),t})},t.CLONE=o,t.CALCULATE_BOUNDS=function(){var t=function(t){var a={};for(var r in t)a[r]=t[r];return a},i=a(),o=e(),s=r(),h=n(function(a,r,e){var n=s(o(i(t(a))));function u(t){t>h.maxX&&(h.maxX=t),t<h.minX&&(h.minX=t)}function c(t){t>h.maxY&&(h.maxY=t),t<h.minY&&(h.minY=t)}if(n.type&SVGPathData.DRAWING_COMMANDS&&(u(r),c(e)),n.type&SVGPathData.HORIZ_LINE_TO&&u(n.x),n.type&SVGPathData.VERT_LINE_TO&&c(n.y),n.type&SVGPathData.LINE_TO&&(u(n.x),c(n.y)),n.type&SVGPathData.CURVE_TO){u(n.x),c(n.y);for(var m=0,_=bezierRoot(r,n.x1,n.x2,n.x);m<_.length;m++)0<(G=_[m])&&1>G&&u(bezierAt(r,n.x1,n.x2,n.x,G));for(var T=0,O=bezierRoot(e,n.y1,n.y2,n.y);T<O.length;T++)0<(G=O[T])&&1>G&&c(bezierAt(e,n.y1,n.y2,n.y,G))}if(n.type&SVGPathData.ARC){u(n.x),c(n.y),annotateArcCommand(n,r,e);for(var p=n.xRot/180*Math.PI,y=Math.cos(p)*n.rX,S=Math.sin(p)*n.rX,f=-Math.sin(p)*n.rY,V=Math.cos(p)*n.rY,N=n.phi1<n.phi2?[n.phi1,n.phi2]:-180>n.phi2?[n.phi2+360,n.phi1+360]:[n.phi2,n.phi1],D=N[0],P=N[1],l=function(t){var a=t[0],r=t[1],e=180*Math.atan2(r,a)/Math.PI;return e<D?e+360:e},v=0,E=intersectionUnitCircleLine(f,-y,0).map(l);v<E.length;v++)(G=E[v])>D&&G<P&&u(arcAt(n.cX,y,f,G));for(var A=0,d=intersectionUnitCircleLine(V,-S,0).map(l);A<d.length;A++){var G;(G=d[A])>D&&G<P&&c(arcAt(n.cY,S,V,G))}}return a});return h.minX=1/0,h.maxX=-1/0,h.minY=1/0,h.maxY=-1/0,h}}(SVGPathDataTransformer||(SVGPathDataTransformer={}));var _a,_a$1,TransformableSVG=function(){function t(){}return t.prototype.round=function(t){return this.transform(SVGPathDataTransformer.ROUND(t))},t.prototype.toAbs=function(){return this.transform(SVGPathDataTransformer.TO_ABS())},t.prototype.toRel=function(){return this.transform(SVGPathDataTransformer.TO_REL())},t.prototype.normalizeHVZ=function(t,a,r){return this.transform(SVGPathDataTransformer.NORMALIZE_HVZ(t,a,r))},t.prototype.normalizeST=function(){return this.transform(SVGPathDataTransformer.NORMALIZE_ST())},t.prototype.qtToC=function(){return this.transform(SVGPathDataTransformer.QT_TO_C())},t.prototype.aToC=function(){return this.transform(SVGPathDataTransformer.A_TO_C())},t.prototype.sanitize=function(t){return this.transform(SVGPathDataTransformer.SANITIZE(t))},t.prototype.translate=function(t,a){return this.transform(SVGPathDataTransformer.TRANSLATE(t,a))},t.prototype.scale=function(t,a){return this.transform(SVGPathDataTransformer.SCALE(t,a))},t.prototype.rotate=function(t,a,r){return this.transform(SVGPathDataTransformer.ROTATE(t,a,r))},t.prototype.matrix=function(t,a,r,e,n,i){return this.transform(SVGPathDataTransformer.MATRIX(t,a,r,e,n,i))},t.prototype.skewX=function(t){return this.transform(SVGPathDataTransformer.SKEW_X(t))},t.prototype.skewY=function(t){return this.transform(SVGPathDataTransformer.SKEW_Y(t))},t.prototype.xSymmetry=function(t){return this.transform(SVGPathDataTransformer.X_AXIS_SYMMETRY(t))},t.prototype.ySymmetry=function(t){return this.transform(SVGPathDataTransformer.Y_AXIS_SYMMETRY(t))},t.prototype.annotateArcs=function(){return this.transform(SVGPathDataTransformer.ANNOTATE_ARCS())},t}(),isWhiteSpace=function(t){return" "===t||"\t"===t||"\r"===t||"\n"===t},isDigit=function(t){return"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0)},SVGPathDataParser$$1=function(t){function a(){var a=t.call(this)||this;return a.curNumber="",a.curCommandType=-1,a.curCommandRelative=!1,a.canParseCommandOrComma=!0,a.curNumberHasExp=!1,a.curNumberHasExpDigits=!1,a.curNumberHasDecimal=!1,a.curArgs=[],a}return __extends(a,t),a.prototype.finish=function(t){if(void 0===t&&(t=[]),this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t},a.prototype.parse=function(t,a){var r=this;void 0===a&&(a=[]);for(var e=function(t){a.push(t),r.curArgs.length=0,r.canParseCommandOrComma=!0},n=0;n<t.length;n++){var i=t[n];if(isDigit(i))this.curNumber+=i,this.curNumberHasExpDigits=this.curNumberHasExp;else if("e"!==i&&"E"!==i)if("-"!==i&&"+"!==i||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==i||this.curNumberHasExp||this.curNumberHasDecimal){if(this.curNumber&&-1!==this.curCommandType){var o=Number(this.curNumber);if(isNaN(o))throw new SyntaxError("Invalid number ending at "+n);if(this.curCommandType===SVGPathData.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>o)throw new SyntaxError('Expected positive number, got "'+o+'" at index "'+n+'"')}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+n+'"');this.curArgs.push(o),this.curArgs.length===COMMAND_ARG_COUNTS[this.curCommandType]&&(SVGPathData.HORIZ_LINE_TO===this.curCommandType?e({type:SVGPathData.HORIZ_LINE_TO,relative:this.curCommandRelative,x:o}):SVGPathData.VERT_LINE_TO===this.curCommandType?e({type:SVGPathData.VERT_LINE_TO,relative:this.curCommandRelative,y:o}):this.curCommandType===SVGPathData.MOVE_TO||this.curCommandType===SVGPathData.LINE_TO||this.curCommandType===SVGPathData.SMOOTH_QUAD_TO?(e({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),SVGPathData.MOVE_TO===this.curCommandType&&(this.curCommandType=SVGPathData.LINE_TO)):this.curCommandType===SVGPathData.CURVE_TO?e({type:SVGPathData.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===SVGPathData.SMOOTH_CURVE_TO?e({type:SVGPathData.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===SVGPathData.QUAD_TO?e({type:SVGPathData.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===SVGPathData.ARC&&e({type:SVGPathData.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!isWhiteSpace(i))if(","===i&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==i&&"-"!==i&&"."!==i){if(0!==this.curArgs.length)throw new SyntaxError("Unterminated command at index "+n+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+i+'" at index '+n+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,"z"!==i&&"Z"!==i)if("h"===i||"H"===i)this.curCommandType=SVGPathData.HORIZ_LINE_TO,this.curCommandRelative="h"===i;else if("v"===i||"V"===i)this.curCommandType=SVGPathData.VERT_LINE_TO,this.curCommandRelative="v"===i;else if("m"===i||"M"===i)this.curCommandType=SVGPathData.MOVE_TO,this.curCommandRelative="m"===i;else if("l"===i||"L"===i)this.curCommandType=SVGPathData.LINE_TO,this.curCommandRelative="l"===i;else if("c"===i||"C"===i)this.curCommandType=SVGPathData.CURVE_TO,this.curCommandRelative="c"===i;else if("s"===i||"S"===i)this.curCommandType=SVGPathData.SMOOTH_CURVE_TO,this.curCommandRelative="s"===i;else if("q"===i||"Q"===i)this.curCommandType=SVGPathData.QUAD_TO,this.curCommandRelative="q"===i;else if("t"===i||"T"===i)this.curCommandType=SVGPathData.SMOOTH_QUAD_TO,this.curCommandRelative="t"===i;else{if("a"!==i&&"A"!==i)throw new SyntaxError('Unexpected character "'+i+'" at index '+n+".");this.curCommandType=SVGPathData.ARC,this.curCommandRelative="a"===i}else a.push({type:SVGPathData.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=i,this.curNumberHasDecimal="."===i}else this.curNumber+=i,this.curNumberHasDecimal=!0;else this.curNumber+=i;else this.curNumber+=i,this.curNumberHasExp=!0}return a},a.prototype.transform=function(t){return Object.create(this,{parse:{value:function(a,r){void 0===r&&(r=[]);for(var e=0,n=Object.getPrototypeOf(this).parse.call(this,a);e<n.length;e++){var i=n[e],o=t(i);Array.isArray(o)?r.push.apply(r,o):r.push(o)}return r}}})},a}(TransformableSVG),SVGPathData=function(t){function a(r){var e=t.call(this)||this;return e.commands="string"==typeof r?a.parse(r):r,e}return __extends(a,t),a.prototype.encode=function(){return a.encode(this.commands)},a.prototype.getBounds=function(){var t=SVGPathDataTransformer.CALCULATE_BOUNDS();return this.transform(t),t},a.prototype.transform=function(t){for(var a=[],r=0,e=this.commands;r<e.length;r++){var n=t(e[r]);Array.isArray(n)?a.push.apply(a,n):a.push(n)}return this.commands=a,this},a.encode=function(t){return encodeSVGPath$$1(t)},a.parse=function(t){var a=new SVGPathDataParser$$1,r=[];return a.parse(t,r),a.finish(r),r},a.CLOSE_PATH=1,a.MOVE_TO=2,a.HORIZ_LINE_TO=4,a.VERT_LINE_TO=8,a.LINE_TO=16,a.CURVE_TO=32,a.SMOOTH_CURVE_TO=64,a.QUAD_TO=128,a.SMOOTH_QUAD_TO=256,a.ARC=512,a.LINE_COMMANDS=a.LINE_TO|a.HORIZ_LINE_TO|a.VERT_LINE_TO,a.DRAWING_COMMANDS=a.HORIZ_LINE_TO|a.VERT_LINE_TO|a.LINE_TO|a.CURVE_TO|a.SMOOTH_CURVE_TO|a.QUAD_TO|a.SMOOTH_QUAD_TO|a.ARC,a}(TransformableSVG),COMMAND_ARG_COUNTS=((_a={})[SVGPathData.MOVE_TO]=2,_a[SVGPathData.LINE_TO]=2,_a[SVGPathData.HORIZ_LINE_TO]=1,_a[SVGPathData.VERT_LINE_TO]=1,_a[SVGPathData.CLOSE_PATH]=0,_a[SVGPathData.QUAD_TO]=4,_a[SVGPathData.SMOOTH_QUAD_TO]=2,_a[SVGPathData.CURVE_TO]=6,_a[SVGPathData.SMOOTH_CURVE_TO]=4,_a[SVGPathData.ARC]=7,_a),WSP=" ";function encodeSVGPath$$1(t){var a="";Array.isArray(t)||(t=[t]);for(var r=0;r<t.length;r++){var e=t[r];if(e.type===SVGPathData.CLOSE_PATH)a+="z";else if(e.type===SVGPathData.HORIZ_LINE_TO)a+=(e.relative?"h":"H")+e.x;else if(e.type===SVGPathData.VERT_LINE_TO)a+=(e.relative?"v":"V")+e.y;else if(e.type===SVGPathData.MOVE_TO)a+=(e.relative?"m":"M")+e.x+WSP+e.y;else if(e.type===SVGPathData.LINE_TO)a+=(e.relative?"l":"L")+e.x+WSP+e.y;else if(e.type===SVGPathData.CURVE_TO)a+=(e.relative?"c":"C")+e.x1+WSP+e.y1+WSP+e.x2+WSP+e.y2+WSP+e.x+WSP+e.y;else if(e.type===SVGPathData.SMOOTH_CURVE_TO)a+=(e.relative?"s":"S")+e.x2+WSP+e.y2+WSP+e.x+WSP+e.y;else if(e.type===SVGPathData.QUAD_TO)a+=(e.relative?"q":"Q")+e.x1+WSP+e.y1+WSP+e.x+WSP+e.y;else if(e.type===SVGPathData.SMOOTH_QUAD_TO)a+=(e.relative?"t":"T")+e.x+WSP+e.y;else{if(e.type!==SVGPathData.ARC)throw new Error('Unexpected command type "'+e.type+'" at index '+r+".");a+=(e.relative?"a":"A")+e.rX+WSP+e.rY+WSP+e.xRot+WSP+ +e.lArcFlag+WSP+ +e.sweepFlag+WSP+e.x+WSP+e.y}}return a}var SVGPathData$1=function(t){function a(r){var e=t.call(this)||this;return e.commands="string"==typeof r?a.parse(r):r,e}return __extends(a,t),a.prototype.encode=function(){return a.encode(this.commands)},a.prototype.getBounds=function(){var t=SVGPathDataTransformer.CALCULATE_BOUNDS();return this.transform(t),t},a.prototype.transform=function(t){for(var a=[],r=0,e=this.commands;r<e.length;r++){var n=t(e[r]);Array.isArray(n)?a.push.apply(a,n):a.push(n)}return this.commands=a,this},a.encode=function(t){return encodeSVGPath$$1(t)},a.parse=function(t){var a=new SVGPathDataParser$$1,r=[];return a.parse(t,r),a.finish(r),r},a.CLOSE_PATH=1,a.MOVE_TO=2,a.HORIZ_LINE_TO=4,a.VERT_LINE_TO=8,a.LINE_TO=16,a.CURVE_TO=32,a.SMOOTH_CURVE_TO=64,a.QUAD_TO=128,a.SMOOTH_QUAD_TO=256,a.ARC=512,a.LINE_COMMANDS=a.LINE_TO|a.HORIZ_LINE_TO|a.VERT_LINE_TO,a.DRAWING_COMMANDS=a.HORIZ_LINE_TO|a.VERT_LINE_TO|a.LINE_TO|a.CURVE_TO|a.SMOOTH_CURVE_TO|a.QUAD_TO|a.SMOOTH_QUAD_TO|a.ARC,a}(TransformableSVG),COMMAND_ARG_COUNTS$1=((_a$1={})[SVGPathData$1.MOVE_TO]=2,_a$1[SVGPathData$1.LINE_TO]=2,_a$1[SVGPathData$1.HORIZ_LINE_TO]=1,_a$1[SVGPathData$1.VERT_LINE_TO]=1,_a$1[SVGPathData$1.CLOSE_PATH]=0,_a$1[SVGPathData$1.QUAD_TO]=4,_a$1[SVGPathData$1.SMOOTH_QUAD_TO]=2,_a$1[SVGPathData$1.CURVE_TO]=6,_a$1[SVGPathData$1.SMOOTH_CURVE_TO]=4,_a$1[SVGPathData$1.ARC]=7,_a$1);export{SVGPathData$1 as SVGPathData,COMMAND_ARG_COUNTS$1 as COMMAND_ARG_COUNTS,encodeSVGPath$$1 as encodeSVGPath,SVGPathDataParser$$1 as SVGPathDataParser,SVGPathDataTransformer};
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};function r(r,e){function i(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function e(t,r){var e=t[0],i=t[1];return[e*Math.cos(r)-i*Math.sin(r),e*Math.sin(r)+i*Math.cos(r)]}function i(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var e=0;e<t.length;e++)if("number"!=typeof t[e])throw new Error("assertNumbers arguments["+e+"] is not a number. "+typeof t[e]+" == typeof "+t[e]);return!0}var a=Math.PI;function n(t,r,i){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;var n=t.rX,o=t.rY,s=t.x,u=t.y;n=Math.abs(t.rX),o=Math.abs(t.rY);var c=e([(r-s)/2,(i-u)/2],-t.xRot/180*a),h=c[0],y=c[1],p=Math.pow(h,2)/Math.pow(n,2)+Math.pow(y,2)/Math.pow(o,2);1<p&&(n*=Math.sqrt(p),o*=Math.sqrt(p)),t.rX=n,t.rY=o;var O=Math.pow(n,2)*Math.pow(y,2)+Math.pow(o,2)*Math.pow(h,2),m=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(n,2)*Math.pow(o,2)-O)/O)),T=n*y/o*m,_=-o*h/n*m,v=e([T,_],t.xRot/180*a);t.cX=v[0]+(r+s)/2,t.cY=v[1]+(i+u)/2,t.phi1=Math.atan2((y-_)/o,(h-T)/n),t.phi2=Math.atan2((-y-_)/o,(-h-T)/n),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*a),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*a),t.phi1*=180/a,t.phi2*=180/a}function o(t,r,e){i(t,r,e);var a=t*t+r*r-e*e;if(0>a)return[];if(0===a)return[[t*e/(t*t+r*r),r*e/(t*t+r*r)]];var n=Math.sqrt(a);return[[(t*e+r*n)/(t*t+r*r),(r*e-t*n)/(t*t+r*r)],[(t*e-r*n)/(t*t+r*r),(r*e+t*n)/(t*t+r*r)]]}var s,u=Math.PI/180;function c(t,r,e){return(1-e)*t+e*r}function h(t,r,e,i){return t+Math.cos(i/180*a)*r+Math.sin(i/180*a)*e}function y(t,r,e,i){var a=r-t,n=e-r,o=3*a+3*(i-e)-6*n,s=6*(n-a),u=3*a;return Math.abs(o)<1e-6?[-u/s]:function(t,r,e){void 0===e&&(e=1e-6);var i=t*t/4-r;if(i<-e)return[];if(i<=e)return[-t/2];var a=Math.sqrt(i);return[-t/2-a,-t/2+a]}(s/o,u/o,1e-6)}function p(t,r,e,i,a){var n=1-a;return t*(n*n*n)+r*(3*n*n*a)+e*(3*n*a*a)+i*(a*a*a)}!function(t){function r(){return O((function(t,r,e){return t.relative&&(void 0!==t.x1&&(t.x1+=r),void 0!==t.y1&&(t.y1+=e),void 0!==t.x2&&(t.x2+=r),void 0!==t.y2&&(t.y2+=e),void 0!==t.x&&(t.x+=r),void 0!==t.y&&(t.y+=e),t.relative=!1),t}))}function a(){var t=NaN,r=NaN,e=NaN,i=NaN;return O((function(a,n,o){return a.type&l.SMOOTH_CURVE_TO&&(a.type=l.CURVE_TO,t=isNaN(t)?n:t,r=isNaN(r)?o:r,a.x1=a.relative?n-t:2*n-t,a.y1=a.relative?o-r:2*o-r),a.type&l.CURVE_TO?(t=a.relative?n+a.x2:a.x2,r=a.relative?o+a.y2:a.y2):(t=NaN,r=NaN),a.type&l.SMOOTH_QUAD_TO&&(a.type=l.QUAD_TO,e=isNaN(e)?n:e,i=isNaN(i)?o:i,a.x1=a.relative?n-e:2*n-e,a.y1=a.relative?o-i:2*o-i),a.type&l.QUAD_TO?(e=a.relative?n+a.x1:a.x1,i=a.relative?o+a.y1:a.y1):(e=NaN,i=NaN),a}))}function s(){var t=NaN,r=NaN;return O((function(e,i,a){if(e.type&l.SMOOTH_QUAD_TO&&(e.type=l.QUAD_TO,t=isNaN(t)?i:t,r=isNaN(r)?a:r,e.x1=e.relative?i-t:2*i-t,e.y1=e.relative?a-r:2*a-r),e.type&l.QUAD_TO){t=e.relative?i+e.x1:e.x1,r=e.relative?a+e.y1:e.y1;var n=e.x1,o=e.y1;e.type=l.CURVE_TO,e.x1=((e.relative?0:i)+2*n)/3,e.y1=((e.relative?0:a)+2*o)/3,e.x2=(e.x+2*n)/3,e.y2=(e.y+2*o)/3}else t=NaN,r=NaN;return e}))}function O(t){var r=0,e=0,i=NaN,a=NaN;return function(n){if(isNaN(i)&&!(n.type&l.MOVE_TO))throw new Error("path must start with moveto");var o=t(n,r,e,i,a);return n.type&l.CLOSE_PATH&&(r=i,e=a),void 0!==n.x&&(r=n.relative?r+n.x:n.x),void 0!==n.y&&(e=n.relative?e+n.y:n.y),n.type&l.MOVE_TO&&(i=r,a=e),o}}function m(t,r,e,a,n,o){return i(t,r,e,a,n,o),O((function(i,s,u,c){var h=i.x1,y=i.x2,p=i.relative&&!isNaN(c),O=void 0!==i.x?i.x:p?0:s,m=void 0!==i.y?i.y:p?0:u;function T(t){return t*t}i.type&l.HORIZ_LINE_TO&&0!==r&&(i.type=l.LINE_TO,i.y=i.relative?0:u),i.type&l.VERT_LINE_TO&&0!==e&&(i.type=l.LINE_TO,i.x=i.relative?0:s),void 0!==i.x&&(i.x=i.x*t+m*e+(p?0:n)),void 0!==i.y&&(i.y=O*r+i.y*a+(p?0:o)),void 0!==i.x1&&(i.x1=i.x1*t+i.y1*e+(p?0:n)),void 0!==i.y1&&(i.y1=h*r+i.y1*a+(p?0:o)),void 0!==i.x2&&(i.x2=i.x2*t+i.y2*e+(p?0:n)),void 0!==i.y2&&(i.y2=y*r+i.y2*a+(p?0:o));var _=t*a-r*e;if(void 0!==i.xRot&&(1!==t||0!==r||0!==e||1!==a))if(0===_)delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag,i.type=l.LINE_TO;else{var v=i.xRot*Math.PI/180,f=Math.sin(v),N=Math.cos(v),E=1/T(i.rX),A=1/T(i.rY),d=T(N)*E+T(f)*A,x=2*f*N*(E-A),C=T(f)*E+T(N)*A,M=d*a*a-x*r*a+C*r*r,R=x*(t*a+r*e)-2*(d*e*a+C*t*r),I=d*e*e-x*t*e+C*t*t,g=(Math.atan2(R,M-I)+Math.PI)%Math.PI/2,S=Math.sin(g),L=Math.cos(g);i.rX=Math.abs(_)/Math.sqrt(M*T(L)+R*S*L+I*T(S)),i.rY=Math.abs(_)/Math.sqrt(M*T(S)-R*S*L+I*T(L)),i.xRot=180*g/Math.PI}return void 0!==i.sweepFlag&&0>_&&(i.sweepFlag=+!i.sweepFlag),i}))}function T(){return function(t){var r={};for(var e in t)r[e]=t[e];return r}}t.ROUND=function(t){function r(r){return Math.round(r*t)/t}return void 0===t&&(t=1e13),i(t),function(t){return void 0!==t.x1&&(t.x1=r(t.x1)),void 0!==t.y1&&(t.y1=r(t.y1)),void 0!==t.x2&&(t.x2=r(t.x2)),void 0!==t.y2&&(t.y2=r(t.y2)),void 0!==t.x&&(t.x=r(t.x)),void 0!==t.y&&(t.y=r(t.y)),void 0!==t.rX&&(t.rX=r(t.rX)),void 0!==t.rY&&(t.rY=r(t.rY)),t}},t.TO_ABS=r,t.TO_REL=function(){return O((function(t,r,e){return t.relative||(void 0!==t.x1&&(t.x1-=r),void 0!==t.y1&&(t.y1-=e),void 0!==t.x2&&(t.x2-=r),void 0!==t.y2&&(t.y2-=e),void 0!==t.x&&(t.x-=r),void 0!==t.y&&(t.y-=e),t.relative=!0),t}))},t.NORMALIZE_HVZ=function(t,r,e){return void 0===t&&(t=!0),void 0===r&&(r=!0),void 0===e&&(e=!0),O((function(i,a,n,o,s){if(isNaN(o)&&!(i.type&l.MOVE_TO))throw new Error("path must start with moveto");return r&&i.type&l.HORIZ_LINE_TO&&(i.type=l.LINE_TO,i.y=i.relative?0:n),e&&i.type&l.VERT_LINE_TO&&(i.type=l.LINE_TO,i.x=i.relative?0:a),t&&i.type&l.CLOSE_PATH&&(i.type=l.LINE_TO,i.x=i.relative?o-a:o,i.y=i.relative?s-n:s),i.type&l.ARC&&(0===i.rX||0===i.rY)&&(i.type=l.LINE_TO,delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag),i}))},t.NORMALIZE_ST=a,t.QT_TO_C=s,t.INFO=O,t.SANITIZE=function(t){void 0===t&&(t=0),i(t);var r=NaN,e=NaN,a=NaN,n=NaN;return O((function(i,o,s,u,c){var h=Math.abs,y=!1,p=0,O=0;if(i.type&l.SMOOTH_CURVE_TO&&(p=isNaN(r)?0:o-r,O=isNaN(e)?0:s-e),i.type&(l.CURVE_TO|l.SMOOTH_CURVE_TO)?(r=i.relative?o+i.x2:i.x2,e=i.relative?s+i.y2:i.y2):(r=NaN,e=NaN),i.type&l.SMOOTH_QUAD_TO?(a=isNaN(a)?o:2*o-a,n=isNaN(n)?s:2*s-n):i.type&l.QUAD_TO?(a=i.relative?o+i.x1:i.x1,n=i.relative?s+i.y1:i.y2):(a=NaN,n=NaN),i.type&l.LINE_COMMANDS||i.type&l.ARC&&(0===i.rX||0===i.rY||!i.lArcFlag)||i.type&l.CURVE_TO||i.type&l.SMOOTH_CURVE_TO||i.type&l.QUAD_TO||i.type&l.SMOOTH_QUAD_TO){var m=void 0===i.x?0:i.relative?i.x:i.x-o,T=void 0===i.y?0:i.relative?i.y:i.y-s;p=isNaN(a)?void 0===i.x1?p:i.relative?i.x:i.x1-o:a-o,O=isNaN(n)?void 0===i.y1?O:i.relative?i.y:i.y1-s:n-s;var _=void 0===i.x2?0:i.relative?i.x:i.x2-o,v=void 0===i.y2?0:i.relative?i.y:i.y2-s;h(m)<=t&&h(T)<=t&&h(p)<=t&&h(O)<=t&&h(_)<=t&&h(v)<=t&&(y=!0)}return i.type&l.CLOSE_PATH&&h(o-u)<=t&&h(s-c)<=t&&(y=!0),y?[]:i}))},t.MATRIX=m,t.ROTATE=function(t,r,e){void 0===r&&(r=0),void 0===e&&(e=0),i(t,r,e);var a=Math.sin(t),n=Math.cos(t);return m(n,a,-a,n,r-r*n+e*a,e-r*a-e*n)},t.TRANSLATE=function(t,r){return void 0===r&&(r=0),i(t,r),m(1,0,0,1,t,r)},t.SCALE=function(t,r){return void 0===r&&(r=t),i(t,r),m(t,0,0,r,0,0)},t.SKEW_X=function(t){return i(t),m(1,0,Math.atan(t),1,0,0)},t.SKEW_Y=function(t){return i(t),m(1,Math.atan(t),0,1,0,0)},t.X_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),i(t),m(-1,0,0,1,t,0)},t.Y_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),i(t),m(1,0,0,-1,0,t)},t.A_TO_C=function(){return O((function(t,r,i){return l.ARC===t.type?function(t,r,i){var a,o,s,h;t.cX||n(t,r,i);for(var y=Math.min(t.phi1,t.phi2),p=Math.max(t.phi1,t.phi2)-y,O=Math.ceil(p/90),m=new Array(O),T=r,_=i,v=0;v<O;v++){var f=c(t.phi1,t.phi2,v/O),N=c(t.phi1,t.phi2,(v+1)/O),E=N-f,A=4/3*Math.tan(E*u/4),d=[Math.cos(f*u)-A*Math.sin(f*u),Math.sin(f*u)+A*Math.cos(f*u)],x=d[0],C=d[1],M=[Math.cos(N*u),Math.sin(N*u)],R=M[0],I=M[1],g=[R+A*Math.sin(N*u),I-A*Math.cos(N*u)],S=g[0],L=g[1];m[v]={relative:t.relative,type:l.CURVE_TO};var U=function(r,i){var a=e([r*t.rX,i*t.rY],t.xRot),n=a[0],o=a[1];return[t.cX+n,t.cY+o]};a=U(x,C),m[v].x1=a[0],m[v].y1=a[1],o=U(S,L),m[v].x2=o[0],m[v].y2=o[1],s=U(R,I),m[v].x=s[0],m[v].y=s[1],t.relative&&(m[v].x1-=T,m[v].y1-=_,m[v].x2-=T,m[v].y2-=_,m[v].x-=T,m[v].y-=_),T=(h=[m[v].x,m[v].y])[0],_=h[1]}return m}(t,t.relative?0:r,t.relative?0:i):t}))},t.ANNOTATE_ARCS=function(){return O((function(t,r,e){return t.relative&&(r=0,e=0),l.ARC===t.type&&n(t,r,e),t}))},t.CLONE=T,t.CALCULATE_BOUNDS=function(){var t=function(t){var r={};for(var e in t)r[e]=t[e];return r},e=r(),i=s(),u=a(),c=O((function(r,a,s){var O=u(i(e(t(r))));function m(t){t>c.maxX&&(c.maxX=t),t<c.minX&&(c.minX=t)}function T(t){t>c.maxY&&(c.maxY=t),t<c.minY&&(c.minY=t)}if(O.type&l.DRAWING_COMMANDS&&(m(a),T(s)),O.type&l.HORIZ_LINE_TO&&m(O.x),O.type&l.VERT_LINE_TO&&T(O.y),O.type&l.LINE_TO&&(m(O.x),T(O.y)),O.type&l.CURVE_TO){m(O.x),T(O.y);for(var _=0,v=y(a,O.x1,O.x2,O.x);_<v.length;_++){0<(V=v[_])&&1>V&&m(p(a,O.x1,O.x2,O.x,V))}for(var f=0,N=y(s,O.y1,O.y2,O.y);f<N.length;f++){0<(V=N[f])&&1>V&&T(p(s,O.y1,O.y2,O.y,V))}}if(O.type&l.ARC){m(O.x),T(O.y),n(O,a,s);for(var E=O.xRot/180*Math.PI,A=Math.cos(E)*O.rX,d=Math.sin(E)*O.rX,x=-Math.sin(E)*O.rY,C=Math.cos(E)*O.rY,M=O.phi1<O.phi2?[O.phi1,O.phi2]:-180>O.phi2?[O.phi2+360,O.phi1+360]:[O.phi2,O.phi1],R=M[0],I=M[1],g=function(t){var r=t[0],e=t[1],i=180*Math.atan2(e,r)/Math.PI;return i<R?i+360:i},S=0,L=o(x,-A,0).map(g);S<L.length;S++){(V=L[S])>R&&V<I&&m(h(O.cX,A,x,V))}for(var U=0,H=o(C,-d,0).map(g);U<H.length;U++){var V;(V=H[U])>R&&V<I&&T(h(O.cY,d,C,V))}}return r}));return c.minX=1/0,c.maxX=-1/0,c.minY=1/0,c.maxY=-1/0,c}}(s||(s={}));var O,m,T=function(){function t(){}return t.prototype.round=function(t){return this.transform(s.ROUND(t))},t.prototype.toAbs=function(){return this.transform(s.TO_ABS())},t.prototype.toRel=function(){return this.transform(s.TO_REL())},t.prototype.normalizeHVZ=function(t,r,e){return this.transform(s.NORMALIZE_HVZ(t,r,e))},t.prototype.normalizeST=function(){return this.transform(s.NORMALIZE_ST())},t.prototype.qtToC=function(){return this.transform(s.QT_TO_C())},t.prototype.aToC=function(){return this.transform(s.A_TO_C())},t.prototype.sanitize=function(t){return this.transform(s.SANITIZE(t))},t.prototype.translate=function(t,r){return this.transform(s.TRANSLATE(t,r))},t.prototype.scale=function(t,r){return this.transform(s.SCALE(t,r))},t.prototype.rotate=function(t,r,e){return this.transform(s.ROTATE(t,r,e))},t.prototype.matrix=function(t,r,e,i,a,n){return this.transform(s.MATRIX(t,r,e,i,a,n))},t.prototype.skewX=function(t){return this.transform(s.SKEW_X(t))},t.prototype.skewY=function(t){return this.transform(s.SKEW_Y(t))},t.prototype.xSymmetry=function(t){return this.transform(s.X_AXIS_SYMMETRY(t))},t.prototype.ySymmetry=function(t){return this.transform(s.Y_AXIS_SYMMETRY(t))},t.prototype.annotateArcs=function(){return this.transform(s.ANNOTATE_ARCS())},t}(),_=function(t){return" "===t||"\t"===t||"\r"===t||"\n"===t},v=function(t){return"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0)},f=function(t){function e(){var r=t.call(this)||this;return r.curNumber="",r.curCommandType=-1,r.curCommandRelative=!1,r.canParseCommandOrComma=!0,r.curNumberHasExp=!1,r.curNumberHasExpDigits=!1,r.curNumberHasDecimal=!1,r.curArgs=[],r}return r(e,t),e.prototype.finish=function(t){if(void 0===t&&(t=[]),this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t},e.prototype.parse=function(t,r){var e=this;void 0===r&&(r=[]);for(var i=function(t){r.push(t),e.curArgs.length=0,e.canParseCommandOrComma=!0},a=0;a<t.length;a++){var n=t[a];if(v(n))this.curNumber+=n,this.curNumberHasExpDigits=this.curNumberHasExp;else if("e"!==n&&"E"!==n)if("-"!==n&&"+"!==n||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==n||this.curNumberHasExp||this.curNumberHasDecimal){if(this.curNumber&&-1!==this.curCommandType){var o=Number(this.curNumber);if(isNaN(o))throw new SyntaxError("Invalid number ending at "+a);if(this.curCommandType===l.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>o)throw new SyntaxError('Expected positive number, got "'+o+'" at index "'+a+'"')}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+a+'"');this.curArgs.push(o),this.curArgs.length===N[this.curCommandType]&&(l.HORIZ_LINE_TO===this.curCommandType?i({type:l.HORIZ_LINE_TO,relative:this.curCommandRelative,x:o}):l.VERT_LINE_TO===this.curCommandType?i({type:l.VERT_LINE_TO,relative:this.curCommandRelative,y:o}):this.curCommandType===l.MOVE_TO||this.curCommandType===l.LINE_TO||this.curCommandType===l.SMOOTH_QUAD_TO?(i({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),l.MOVE_TO===this.curCommandType&&(this.curCommandType=l.LINE_TO)):this.curCommandType===l.CURVE_TO?i({type:l.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===l.SMOOTH_CURVE_TO?i({type:l.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===l.QUAD_TO?i({type:l.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===l.ARC&&i({type:l.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!_(n))if(","===n&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==n&&"-"!==n&&"."!==n){if(0!==this.curArgs.length)throw new SyntaxError("Unterminated command at index "+a+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+n+'" at index '+a+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,"z"!==n&&"Z"!==n)if("h"===n||"H"===n)this.curCommandType=l.HORIZ_LINE_TO,this.curCommandRelative="h"===n;else if("v"===n||"V"===n)this.curCommandType=l.VERT_LINE_TO,this.curCommandRelative="v"===n;else if("m"===n||"M"===n)this.curCommandType=l.MOVE_TO,this.curCommandRelative="m"===n;else if("l"===n||"L"===n)this.curCommandType=l.LINE_TO,this.curCommandRelative="l"===n;else if("c"===n||"C"===n)this.curCommandType=l.CURVE_TO,this.curCommandRelative="c"===n;else if("s"===n||"S"===n)this.curCommandType=l.SMOOTH_CURVE_TO,this.curCommandRelative="s"===n;else if("q"===n||"Q"===n)this.curCommandType=l.QUAD_TO,this.curCommandRelative="q"===n;else if("t"===n||"T"===n)this.curCommandType=l.SMOOTH_QUAD_TO,this.curCommandRelative="t"===n;else{if("a"!==n&&"A"!==n)throw new SyntaxError('Unexpected character "'+n+'" at index '+a+".");this.curCommandType=l.ARC,this.curCommandRelative="a"===n}else r.push({type:l.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=n,this.curNumberHasDecimal="."===n}else this.curNumber+=n,this.curNumberHasDecimal=!0;else this.curNumber+=n;else this.curNumber+=n,this.curNumberHasExp=!0}return r},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(r,e){void 0===e&&(e=[]);for(var i=0,a=Object.getPrototypeOf(this).parse.call(this,r);i<a.length;i++){var n=a[i],o=t(n);Array.isArray(o)?e.push.apply(e,o):e.push(o)}return e}}})},e}(T),l=function(t){function e(r){var i=t.call(this)||this;return i.commands="string"==typeof r?e.parse(r):r,i}return r(e,t),e.prototype.encode=function(){return e.encode(this.commands)},e.prototype.getBounds=function(){var t=s.CALCULATE_BOUNDS();return this.transform(t),t},e.prototype.transform=function(t){for(var r=[],e=0,i=this.commands;e<i.length;e++){var a=t(i[e]);Array.isArray(a)?r.push.apply(r,a):r.push(a)}return this.commands=r,this},e.encode=function(t){return E(t)},e.parse=function(t){var r=new f,e=[];return r.parse(t,e),r.finish(e),e},e.CLOSE_PATH=1,e.MOVE_TO=2,e.HORIZ_LINE_TO=4,e.VERT_LINE_TO=8,e.LINE_TO=16,e.CURVE_TO=32,e.SMOOTH_CURVE_TO=64,e.QUAD_TO=128,e.SMOOTH_QUAD_TO=256,e.ARC=512,e.LINE_COMMANDS=e.LINE_TO|e.HORIZ_LINE_TO|e.VERT_LINE_TO,e.DRAWING_COMMANDS=e.HORIZ_LINE_TO|e.VERT_LINE_TO|e.LINE_TO|e.CURVE_TO|e.SMOOTH_CURVE_TO|e.QUAD_TO|e.SMOOTH_QUAD_TO|e.ARC,e}(T),N=((O={})[l.MOVE_TO]=2,O[l.LINE_TO]=2,O[l.HORIZ_LINE_TO]=1,O[l.VERT_LINE_TO]=1,O[l.CLOSE_PATH]=0,O[l.QUAD_TO]=4,O[l.SMOOTH_QUAD_TO]=2,O[l.CURVE_TO]=6,O[l.SMOOTH_CURVE_TO]=4,O[l.ARC]=7,O);function E(t){var r="";Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=t[e];if(i.type===l.CLOSE_PATH)r+="z";else if(i.type===l.HORIZ_LINE_TO)r+=(i.relative?"h":"H")+i.x;else if(i.type===l.VERT_LINE_TO)r+=(i.relative?"v":"V")+i.y;else if(i.type===l.MOVE_TO)r+=(i.relative?"m":"M")+i.x+" "+i.y;else if(i.type===l.LINE_TO)r+=(i.relative?"l":"L")+i.x+" "+i.y;else if(i.type===l.CURVE_TO)r+=(i.relative?"c":"C")+i.x1+" "+i.y1+" "+i.x2+" "+i.y2+" "+i.x+" "+i.y;else if(i.type===l.SMOOTH_CURVE_TO)r+=(i.relative?"s":"S")+i.x2+" "+i.y2+" "+i.x+" "+i.y;else if(i.type===l.QUAD_TO)r+=(i.relative?"q":"Q")+i.x1+" "+i.y1+" "+i.x+" "+i.y;else if(i.type===l.SMOOTH_QUAD_TO)r+=(i.relative?"t":"T")+i.x+" "+i.y;else{if(i.type!==l.ARC)throw new Error('Unexpected command type "'+i.type+'" at index '+e+".");r+=(i.relative?"a":"A")+i.rX+" "+i.rY+" "+i.xRot+" "+ +i.lArcFlag+" "+ +i.sweepFlag+" "+i.x+" "+i.y}}return r}var A=function(t){function e(r){var i=t.call(this)||this;return i.commands="string"==typeof r?e.parse(r):r,i}return r(e,t),e.prototype.encode=function(){return e.encode(this.commands)},e.prototype.getBounds=function(){var t=s.CALCULATE_BOUNDS();return this.transform(t),t},e.prototype.transform=function(t){for(var r=[],e=0,i=this.commands;e<i.length;e++){var a=t(i[e]);Array.isArray(a)?r.push.apply(r,a):r.push(a)}return this.commands=r,this},e.encode=function(t){return E(t)},e.parse=function(t){var r=new f,e=[];return r.parse(t,e),r.finish(e),e},e.CLOSE_PATH=1,e.MOVE_TO=2,e.HORIZ_LINE_TO=4,e.VERT_LINE_TO=8,e.LINE_TO=16,e.CURVE_TO=32,e.SMOOTH_CURVE_TO=64,e.QUAD_TO=128,e.SMOOTH_QUAD_TO=256,e.ARC=512,e.LINE_COMMANDS=e.LINE_TO|e.HORIZ_LINE_TO|e.VERT_LINE_TO,e.DRAWING_COMMANDS=e.HORIZ_LINE_TO|e.VERT_LINE_TO|e.LINE_TO|e.CURVE_TO|e.SMOOTH_CURVE_TO|e.QUAD_TO|e.SMOOTH_QUAD_TO|e.ARC,e}(T),d=((m={})[A.MOVE_TO]=2,m[A.LINE_TO]=2,m[A.HORIZ_LINE_TO]=1,m[A.VERT_LINE_TO]=1,m[A.CLOSE_PATH]=0,m[A.QUAD_TO]=4,m[A.SMOOTH_QUAD_TO]=2,m[A.CURVE_TO]=6,m[A.SMOOTH_CURVE_TO]=4,m[A.ARC]=7,m);export{d as COMMAND_ARG_COUNTS,A as SVGPathData,f as SVGPathDataParser,s as SVGPathDataTransformer,E as encodeSVGPath};
//# sourceMappingURL=SVGPathData.module.js.map

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

import { TransformableSVG } from './TransformableSVG';
import { SVGCommand, TransformFunction } from './types';
import { TransformableSVG } from "./TransformableSVG";
import { SVGCommand, TransformFunction } from "./types";
export declare class SVGPathDataParser extends TransformableSVG {

@@ -4,0 +4,0 @@ private curNumber;

{
"name": "svg-pathdata",
"version": "5.0.2",
"version": "5.0.3",
"description": "Manipulate SVG path data (path[d] attribute content) simply and efficiently.",

@@ -18,3 +18,3 @@ "main": "lib/SVGPathData.js",

"version": "npm run changelog && git add CHANGELOG.md",
"test:ci": "npm run build && npm run test",
"test:ci": "npm run lint && npm run build && npm run test",
"build": "rollup -c rollup.config.js",

@@ -48,16 +48,17 @@ "watch": "rollup -c rollup.config.js -w"

"devDependencies": {
"chai": "^4.1.2",
"chai": "^4.2.0",
"chai-stats": "^0.3.0",
"commitizen": "^2.10.1",
"conventional-changelog-cli": "^1.2.0",
"coveralls": "^3.0.1",
"cz-conventional-changelog": "^2.0.0",
"commitizen": "^4.0.3",
"conventional-changelog-cli": "^2.0.31",
"coveralls": "^3.0.9",
"cz-conventional-changelog": "^3.1.0",
"eslint": "^6.8.0",
"eslint-config-simplifield": "^10.0.1",
"istanbul": "0.4.5",
"mocha": "^5.2.0",
"mocha": "^7.0.1",
"mocha-lcov-reporter": "1.3.0",
"rollup": "^0.59.4",
"rollup-plugin-typescript2": "^0.14.0",
"rollup-plugin-uglify": "^4.0.0",
"tslint": "^5.6.0",
"typescript": "^2.9.1",
"rollup": "^1.31.0",
"rollup-plugin-typescript2": "^0.25.3",
"tslint": "^6.0.0",
"typescript": "^3.7.5",
"uglify-es": "^3.3.9"

@@ -83,3 +84,6 @@ },

]
},
"dependencies": {
"rollup-plugin-terser": "^5.2.0"
}
}

@@ -81,3 +81,3 @@ import { SVGPathData } from "./SVGPathData";

*/
export function intersectionUnitCircleLine(a: number, b: number, c: number): Array<[number, number]> {
export function intersectionUnitCircleLine(a: number, b: number, c: number): [number, number][] {
assertNumbers(a, b, c);

@@ -84,0 +84,0 @@ // cf. pqFormula

@@ -88,4 +88,4 @@ import { encodeSVGPath } from "./SVGPathDataEncoder";

export {encodeSVGPath} from "./SVGPathDataEncoder"
export {SVGPathDataParser} from "./SVGPathDataParser"
export {SVGPathDataTransformer} from "./SVGPathDataTransformer"
export {encodeSVGPath} from "./SVGPathDataEncoder";
export {SVGPathDataParser} from "./SVGPathDataParser";
export {SVGPathDataTransformer} from "./SVGPathDataTransformer";
// Parse SVG PathData
// http://www.w3.org/TR/SVG/paths.html#PathDataBNF
import { SVGPathData, COMMAND_ARG_COUNTS } from './SVGPathData';
import { TransformableSVG } from './TransformableSVG';
import { SVGCommand, TransformFunction } from './types';
import { COMMAND_ARG_COUNTS, SVGPathData } from "./SVGPathData";
import { TransformableSVG } from "./TransformableSVG";
import { SVGCommand, TransformFunction } from "./types";
// Private consts : Char groups
const isWhiteSpace = (c: string) => ' ' === c || '\t' === c || '\r' === c || '\n' === c;
const isWhiteSpace = (c: string) => " " === c || "\t" === c || "\r" === c || "\n" === c;
const isDigit = (c: string) =>
'0'.charCodeAt(0) <= c.charCodeAt(0) && c.charCodeAt(0) <= '9'.charCodeAt(0);
const COMMANDS = 'mMzZlLhHvVcCsSqQtTaA';
"0".charCodeAt(0) <= c.charCodeAt(0) && c.charCodeAt(0) <= "9".charCodeAt(0);
const COMMANDS = "mMzZlLhHvVcCsSqQtTaA";
export class SVGPathDataParser extends TransformableSVG {
private curNumber: string = '';
private curCommandType: SVGCommand['type'] | -1 = -1;
private curNumber: string = "";
private curCommandType: SVGCommand["type"] | -1 = -1;
private curCommandRelative = false;

@@ -27,6 +27,6 @@ private canParseCommandOrComma = true;

finish(commands: SVGCommand[] = []) {
this.parse(' ', commands);
this.parse(" ", commands);
// Adding residual command
if (0 !== this.curArgs.length || !this.canParseCommandOrComma) {
throw new SyntaxError('Unterminated command at the path end.');
throw new SyntaxError("Unterminated command at the path end.");
}

@@ -52,3 +52,3 @@ return commands;

}
if ('e' === c || 'E' === c) {
if ("e" === c || "E" === c) {
this.curNumber += c;

@@ -58,3 +58,3 @@ this.curNumberHasExp = true;

}
if (('-' === c || '+' === c) && this.curNumberHasExp && !this.curNumberHasExpDigits) {
if (("-" === c || "+" === c) && this.curNumberHasExp && !this.curNumberHasExpDigits) {
this.curNumber += c;

@@ -64,3 +64,3 @@ continue;

// if we already have a ".", it means we are starting a new number
if ('.' === c && !this.curNumberHasExp && !this.curNumberHasDecimal) {
if ("." === c && !this.curNumberHasExp && !this.curNumberHasDecimal) {
this.curNumber += c;

@@ -83,3 +83,3 @@ this.curNumberHasDecimal = true;

} else if (3 === this.curArgs.length || 4 === this.curArgs.length) {
if ('0' !== this.curNumber && '1' !== this.curNumber) {
if ("0" !== this.curNumber && "1" !== this.curNumber) {
throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${i}"`);

@@ -162,3 +162,3 @@ }

}
this.curNumber = '';
this.curNumber = "";
this.curNumberHasExpDigits = false;

@@ -173,3 +173,3 @@ this.curNumberHasExp = false;

}
if (',' === c && this.canParseCommandOrComma) {
if ("," === c && this.canParseCommandOrComma) {
// L 0,0, H is not valid:

@@ -180,5 +180,5 @@ this.canParseCommandOrComma = false;

// if a sign is detected, then parse the new number
if ('+' === c || '-' === c || '.' === c) {
if ("+" === c || "-" === c || "." === c) {
this.curNumber = c;
this.curNumberHasDecimal = '.' === c;
this.curNumberHasDecimal = "." === c;
continue;

@@ -196,3 +196,3 @@ }

// Detecting the next command
if ('z' === c || 'Z' === c) {
if ("z" === c || "Z" === c) {
commands.push({

@@ -205,37 +205,37 @@ type: SVGPathData.CLOSE_PATH,

// Horizontal move to command
} else if ('h' === c || 'H' === c) {
} else if ("h" === c || "H" === c) {
this.curCommandType = SVGPathData.HORIZ_LINE_TO;
this.curCommandRelative = 'h' === c;
this.curCommandRelative = "h" === c;
// Vertical move to command
} else if ('v' === c || 'V' === c) {
} else if ("v" === c || "V" === c) {
this.curCommandType = SVGPathData.VERT_LINE_TO;
this.curCommandRelative = 'v' === c;
this.curCommandRelative = "v" === c;
// Move to command
} else if ('m' === c || 'M' === c) {
} else if ("m" === c || "M" === c) {
this.curCommandType = SVGPathData.MOVE_TO;
this.curCommandRelative = 'm' === c;
this.curCommandRelative = "m" === c;
// Line to command
} else if ('l' === c || 'L' === c) {
} else if ("l" === c || "L" === c) {
this.curCommandType = SVGPathData.LINE_TO;
this.curCommandRelative = 'l' === c;
this.curCommandRelative = "l" === c;
// Curve to command
} else if ('c' === c || 'C' === c) {
} else if ("c" === c || "C" === c) {
this.curCommandType = SVGPathData.CURVE_TO;
this.curCommandRelative = 'c' === c;
this.curCommandRelative = "c" === c;
// Smooth curve to command
} else if ('s' === c || 'S' === c) {
} else if ("s" === c || "S" === c) {
this.curCommandType = SVGPathData.SMOOTH_CURVE_TO;
this.curCommandRelative = 's' === c;
this.curCommandRelative = "s" === c;
// Quadratic bezier curve to command
} else if ('q' === c || 'Q' === c) {
} else if ("q" === c || "Q" === c) {
this.curCommandType = SVGPathData.QUAD_TO;
this.curCommandRelative = 'q' === c;
this.curCommandRelative = "q" === c;
// Smooth quadratic bezier curve to command
} else if ('t' === c || 'T' === c) {
} else if ("t" === c || "T" === c) {
this.curCommandType = SVGPathData.SMOOTH_QUAD_TO;
this.curCommandRelative = 't' === c;
this.curCommandRelative = "t" === c;
// Elliptic arc command
} else if ('a' === c || 'A' === c) {
} else if ("a" === c || "A" === c) {
this.curCommandType = SVGPathData.ARC;
this.curCommandRelative = 'a' === c;
this.curCommandRelative = "a" === c;
} else {

@@ -242,0 +242,0 @@ throw new SyntaxError(`Unexpected character "${c}" at index ${i}.`);

@@ -37,2 +37,9 @@ // Transform SVG PathData

if ("undefined" !== typeof command.rX) {
command.rX = rf(command.rX);
}
if ("undefined" !== typeof command.rY) {
command.rY = rf(command.rY);
}
return command;

@@ -39,0 +46,0 @@ };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc