Files
zyt/server/public/admin/assets/svg-pathdata-DmAmzc8P.js
T
2026-05-11 17:49:38 +08:00

16 lines
18 KiB
JavaScript
Executable File

/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var er=function(e,t){return(er=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,n){h.__proto__=n}||function(h,n){for(var p in n)Object.prototype.hasOwnProperty.call(n,p)&&(h[p]=n[p])})(e,t)};function tr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function h(){this.constructor=e}er(e,t),e.prototype=t===null?Object.create(t):(h.prototype=t.prototype,new h)}function sr(e){var t="";Array.isArray(e)||(e=[e]);for(var h=0;h<e.length;h++){var n=e[h];if(n.type===c.CLOSE_PATH)t+="z";else if(n.type===c.HORIZ_LINE_TO)t+=(n.relative?"h":"H")+n.x;else if(n.type===c.VERT_LINE_TO)t+=(n.relative?"v":"V")+n.y;else if(n.type===c.MOVE_TO)t+=(n.relative?"m":"M")+n.x+" "+n.y;else if(n.type===c.LINE_TO)t+=(n.relative?"l":"L")+n.x+" "+n.y;else if(n.type===c.CURVE_TO)t+=(n.relative?"c":"C")+n.x1+" "+n.y1+" "+n.x2+" "+n.y2+" "+n.x+" "+n.y;else if(n.type===c.SMOOTH_CURVE_TO)t+=(n.relative?"s":"S")+n.x2+" "+n.y2+" "+n.x+" "+n.y;else if(n.type===c.QUAD_TO)t+=(n.relative?"q":"Q")+n.x1+" "+n.y1+" "+n.x+" "+n.y;else if(n.type===c.SMOOTH_QUAD_TO)t+=(n.relative?"t":"T")+n.x+" "+n.y;else{if(n.type!==c.ARC)throw new Error('Unexpected command type "'+n.type+'" at index '+h+".");t+=(n.relative?"a":"A")+n.rX+" "+n.rY+" "+n.xRot+" "+ +n.lArcFlag+" "+ +n.sweepFlag+" "+n.x+" "+n.y}}return t}function z(e,t){var h=e[0],n=e[1];return[h*Math.cos(t)-n*Math.sin(t),h*Math.sin(t)+n*Math.cos(t)]}function U(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var h=0;h<e.length;h++)if(typeof e[h]!="number")throw new Error("assertNumbers arguments["+h+"] is not a number. "+typeof e[h]+" == typeof "+e[h]);return!0}var Z=Math.PI;function j(e,t,h){e.lArcFlag=e.lArcFlag===0?0:1,e.sweepFlag=e.sweepFlag===0?0:1;var n=e.rX,p=e.rY,l=e.x,_=e.y;n=Math.abs(e.rX),p=Math.abs(e.rY);var r=z([(t-l)/2,(h-_)/2],-e.xRot/180*Z),s=r[0],i=r[1],o=Math.pow(s,2)/Math.pow(n,2)+Math.pow(i,2)/Math.pow(p,2);1<o&&(n*=Math.sqrt(o),p*=Math.sqrt(o)),e.rX=n,e.rY=p;var y=Math.pow(n,2)*Math.pow(i,2)+Math.pow(p,2)*Math.pow(s,2),u=(e.lArcFlag!==e.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(n,2)*Math.pow(p,2)-y)/y)),a=n*i/p*u,T=-p*s/n*u,m=z([a,T],e.xRot/180*Z);e.cX=m[0]+(t+l)/2,e.cY=m[1]+(h+_)/2,e.phi1=Math.atan2((i-T)/p,(s-a)/n),e.phi2=Math.atan2((-i-T)/p,(-s-a)/n),e.sweepFlag===0&&e.phi2>e.phi1&&(e.phi2-=2*Z),e.sweepFlag===1&&e.phi2<e.phi1&&(e.phi2+=2*Z),e.phi1*=180/Z,e.phi2*=180/Z}function K(e,t,h){U(e,t,h);var n=e*e+t*t-h*h;if(0>n)return[];if(n===0)return[[e*h/(e*e+t*t),t*h/(e*e+t*t)]];var p=Math.sqrt(n);return[[(e*h+t*p)/(e*e+t*t),(t*h-e*p)/(e*e+t*t)],[(e*h-t*p)/(e*e+t*t),(t*h+e*p)/(e*e+t*t)]]}var d,X=Math.PI/180;function k(e,t,h){return(1-h)*e+h*t}function G(e,t,h,n){return e+Math.cos(n/180*Z)*t+Math.sin(n/180*Z)*h}function J(e,t,h,n){var p=1e-6,l=t-e,_=h-t,r=3*l+3*(n-h)-6*_,s=6*(_-l),i=3*l;return Math.abs(r)<p?[-i/s]:(function(o,y,u){var a=o*o/4-y;if(a<-u)return[];if(a<=u)return[-o/2];var T=Math.sqrt(a);return[-o/2-T,-o/2+T]})(s/r,i/r,p)}function $(e,t,h,n,p){var l=1-p;return e*(l*l*l)+t*(3*l*l*p)+h*(3*l*p*p)+n*(p*p*p)}(function(e){function t(){return p((function(r,s,i){return r.relative&&(r.x1!==void 0&&(r.x1+=s),r.y1!==void 0&&(r.y1+=i),r.x2!==void 0&&(r.x2+=s),r.y2!==void 0&&(r.y2+=i),r.x!==void 0&&(r.x+=s),r.y!==void 0&&(r.y+=i),r.relative=!1),r}))}function h(){var r=NaN,s=NaN,i=NaN,o=NaN;return p((function(y,u,a){return y.type&c.SMOOTH_CURVE_TO&&(y.type=c.CURVE_TO,r=isNaN(r)?u:r,s=isNaN(s)?a:s,y.x1=y.relative?u-r:2*u-r,y.y1=y.relative?a-s:2*a-s),y.type&c.CURVE_TO?(r=y.relative?u+y.x2:y.x2,s=y.relative?a+y.y2:y.y2):(r=NaN,s=NaN),y.type&c.SMOOTH_QUAD_TO&&(y.type=c.QUAD_TO,i=isNaN(i)?u:i,o=isNaN(o)?a:o,y.x1=y.relative?u-i:2*u-i,y.y1=y.relative?a-o:2*a-o),y.type&c.QUAD_TO?(i=y.relative?u+y.x1:y.x1,o=y.relative?a+y.y1:y.y1):(i=NaN,o=NaN),y}))}function n(){var r=NaN,s=NaN;return p((function(i,o,y){if(i.type&c.SMOOTH_QUAD_TO&&(i.type=c.QUAD_TO,r=isNaN(r)?o:r,s=isNaN(s)?y:s,i.x1=i.relative?o-r:2*o-r,i.y1=i.relative?y-s:2*y-s),i.type&c.QUAD_TO){r=i.relative?o+i.x1:i.x1,s=i.relative?y+i.y1:i.y1;var u=i.x1,a=i.y1;i.type=c.CURVE_TO,i.x1=((i.relative?0:o)+2*u)/3,i.y1=((i.relative?0:y)+2*a)/3,i.x2=(i.x+2*u)/3,i.y2=(i.y+2*a)/3}else r=NaN,s=NaN;return i}))}function p(r){var s=0,i=0,o=NaN,y=NaN;return function(u){if(isNaN(o)&&!(u.type&c.MOVE_TO))throw new Error("path must start with moveto");var a=r(u,s,i,o,y);return u.type&c.CLOSE_PATH&&(s=o,i=y),u.x!==void 0&&(s=u.relative?s+u.x:u.x),u.y!==void 0&&(i=u.relative?i+u.y:u.y),u.type&c.MOVE_TO&&(o=s,y=i),a}}function l(r,s,i,o,y,u){return U(r,s,i,o,y,u),p((function(a,T,m,C){var x=a.x1,g=a.x2,N=a.relative&&!isNaN(C),f=a.x!==void 0?a.x:N?0:T,I=a.y!==void 0?a.y:N?0:m;function v(q){return q*q}a.type&c.HORIZ_LINE_TO&&s!==0&&(a.type=c.LINE_TO,a.y=a.relative?0:m),a.type&c.VERT_LINE_TO&&i!==0&&(a.type=c.LINE_TO,a.x=a.relative?0:T),a.x!==void 0&&(a.x=a.x*r+I*i+(N?0:y)),a.y!==void 0&&(a.y=f*s+a.y*o+(N?0:u)),a.x1!==void 0&&(a.x1=a.x1*r+a.y1*i+(N?0:y)),a.y1!==void 0&&(a.y1=x*s+a.y1*o+(N?0:u)),a.x2!==void 0&&(a.x2=a.x2*r+a.y2*i+(N?0:y)),a.y2!==void 0&&(a.y2=g*s+a.y2*o+(N?0:u));var O=r*o-s*i;if(a.xRot!==void 0&&(r!==1||s!==0||i!==0||o!==1))if(O===0)delete a.rX,delete a.rY,delete a.xRot,delete a.lArcFlag,delete a.sweepFlag,a.type=c.LINE_TO;else{var M=a.xRot*Math.PI/180,R=Math.sin(M),P=Math.cos(M),S=1/v(a.rX),H=1/v(a.rY),Q=v(P)*S+v(R)*H,F=2*R*P*(S-H),b=v(R)*S+v(P)*H,D=Q*o*o-F*s*o+b*s*s,V=F*(r*o+s*i)-2*(Q*i*o+b*r*s),Y=Q*i*i-F*r*i+b*r*r,E=(Math.atan2(V,D-Y)+Math.PI)%Math.PI/2,A=Math.sin(E),w=Math.cos(E);a.rX=Math.abs(O)/Math.sqrt(D*v(w)+V*A*w+Y*v(A)),a.rY=Math.abs(O)/Math.sqrt(D*v(A)-V*A*w+Y*v(w)),a.xRot=180*E/Math.PI}return a.sweepFlag!==void 0&&0>O&&(a.sweepFlag=+!a.sweepFlag),a}))}function _(){return function(r){var s={};for(var i in r)s[i]=r[i];return s}}e.ROUND=function(r){function s(i){return Math.round(i*r)/r}return r===void 0&&(r=1e13),U(r),function(i){return i.x1!==void 0&&(i.x1=s(i.x1)),i.y1!==void 0&&(i.y1=s(i.y1)),i.x2!==void 0&&(i.x2=s(i.x2)),i.y2!==void 0&&(i.y2=s(i.y2)),i.x!==void 0&&(i.x=s(i.x)),i.y!==void 0&&(i.y=s(i.y)),i.rX!==void 0&&(i.rX=s(i.rX)),i.rY!==void 0&&(i.rY=s(i.rY)),i}},e.TO_ABS=t,e.TO_REL=function(){return p((function(r,s,i){return r.relative||(r.x1!==void 0&&(r.x1-=s),r.y1!==void 0&&(r.y1-=i),r.x2!==void 0&&(r.x2-=s),r.y2!==void 0&&(r.y2-=i),r.x!==void 0&&(r.x-=s),r.y!==void 0&&(r.y-=i),r.relative=!0),r}))},e.NORMALIZE_HVZ=function(r,s,i){return r===void 0&&(r=!0),s===void 0&&(s=!0),i===void 0&&(i=!0),p((function(o,y,u,a,T){if(isNaN(a)&&!(o.type&c.MOVE_TO))throw new Error("path must start with moveto");return s&&o.type&c.HORIZ_LINE_TO&&(o.type=c.LINE_TO,o.y=o.relative?0:u),i&&o.type&c.VERT_LINE_TO&&(o.type=c.LINE_TO,o.x=o.relative?0:y),r&&o.type&c.CLOSE_PATH&&(o.type=c.LINE_TO,o.x=o.relative?a-y:a,o.y=o.relative?T-u:T),o.type&c.ARC&&(o.rX===0||o.rY===0)&&(o.type=c.LINE_TO,delete o.rX,delete o.rY,delete o.xRot,delete o.lArcFlag,delete o.sweepFlag),o}))},e.NORMALIZE_ST=h,e.QT_TO_C=n,e.INFO=p,e.SANITIZE=function(r){r===void 0&&(r=0),U(r);var s=NaN,i=NaN,o=NaN,y=NaN;return p((function(u,a,T,m,C){var x=Math.abs,g=!1,N=0,f=0;if(u.type&c.SMOOTH_CURVE_TO&&(N=isNaN(s)?0:a-s,f=isNaN(i)?0:T-i),u.type&(c.CURVE_TO|c.SMOOTH_CURVE_TO)?(s=u.relative?a+u.x2:u.x2,i=u.relative?T+u.y2:u.y2):(s=NaN,i=NaN),u.type&c.SMOOTH_QUAD_TO?(o=isNaN(o)?a:2*a-o,y=isNaN(y)?T:2*T-y):u.type&c.QUAD_TO?(o=u.relative?a+u.x1:u.x1,y=u.relative?T+u.y1:u.y2):(o=NaN,y=NaN),u.type&c.LINE_COMMANDS||u.type&c.ARC&&(u.rX===0||u.rY===0||!u.lArcFlag)||u.type&c.CURVE_TO||u.type&c.SMOOTH_CURVE_TO||u.type&c.QUAD_TO||u.type&c.SMOOTH_QUAD_TO){var I=u.x===void 0?0:u.relative?u.x:u.x-a,v=u.y===void 0?0:u.relative?u.y:u.y-T;N=isNaN(o)?u.x1===void 0?N:u.relative?u.x:u.x1-a:o-a,f=isNaN(y)?u.y1===void 0?f:u.relative?u.y:u.y1-T:y-T;var O=u.x2===void 0?0:u.relative?u.x:u.x2-a,M=u.y2===void 0?0:u.relative?u.y:u.y2-T;x(I)<=r&&x(v)<=r&&x(N)<=r&&x(f)<=r&&x(O)<=r&&x(M)<=r&&(g=!0)}return u.type&c.CLOSE_PATH&&x(a-m)<=r&&x(T-C)<=r&&(g=!0),g?[]:u}))},e.MATRIX=l,e.ROTATE=function(r,s,i){s===void 0&&(s=0),i===void 0&&(i=0),U(r,s,i);var o=Math.sin(r),y=Math.cos(r);return l(y,o,-o,y,s-s*y+i*o,i-s*o-i*y)},e.TRANSLATE=function(r,s){return s===void 0&&(s=0),U(r,s),l(1,0,0,1,r,s)},e.SCALE=function(r,s){return s===void 0&&(s=r),U(r,s),l(r,0,0,s,0,0)},e.SKEW_X=function(r){return U(r),l(1,0,Math.atan(r),1,0,0)},e.SKEW_Y=function(r){return U(r),l(1,Math.atan(r),0,1,0,0)},e.X_AXIS_SYMMETRY=function(r){return r===void 0&&(r=0),U(r),l(-1,0,0,1,r,0)},e.Y_AXIS_SYMMETRY=function(r){return r===void 0&&(r=0),U(r),l(1,0,0,-1,0,r)},e.A_TO_C=function(){return p((function(r,s,i){return c.ARC===r.type?(function(o,y,u){var a,T,m,C;o.cX||j(o,y,u);for(var x=Math.min(o.phi1,o.phi2),g=Math.max(o.phi1,o.phi2)-x,N=Math.ceil(g/90),f=new Array(N),I=y,v=u,O=0;O<N;O++){var M=k(o.phi1,o.phi2,O/N),R=k(o.phi1,o.phi2,(O+1)/N),P=R-M,S=4/3*Math.tan(P*X/4),H=[Math.cos(M*X)-S*Math.sin(M*X),Math.sin(M*X)+S*Math.cos(M*X)],Q=H[0],F=H[1],b=[Math.cos(R*X),Math.sin(R*X)],D=b[0],V=b[1],Y=[D+S*Math.sin(R*X),V-S*Math.cos(R*X)],E=Y[0],A=Y[1];f[O]={relative:o.relative,type:c.CURVE_TO};var w=function(q,W){var B=z([q*o.rX,W*o.rY],o.xRot),nr=B[0],or=B[1];return[o.cX+nr,o.cY+or]};a=w(Q,F),f[O].x1=a[0],f[O].y1=a[1],T=w(E,A),f[O].x2=T[0],f[O].y2=T[1],m=w(D,V),f[O].x=m[0],f[O].y=m[1],o.relative&&(f[O].x1-=I,f[O].y1-=v,f[O].x2-=I,f[O].y2-=v,f[O].x-=I,f[O].y-=v),I=(C=[f[O].x,f[O].y])[0],v=C[1]}return f})(r,r.relative?0:s,r.relative?0:i):r}))},e.ANNOTATE_ARCS=function(){return p((function(r,s,i){return r.relative&&(s=0,i=0),c.ARC===r.type&&j(r,s,i),r}))},e.CLONE=_,e.CALCULATE_BOUNDS=function(){var r=function(u){var a={};for(var T in u)a[T]=u[T];return a},s=t(),i=n(),o=h(),y=p((function(u,a,T){var m=o(i(s(r(u))));function C(A){A>y.maxX&&(y.maxX=A),A<y.minX&&(y.minX=A)}function x(A){A>y.maxY&&(y.maxY=A),A<y.minY&&(y.minY=A)}if(m.type&c.DRAWING_COMMANDS&&(C(a),x(T)),m.type&c.HORIZ_LINE_TO&&C(m.x),m.type&c.VERT_LINE_TO&&x(m.y),m.type&c.LINE_TO&&(C(m.x),x(m.y)),m.type&c.CURVE_TO){C(m.x),x(m.y);for(var g=0,N=J(a,m.x1,m.x2,m.x);g<N.length;g++)0<(E=N[g])&&1>E&&C($(a,m.x1,m.x2,m.x,E));for(var f=0,I=J(T,m.y1,m.y2,m.y);f<I.length;f++)0<(E=I[f])&&1>E&&x($(T,m.y1,m.y2,m.y,E))}if(m.type&c.ARC){C(m.x),x(m.y),j(m,a,T);for(var v=m.xRot/180*Math.PI,O=Math.cos(v)*m.rX,M=Math.sin(v)*m.rX,R=-Math.sin(v)*m.rY,P=Math.cos(v)*m.rY,S=m.phi1<m.phi2?[m.phi1,m.phi2]:-180>m.phi2?[m.phi2+360,m.phi1+360]:[m.phi2,m.phi1],H=S[0],Q=S[1],F=function(A){var w=A[0],q=A[1],W=180*Math.atan2(q,w)/Math.PI;return W<H?W+360:W},b=0,D=K(R,-O,0).map(F);b<D.length;b++)(E=D[b])>H&&E<Q&&C(G(m.cX,O,R,E));for(var V=0,Y=K(P,-M,0).map(F);V<Y.length;V++){var E;(E=Y[V])>H&&E<Q&&x(G(m.cY,M,P,E))}}return u}));return y.minX=1/0,y.maxX=-1/0,y.minY=1/0,y.maxY=-1/0,y}})(d||(d={}));var L,ir=(function(){function e(){}return e.prototype.round=function(t){return this.transform(d.ROUND(t))},e.prototype.toAbs=function(){return this.transform(d.TO_ABS())},e.prototype.toRel=function(){return this.transform(d.TO_REL())},e.prototype.normalizeHVZ=function(t,h,n){return this.transform(d.NORMALIZE_HVZ(t,h,n))},e.prototype.normalizeST=function(){return this.transform(d.NORMALIZE_ST())},e.prototype.qtToC=function(){return this.transform(d.QT_TO_C())},e.prototype.aToC=function(){return this.transform(d.A_TO_C())},e.prototype.sanitize=function(t){return this.transform(d.SANITIZE(t))},e.prototype.translate=function(t,h){return this.transform(d.TRANSLATE(t,h))},e.prototype.scale=function(t,h){return this.transform(d.SCALE(t,h))},e.prototype.rotate=function(t,h,n){return this.transform(d.ROTATE(t,h,n))},e.prototype.matrix=function(t,h,n,p,l,_){return this.transform(d.MATRIX(t,h,n,p,l,_))},e.prototype.skewX=function(t){return this.transform(d.SKEW_X(t))},e.prototype.skewY=function(t){return this.transform(d.SKEW_Y(t))},e.prototype.xSymmetry=function(t){return this.transform(d.X_AXIS_SYMMETRY(t))},e.prototype.ySymmetry=function(t){return this.transform(d.Y_AXIS_SYMMETRY(t))},e.prototype.annotateArcs=function(){return this.transform(d.ANNOTATE_ARCS())},e})(),ar=function(e){return e===" "||e===" "||e==="\r"||e===`
`},rr=function(e){return 48<=e.charCodeAt(0)&&e.charCodeAt(0)<=57},ur=(function(e){function t(){var h=e.call(this)||this;return h.curNumber="",h.curCommandType=-1,h.curCommandRelative=!1,h.canParseCommandOrComma=!0,h.curNumberHasExp=!1,h.curNumberHasExpDigits=!1,h.curNumberHasDecimal=!1,h.curArgs=[],h}return tr(t,e),t.prototype.finish=function(h){if(h===void 0&&(h=[]),this.parse(" ",h),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return h},t.prototype.parse=function(h,n){var p=this;n===void 0&&(n=[]);for(var l=function(y){n.push(y),p.curArgs.length=0,p.canParseCommandOrComma=!0},_=0;_<h.length;_++){var r=h[_],s=!(this.curCommandType!==c.ARC||this.curArgs.length!==3&&this.curArgs.length!==4||this.curNumber.length!==1||this.curNumber!=="0"&&this.curNumber!=="1"),i=rr(r)&&(this.curNumber==="0"&&r==="0"||s);if(!rr(r)||i)if(r!=="e"&&r!=="E")if(r!=="-"&&r!=="+"||!this.curNumberHasExp||this.curNumberHasExpDigits)if(r!=="."||this.curNumberHasExp||this.curNumberHasDecimal||s){if(this.curNumber&&this.curCommandType!==-1){var o=Number(this.curNumber);if(isNaN(o))throw new SyntaxError("Invalid number ending at "+_);if(this.curCommandType===c.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>o)throw new SyntaxError('Expected positive number, got "'+o+'" at index "'+_+'"')}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+_+'"')}this.curArgs.push(o),this.curArgs.length===cr[this.curCommandType]&&(c.HORIZ_LINE_TO===this.curCommandType?l({type:c.HORIZ_LINE_TO,relative:this.curCommandRelative,x:o}):c.VERT_LINE_TO===this.curCommandType?l({type:c.VERT_LINE_TO,relative:this.curCommandRelative,y:o}):this.curCommandType===c.MOVE_TO||this.curCommandType===c.LINE_TO||this.curCommandType===c.SMOOTH_QUAD_TO?(l({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),c.MOVE_TO===this.curCommandType&&(this.curCommandType=c.LINE_TO)):this.curCommandType===c.CURVE_TO?l({type:c.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===c.SMOOTH_CURVE_TO?l({type:c.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===c.QUAD_TO?l({type:c.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===c.ARC&&l({type:c.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(!ar(r))if(r===","&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(r!=="+"&&r!=="-"&&r!==".")if(i)this.curNumber=r,this.curNumberHasDecimal=!1;else{if(this.curArgs.length!==0)throw new SyntaxError("Unterminated command at index "+_+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+r+'" at index '+_+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,r!=="z"&&r!=="Z")if(r==="h"||r==="H")this.curCommandType=c.HORIZ_LINE_TO,this.curCommandRelative=r==="h";else if(r==="v"||r==="V")this.curCommandType=c.VERT_LINE_TO,this.curCommandRelative=r==="v";else if(r==="m"||r==="M")this.curCommandType=c.MOVE_TO,this.curCommandRelative=r==="m";else if(r==="l"||r==="L")this.curCommandType=c.LINE_TO,this.curCommandRelative=r==="l";else if(r==="c"||r==="C")this.curCommandType=c.CURVE_TO,this.curCommandRelative=r==="c";else if(r==="s"||r==="S")this.curCommandType=c.SMOOTH_CURVE_TO,this.curCommandRelative=r==="s";else if(r==="q"||r==="Q")this.curCommandType=c.QUAD_TO,this.curCommandRelative=r==="q";else if(r==="t"||r==="T")this.curCommandType=c.SMOOTH_QUAD_TO,this.curCommandRelative=r==="t";else{if(r!=="a"&&r!=="A")throw new SyntaxError('Unexpected character "'+r+'" at index '+_+".");this.curCommandType=c.ARC,this.curCommandRelative=r==="a"}else n.push({type:c.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=r,this.curNumberHasDecimal=r==="."}else this.curNumber+=r,this.curNumberHasDecimal=!0;else this.curNumber+=r;else this.curNumber+=r,this.curNumberHasExp=!0;else this.curNumber+=r,this.curNumberHasExpDigits=this.curNumberHasExp}return n},t.prototype.transform=function(h){return Object.create(this,{parse:{value:function(n,p){p===void 0&&(p=[]);for(var l=0,_=Object.getPrototypeOf(this).parse.call(this,n);l<_.length;l++){var r=_[l],s=h(r);Array.isArray(s)?p.push.apply(p,s):p.push(s)}return p}}})},t})(ir),c=(function(e){function t(h){var n=e.call(this)||this;return n.commands=typeof h=="string"?t.parse(h):h,n}return tr(t,e),t.prototype.encode=function(){return t.encode(this.commands)},t.prototype.getBounds=function(){var h=d.CALCULATE_BOUNDS();return this.transform(h),h},t.prototype.transform=function(h){for(var n=[],p=0,l=this.commands;p<l.length;p++){var _=h(l[p]);Array.isArray(_)?n.push.apply(n,_):n.push(_)}return this.commands=n,this},t.encode=function(h){return sr(h)},t.parse=function(h){var n=new ur,p=[];return n.parse(h,p),n.finish(p),p},t.CLOSE_PATH=1,t.MOVE_TO=2,t.HORIZ_LINE_TO=4,t.VERT_LINE_TO=8,t.LINE_TO=16,t.CURVE_TO=32,t.SMOOTH_CURVE_TO=64,t.QUAD_TO=128,t.SMOOTH_QUAD_TO=256,t.ARC=512,t.LINE_COMMANDS=t.LINE_TO|t.HORIZ_LINE_TO|t.VERT_LINE_TO,t.DRAWING_COMMANDS=t.HORIZ_LINE_TO|t.VERT_LINE_TO|t.LINE_TO|t.CURVE_TO|t.SMOOTH_CURVE_TO|t.QUAD_TO|t.SMOOTH_QUAD_TO|t.ARC,t})(ir),cr=((L={})[c.MOVE_TO]=2,L[c.LINE_TO]=2,L[c.HORIZ_LINE_TO]=1,L[c.VERT_LINE_TO]=1,L[c.CLOSE_PATH]=0,L[c.QUAD_TO]=4,L[c.SMOOTH_QUAD_TO]=2,L[c.CURVE_TO]=6,L[c.SMOOTH_CURVE_TO]=4,L[c.ARC]=7,L);export{c as _};