svg-path-simplify 0.3.6 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- function e(e,t,a="red",l="1%",r="1",n="",s=!0,i="",o=""){Array.isArray(t)&&(t={x:t[0],y:t[1]});let p=`<circle class="${o}" opacity="${r}" id="${i}" cx="${t.x}" cy="${t.y}" r="${l}" fill="${a}">\n <title>${n}</title></circle>`;if(!s)return p;e.insertAdjacentHTML("beforeend",p)}function t(e,t="",a="green",l="1%",r="1",n=!0){let s=`<path d="${t}" fill="none" stroke="${a}" stroke-width="${l}" stroke-opacity="${r}" /> `;if(!n)return s;e.insertAdjacentHTML("beforeend",s)}const{abs:a,acos:l,asin:r,atan:n,atan2:s,ceil:i,cos:o,exp:p,floor:h,log:u,hypot:c,max:y,min:x,pow:f,random:g,round:d,sin:m,sqrt:v,tan:b,PI:M}=Math,A=180/Math.PI,w="http://www.w3.org/2000/svg",{abs:C,acos:k,asin:S,atan:E,atan2:P,ceil:L,cos:D,exp:T,floor:I,log:$,max:F,min:q,pow:N,random:z,round:j,sin:B,sqrt:Q,tan:O,PI:R}=Math;function _(e,t,a=!1){let l=P(t.y-e.y,t.x-e.x);return a&&l<0&&(l+=2*Math.PI),l}function G(e,t,a,l=!1){let r=Math.atan2(t.y-e.y,t.x-e.x),n=Math.atan2(a.y-e.y,a.x-e.x),s=n-r;s=(e=>{let t=e%(2*Math.PI);return t>Math.PI?t-=2*Math.PI:t<=-Math.PI&&(t+=2*Math.PI),t})(s),l&&(s=2*Math.PI-Math.abs(s));let i=180/Math.PI;return{startAngle:r,endAngle:n,deltaAngle:s,startAngleDeg:r*i,endAngleDeg:n*i,deltaAngleDeg:s*i}}function U(e=null,t=null,a=null,l=null,r=!0,n=!1,s=!1){let i,o,p,h,u,c={};if(!(e&&t&&a&&l))return s&&console.warn("points missing"),!1;if(e.x===t.x&&e.y===t.y||a.x===l.x&&a.y===l.y)return!1;try{if(i=(l.y-a.y)*(t.x-e.x)-(l.x-a.x)*(t.y-e.y),0===i)return!1}catch{return s&&console.warn("!catch",e,t,"p3:",a,"p4:",l),!1}o=e.y-a.y,p=e.x-a.x,h=(l.x-a.x)*o-(l.y-a.y)*p,u=(t.x-e.x)*o-(t.y-e.y)*p,o=h/i,p=u/i,c={x:e.x+o*(t.x-e.x),y:e.y+o*(t.y-e.y)};let y=!1;return o>0&&o<1&&p>0&&p<1&&(y=!0),!r&&n&&(o>0&&p<0||o<0&&p>0)?(y=!1,!1):!(r&&!y)&&c}function V(e,t,a,l=!1){const r=(e,t,a)=>e>=t&&e<=a||e<=t&&e>=a;let n=!1;if((!l||!a.bottom)&&(a.left>e.x||a.top>e.y||a.bottom<e.y||a.right<e.x))return!1;let s=t.length;for(let a=s-1,l=0;l<s;a=l,l++){const s=t[a],i=t[l];if(e.x==s.x&&e.y==s.y||e.x==i.x&&e.y==i.y)return!0;if(s.y==i.y&&e.y==s.y&&r(e.x,s.x,i.x))return!0;if(r(e.y,s.y,i.y)){if(e.y==s.y&&i.y>=s.y||e.y==i.y&&s.y>=i.y)continue;const t=(s.x-e.x)*(i.y-e.y)-(i.x-e.x)*(s.y-e.y);if(0==t)return!0;s.y<i.y==t>0&&(n=!n)}}return!!n}function Z(e,t,a,l=!1){let r={x:(t.x-e.x)*a+e.x,y:(t.y-e.y)*a+e.y};return l&&(r.angle=_(e,t),r.angle<0&&(r.angle+=2*R)),r}function H(e,t=.5,a=!1,l=!1,r=!1){let n;return Array.isArray(e[0])&&(e=e.map(e=>({x:e[0],y:e[1]})),r=!0),n=e.length>2?((e,t,a=!1)=>{let r=4===e.length,n=e[0],s=e[1],i=r?e[2]:e[1],o=e[e.length-1],p={x:0,y:0};if(a||l){let e,a,h,u,c,y=n.x===s.x&&n.y===s.y,x=o.x===i.x&&o.y===i.y;0!==t||y?1!==t||x?(y&&(t+=1e-7),x&&(t-=1e-7),e=Z(n,s,t),r?(a=Z(s,i,t),h=Z(i,o,t),u=Z(e,a,t),c=Z(a,h,t),p=Z(u,c,t),p.angle=_(u,c),l&&(p.cpts=[a,h,u,c])):(a=Z(n,s,t),h=Z(s,o,t),p=Z(a,h,t),p.angle=_(a,h),l&&(p.cpts=[a,h]))):(p.x=o.x,p.y=o.y,p.angle=_(i,o)):(p.x=n.x,p.y=n.y,p.angle=_(n,s))}else{let e=1-t;p=r?{x:e**3*n.x+3*e**2*t*s.x+3*e*t**2*i.x+t**3*o.x,y:e**3*n.y+3*e**2*t*s.y+3*e*t**2*i.y+t**3*o.y}:{x:e*e*n.x+2*e*t*s.x+t**2*o.x,y:e*e*n.y+2*e*t*s.y+t**2*o.y}}return p})(e,t,a):Z(e[0],e[1],t,a),a&&n.angle<0&&(n.angle+=2*R),r?[n.x,n.y]:n}function W(e){let t=[],a={x:e[0].values[0],y:e[0].values[1]};return e.forEach(e=>{let{type:l,values:r}=e;if(r.length){let e=r.length>1?{x:r[r.length-2],y:r[r.length-1]}:"V"===l?{x:a.x,y:r[0]}:{x:r[0],y:a.y};t.push(e),a=e}}),t}function J(e,t,a,l,r,n,s,i,o){const p=(e,t,a,l)=>P(l-t,a-e);let h={cx:0,cy:0,rx:a=C(a),ry:l=C(l),startAngle:0,endAngle:0,deltaAngle:0,clockwise:s,xAxisRotation:r,largeArc:n,sweep:s};if(0==a||0==l)throw Error("rx and ry can not be 0");if(a===l){let a=Math.abs(i-e),l=Math.abs(o-t),r=a,n=Math.min(e,i),p=Math.min(t,o),u=.5*Math.PI;if(0===a&&l||0===l&&a)return r=0===a&&l?l/2:a/2,h.rx=r,h.ry=r,0===a&&l?(h.cx=e,h.cy=p+l/2,h.startAngle=t>o?u:-u,h.endAngle=t>o?-u:u,h.deltaAngle=s?Math.PI:-Math.PI):0===l&&a&&(h.cx=n+a/2,h.cy=t,h.startAngle=e>i?Math.PI:0,h.endAngle=e>i?-Math.PI:Math.PI,h.deltaAngle=s?Math.PI:-Math.PI),h}let u,c,y=a===l?0:r*R/180,x=y?Math.sin(y):0,f=y?Math.cos(y):1,g=(e-i)/2,d=(t-o)/2,m=(e+i)/2,v=(t+o)/2,b=y?f*g+x*d:g,M=y?f*d-x*g:d,A=b*b/(a*a)+M*M/(l*l);A>1&&(a*=Math.sqrt(A),l*=Math.sqrt(A),h.rx=a,h.ry=l);let w=a*l,k=a*M,S=l*b,E=k**2+S**2;if(!E)throw Error("start point can not be same as end point");let L=Math.sqrt(Math.abs((w*w-E)/E));n==s&&(L=-L);let D=L*k/l,T=-L*S/a;u=y?f*D-x*T+m:m+D,c=y?x*D+f*T+v:v+T,h.cy=c,h.cx=u;let I=p(u,c,e,t),$=p(u,c,i,o);!s&&$>I&&($-=2*Math.PI),s&&I>$&&($=$<=0?$+2*Math.PI:$);let F=$-I;return h.startAngle=I,h.endAngle=$,h.deltaAngle=F,h}function X(e,t,a,l=0,r=!1){return l?(l=r?l/180*Math.PI:l,{x:t+(e.x-t)*Math.cos(l)-(e.y-a)*Math.sin(l),y:a+(e.x-t)*Math.sin(l)+(e.y-a)*Math.cos(l)}):e}function Y(e,t,a,l,r,n=0,s=!0,i=!1){if(r=i?r*R/180:r,n=i?n*R/180:n,n=a!==l&&n!==2*R?n:0,s&&a!==l){let e=E(O(r=n?r-n:r)*(a/l));r=D(r)<0?e+R:e}let o=e+a*D(r),p=t+l*B(r),h={x:o,y:p};return n&&(h.x=e+(o-e)*D(n)-(p-t)*B(n),h.y=t+(o-e)*B(n)+(p-t)*D(n)),h}function K(e,t,a){if(t===a||e%R*.5==0)return e;let l=E(O(e)*(t/a));return l=D(e)<0?l+R:l,l}function ee(e=null,t=[]){e||(e=t[0],t=t.slice(1,t.length));let a=t.length,l=t[a-1],r=t[0],n=3===a?t[1]:r,s=Math.min(e.y,l.y),i=Math.min(e.x,l.x),o=Math.max(e.x,l.x),p=Math.max(e.y,l.y);return!(r.y>=s&&r.y<=p&&n.y>=s&&n.y<=p&&r.x>=i&&r.x<=o&&n.x>=i&&n.x<=o)}function te(e,{addExtremes:t=!0,addSemiExtremes:a=!1}={}){let l=4===e.length?function(e,t,a,l,{addExtremes:r=!0,addSemiExtremes:n=!1}={}){const s=e=>{const t=Math.PI/4,a=Math.cos(t),l=Math.sin(t);return{x:e.x*a-e.y*l,y:e.x*l+e.y*a}};n&&(e=s(e),t=s(t),a=s(a),l=s(l));let[i,o,p,h,u,c,y,x]=[e.x,e.y,t.x,t.y,a.x,a.y,l.x,l.y],f=Math.min(e.y,l.y),g=Math.min(e.x,l.x),d=Math.max(e.x,l.x),m=Math.max(e.y,l.y);if(t.y>=f&&t.y<=m&&a.y>=f&&a.y<=m&&t.x>=g&&t.x<=d&&a.x>=g&&a.x<=d)return[];let v,b,M,A,w,C,k,S,E=[];for(let e=0;e<2;++e)if(0==e?(b=6*i-12*p+6*u,v=-3*i+9*p-9*u+3*y,M=3*p-3*i):(b=6*o-12*h+6*c,v=-3*o+9*h-9*c+3*x,M=3*h-3*o),Math.abs(v)<1e-8){if(Math.abs(b)<1e-8)continue;A=-M/b,0<A&&A<1&&E.push(A)}else k=b*b-4*M*v,k<0?Math.abs(k)<1e-8&&(A=-b/(2*v),0<A&&A<1&&E.push(A)):(S=Math.sqrt(k),w=(-b+S)/(2*v),0<w&&w<1&&E.push(w),C=(-b-S)/(2*v),0<C&&C<1&&E.push(C));let P=E.length;for(;P--;)A=E[P];return E}(e[0],e[1],e[2],e[3],{addExtremes:t,addSemiExtremes:a}):function(e,t,a,{addExtremes:l=!0,addSemiExtremes:r=!1}={}){const n=e=>{const t=-Math.PI/4,a=Math.cos(t),l=Math.sin(t);return{x:e.x*a-e.y*l,y:e.x*l+e.y*a}};r&&(e=n(e),t=n(t),a=n(a));let s,i,o,p=Math.min(e.y,a.y),h=Math.min(e.x,a.x),u=Math.max(e.x,a.x),c=Math.max(e.y,a.y);if(t.y>=p&&t.y<=c&&t.x>=h&&t.x<=u)return[];let[y,x,f,g,d,m]=[e.x,e.y,t.x,t.y,a.x,a.y],v=[];for(let e=0;e<2;++e)s=0==e?y-2*f+d:x-2*g+m,i=0==e?-2*y+2*f:-2*x+2*g,Math.abs(s)>1e-12&&(o=-i/(2*s),o>0&&o<1&&v.push(o));return v}(e[0],e[1],e[2],{addExtremes:t,addSemiExtremes:a});return l}function ae(e,t){const a=(e,t,a,l,r,n)=>{var s=Math.cos(n),i=Math.sin(n),o=l*Math.cos(e),p=r*Math.sin(e);return{x:t+s*o-i*p,y:a+i*o+s*p}};let l,r,n,s,i,o=J(e.x,e.y,t[0],t[1],t[2],t[3],t[4],t[5],t[6]),{rx:p,ry:h,cx:u,cy:c,endAngle:y,deltaAngle:x}=o,f=t[2],g={x:t[5],y:t[6]},d=[g],m=f*Math.PI/180,v=Math.tan(m);i=Math.atan2(-h*v,p);let b=i,M=i+Math.PI,A=Math.atan2(h,p*v),w=A+Math.PI,C=[e.x,g.x],k=[e.y,g.y],S=Math.min(...C),E=Math.max(...C),P=Math.min(...k),L=Math.max(...k),D=a(y-.001*x,u,c,p,h,m),T=a(y-.999*x,u,c,p,h,m);return(D.x>E||T.x>E)&&(l=a(b,u,c,p,h,m),d.push(l)),(D.x<S||T.x<S)&&(r=a(M,u,c,p,h,m),d.push(r)),(D.y<P||T.y<P)&&(s=a(w,u,c,p,h,m),d.push(s)),(D.y>L||T.y>L)&&(n=a(A,u,c,p,h,m),d.push(n)),d}function le(e=[],t=[]){let a=e.length,l=4===a;t.length||(t=[0]);let r=t.length,n=[];for(let s=0;s<r;s++){let r=t[s],i=r?[]:e.slice(0);if(r)for(let t=0;t<a;t++){let a=e[t];i.push(X(a,0,0,r))}let o=l?re(...i):ne(...i);n.push(...o)}return n=[...new Set(n)].sort(),n}function re(e,t,a,l){if(!ee(e,[t,a,l]))return[];let r,n,s,i,o,p,h,u,[c,y,x,f,g,d,m,v]=[e.x,e.y,t.x,t.y,a.x,a.y,l.x,l.y],b=[],M=1e-8;for(let e=0;e<2;++e)if(0==e?(n=6*c-12*x+6*g,r=-3*c+9*x-9*g+3*m,s=3*x-3*c):(n=6*y-12*f+6*d,r=-3*y+9*f-9*d+3*v,s=3*f-3*y),Math.abs(r)<M){if(Math.abs(n)<M)continue;i=-s/n,i>0&&i<1&&b.push(i)}else h=n*n-4*s*r,h<0?Math.abs(h)<M&&(i=-n/(2*r),i>0&&i<1&&b.push(i)):(u=Math.sqrt(h),o=(-n+u)/(2*r),o>0&&o<1&&b.push(o),p=(-n-u)/(2*r),p>0&&p<1&&b.push(p));let A=b.length;for(;A--;)i=b[A];return[...new Set(b)].sort()}function ne(e,t,a){if(!ee(e,[t,a]))return[];let l,r,n,[s,i,o,p,h,u]=[e.x,e.y,t.x,t.y,a.x,a.y],c=[];for(let e=0;e<2;++e)l=0==e?s-2*o+h:i-2*p+u,r=0==e?-2*s+2*o:-2*i+2*p,Math.abs(l)>1e-12&&(n=-r/(2*l),n>0&&n<1&&c.push(n));return[...new Set(c)].sort()}function se(e,t=.001){let a=Math.PI/2,l=a/2;return!(Math.abs(e/a-Math.round(e/a))<t)&&Math.abs(e/l-Math.round(e/l))<t}function ie(e,t,a=!1){let l=a?t[0]-e[0]:t.x-e.x,r=a?t[1]-e[1]:t.y-e.y;return Q(l*l+r*r)}function oe(e,t){let a=t.x-e.x,l=t.y-e.y;return a*a+l*l}function pe(e,t){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)}function he(e,t){return.5*(Math.abs(t.x-e.x)+Math.abs(t.y-e.y))}function ue(e,t=48){if(!Array.isArray(e)||e.length<=t)return e;let a=e.length,l=a/t,r=[];for(let a=0;a<t;a++)r.push(e[Math.floor(a*l)]);let n=r.length;return r[n-1]!==e[a-1]&&(r[n-1]=e[a-1]),r}function ce(e,t){if(!e||!t)return{a:1,b:0,c:0,d:1,e:0,f:0};return e.getScreenCTM().inverse().multiply(t.getScreenCTM())}function ye(e){let t=[],a=[e[0]],l=e.length;for(let r=1;r<l;r++){let l=e[r];"M"!==l.type&&"m"!==l.type||(t.push(a),a=[]),a.push(l)}return a.length&&t.push(a),t}function xe(e,t){let a,l,r,n,s,i,o=[],p=[],h=e[0],u=e[1],c=e[e.length-2],y=e[e.length-1];return 4===e.length?(a=H([h,u],t),l=H([u,c],t),r=H([c,y],t),n=H([a,l],t),s=H([l,r],t),i=H([n,s],t),o.push({x:h.x,y:h.y},{x:a.x,y:a.y},{x:n.x,y:n.y},{x:i.x,y:i.y}),p.push({x:i.x,y:i.y},{x:s.x,y:s.y},{x:r.x,y:r.y},{x:y.x,y:y.y})):3===e.length?(l=H([h,u],t),r=H([u,y],t),i=H([l,r],t),o.push({x:h.x,y:h.y},{x:l.x,y:l.y},{x:i.x,y:i.y}),p.push({x:i.x,y:i.y},{x:r.x,y:r.y},{x:y.x,y:y.y})):2===e.length&&(l=H([h,y],t),o.push({x:h.x,y:h.y},{x:l.x,y:l.y}),p.push({x:l.x,y:l.y},{x:y.x,y:y.y})),[o,p]}function fe(e,t,{tMin:a=0,tMax:l=1,addExtremes:r=!0,addSemiExtremes:n=!1}={}){let s=[],i=6===t.length?"C":"Q",o={x:t[0],y:t[1]},p="C"===i?{x:t[2],y:t[3]}:o,h={x:t[4],y:t[5]},u=0;let c="C"===i?[e,o,p,h]:[e,o,h],y=r?te(c,{addExtremes:r,addSemiExtremes:!1}):[],x=n?te(c,{addExtremes:r,addSemiExtremes:n}):[],f=Array.from(new Set([...y,...x])).sort();if(f=f.filter(e=>e>0&&e<1),f.length){let a=function(e,t,a,l=!0){let r=[];if(!a.length)return!1;let n,s,i,o=t.length,p={x:t[o-2],y:t[o-1]};2===t.length?i=[e,p]:4===t.length?(n={x:t[0],y:t[1]},i=[e,n,p]):6===t.length&&(n={x:t[0],y:t[1]},s={x:t[2],y:t[3]},i=[e,n,s,p]);if(a.length)if(1===a.length){let e=xe(i,a[0]),t=e[0],l=e[1];r.push(t,l)}else{let e=a[0],t=xe(i,e),l=t[0];r.push(l),i=t[1];for(let t=1;t<a.length;t++){e=a[t-1];let l=xe(i,(a[t]-e)/(1-e));r.push(l[0]),t===a.length-1&&r.push(l[l.length-1]),i=l[1]}}if(l){let e,t,a=[];return r.forEach(l=>{e={type:"",values:[]},l.shift(),t=l.map(e=>Object.values(e)).flat(),e.values=t,3===l.length?e.type="C":2===l.length?e.type="Q":1===l.length&&(e.type="L"),a.push(e)}),a}return r}(e,t,f);s.push(...a),u+=a.length}else s.push({type:i,values:t});return{pathData:s,count:u}}function ge(e,{tMin:t=0,tMax:a=1,addExtremes:l=!0,addSemiExtremes:r=!1}={}){let n=[e[0]],s={x:e[0].values[0],y:e[0].values[1]},i={x:e[0].values[0],y:e[0].values[1]},o=e.length;for(let p=1;o&&p<o;p++){let o=e[p],{type:h,values:u}=o,c=u.slice(-2);if(c[0],c[1],"C"!==h&&"Q"!==h)n.push(o);else if((l||r)&&("C"===h||"Q"===h)){let e=fe(s,u,{tMin:t,tMax:a,addExtremes:l,addSemiExtremes:r}).pathData;n.push(...e)}s={x:c[0],y:c[1]},"z"===h.toLowerCase()?s=i:"M"===h&&(i={x:c[0],y:c[1]})}return n}function de(e){let t=[];for(let a=1,l=e.length;a<l;a++){let l=e[a],{type:r,values:n,p0:s=null,p:i=null,dimA:o=0}=l;n.length&&i&&s&&(o=o||pe(s,i),o&&t.push(o))}let a=t.sort(),l=Math.ceil(a.length/8);a=a.slice(0,l);let r=a.reduce((e,t)=>e+t,0)/l,n=r>112.5?0:Math.floor(75/r).toString().length;return Math.min(Math.max(0,n),8)}function me(e=0,t=3){if(!t)return Math.round(e);let a=10**t;return Math.round(e*a)/a}function ve(e,t=10){let a=8;a=e>t?0:e>5?1:Math.ceil(t/e).toString().length;let l=10**a;return Math.round(e*l)/l}function be(e,t=-1){if(t<0)return e;let a=e.length,l=t;for(let t=0;t<a;t++){let a=e[t],{values:r}=a,n=r.length;if(n)for(let a=0;a<n;a++)e[t].values[a]=me(r[a],l)}return e}const Me=["x","cx","rx","dx","width","translateX"],Ae=["y","cy","ry","dy","height","translateY"],we=["path","polygon","polyline","line","rect","circle","ellipse"],Ce=["textPath","text","tspan"],ke=["stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-linecap","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","stroke-opacity"],Se={atts:{id:"*",class:"*",viewBox:["symbol","svg"],preserveAspectRatio:["symbol","svg"],width:["svg","rect","use","image"],height:["svg","rect","use","image"],d:["path"],points:["polygon","polyline"],x:["image","rect","text","textPath","tspan","use","mask"],y:["image","rect","text","textPath","tspan","use","mask"],x1:["line","linearGradient"],x2:["line","linearGradient"],y1:["line","linearGradient"],y2:["line","linearGradient"],r:["circle","radialGradient"],rx:["rect","ellipse"],ry:["rect","ellipse"],cx:["circle","ellipse","radialGradient"],cy:["circle","ellipse","radialGradient"],refX:["symbol","markers"],refY:["symbol","markers"],transform:["svg","g","use",...we,...Ce],"transform-origin":["svg","g","use",...we,...Ce],fill:["svg","g","use",...we,...Ce,"animate","animateMotion"],"fill-opacity":["svg","g","use",...we,...Ce],"fill-rule":["svg","g","path","polygon","text","textPath"],opacity:["svg","g","use",...we,...Ce],stroke:["svg","g","use",...we,...Ce],"stroke-width":["svg","g","use",...we,...Ce,"mask"],"stroke-opacity":["svg","g","use",...we,...Ce,"mask"],"stroke-miterlimit":["svg","g","use",...we,...Ce,"mask"],"stroke-linejoin":["svg","g","use",...we,...Ce,"mask"],"stroke-linecap":["svg","g","use",...we,...Ce,"mask"],"stroke-dashoffset":["svg","g","use",...we,...Ce,"mask"],"stroke-dasharray":["svg","g","use",...we,...Ce,"mask"],"clip-path":["svg","g","use",...we,...Ce],"clip-rule":["path","polygon"],clipPathUnits:["clipPath"],mask:["svg","g","use",...we,...Ce],maskContentUnits:["mask"],maskUnits:["mask"],"font-family":["svg","g",...Ce],"font-size":["svg","g",...Ce],"font-style":["svg","g",...Ce],"font-weight":["svg","g",...Ce],"font-stretch":["svg","g",...Ce],"dominant-baseline":[...Ce],lengthAdjust:[...Ce],"text-anchor":["text"],textLength:["text","textPath","tspan"],dx:["text","tspan"],dy:["text","tspan"],method:["textPath"],spacing:["textPath"],startOffset:["textPath"],rotate:["text","tspan","animateMotion"],side:["textPath"],"white-space":["svg","g",...Ce],color:["svg","g",...Ce],playbackorder:["svg"],timelinebegin:["svg"],dur:["animate","animateTransform","animateMotion"],end:["animate","animateTransform","animateMotion"],from:["animate","animateTransform","animateMotion"],to:["animate","animateTransform","animateMotion"],type:["animateTransform"],values:["animate","animateTransform","animateMotion"],accumulate:["animate","animateTransform","animateMotion"],additive:["animate","animateTransform","animateMotion"],attributeName:["animate","animateTransform"],begin:["animate","animateTransform","animateMotion"],by:["animate","animateTransform","animateMotion"],calcMode:["animate","animateTransform","animateMotion"],keyPoints:["animateMotion"],keySplines:["animate","animateTransform","animateMotion"],keyTimes:["animate","animateTransform","animateMotion"],max:["animate","animateTransform","animateMotion"],min:["animate","animateTransform","animateMotion"],origin:["animateMotion"],repeatCount:["animate","animateTransform","animateMotion"],repeatDur:["animate","animateTransform","animateMotion"],restart:["animate","animateTransform","animateMotion"],gradientUnits:["linearGradient","radialGradient"],gradientTransform:["linearGradient","radialGradient"],fr:["radialGradient"],fx:["radialGradient"],fy:["radialGradient"],offset:["stop"],"stop-color":["stop"],"stop-opacity":["stop"],spreadMethod:["linearGradient","radialGradient"],href:["pattern","textPath","linearGradient","radialGradient","use","animate","animateTransform","animateMotion","image"],pathLength:[...we]},defaults:{transform:["none","matrix(1, 0, 0, 1, 0, 0)"],"transform-origin":["0px, 0px","0 0"],rx:["0","0px"],ry:["0","0px"],x:["0","0px"],y:["0","0px"],fill:["black","rgb(0, 0, 0)","rgba(0, 0, 0, 0)","#000","#000000"],color:["black","rgb(0, 0, 0)","rgba(0, 0, 0, 0)","#000","#000000"],stroke:["none"],"stroke-width":["1","1px"],opacity:["1"],"fill-opacity":["1"],"stroke-opacity":["1"],"stroke-linecap":["butt"],"stroke-miterlimit":["4"],"stroke-linejoin":["miter"],"stroke-dasharray":["none"],"stroke-dashoffset":["0","0px","none"],pathLength:["none"],"font-family":["serif"],"font-weight":["normal","400"],"font-stretch":["normal"],"font-width":["normal"],"letter-spacing":["auto","normal","0"],lengthAdjust:["spacing"],"text-anchor":["start"],"dominant-baseline":["auto"],spacing:["auto"],"white-space":["normal"],"stop-opacity":["1"],gradientUnits:["objectBoundingBox"],patternUnits:["objectBoundingBox"],"clip-path":["none"],"clip-rule":["nonzero"],"fill-rule":["nonzero"],clipPathUnits:["userSpaceOnUse"],mask:["none"],maskUnits:["objectBoundingBox"]}};function Ee(e=null,{unit:t=null,width:a=0,height:l=0,decimals:r=-1,isHorizontal:n=!1,isVertical:s=!1,autoRoundValues:i=!1,dpi:o=96,fontSize:p=16,normalizedDiagonal:h=!1}={}){if(h=a!==l&&h,!e)return e;let u=e.split(/,| /).length>1,c=e.includes("("),y=function(e=""){return!isNaN(e)||!isNaN(parseFloat(e))}(e);if(!y||u||c)return e;t=t||function(e){if(!e||!isNaN(e))return"";e=e.replace(/\+|\-/g,"");let t=e.match(/[^\d|.]+/g)[0];return t}(e);let x=parseFloat(e),f=1,g=Math.sqrt(a*a+l*l)/1.4142135623730951;if(!t)return x;switch(t){case"%":f=a&&n?a/100:l&&s?l/100:h?g/100:1;break;case"rad":f=A;break;case"turn":f=360;break;case"in":f=o;break;case"pt":f=1/72*o;break;case"cm":f=1/2.54*o;break;case"mm":f=1/2.54*o/10;break;case"em":case"rem":f=p;break;default:f=1}let d=x*f;return i?d=ve(d):r>-1&&(d=+d.toFixed(r)),d}function Pe(e,{x:t=0,y:a=0,width:l=0,height:r=0}={}){let n=[...e.attributes],s={};return n.forEach(e=>{let n=Ee(e.nodeValue,{x:t,y:a,width:l,height:r});s[e.name]=n}),s}function Le(e,t=-1){let a=e.map(e=>e.x),l=e.map(e=>e.y),r=Math.min(...a),n=Math.max(...a),s=Math.min(...l),i=Math.max(...l),o={x:r,left:r,right:n,y:s,top:s,bottom:i,width:n-r,height:i-s};if(t>-1)for(let e in o)o[e]=+o[e].toFixed(t);return o}function De(e){let t=[];return e.forEach(e=>{let a=function(e){let t=Ie(e),a=Le(t);return a}(e);t.push(a)}),t}function Te(e,t){let[a,l,r,n,s,i]=[e.x,e.y,e.width,e.height,e.x+e.width,e.y+e.height],[o,p,h,u,c,y]=[t.x,t.y,t.width,t.height,t.x+t.width,t.y+t.height],x=!1;return r*n!=h*u&&r*n>h*u&&a<o&&s>c&&l<p&&i>y&&(x=!0),x}function Ie(e){let t=[];for(let a=0;a<e.length;a++){let l=e[a],r=a>0?e[a-1]:e[a],{type:n,values:s}=l,i={x:r.values[r.values.length-2],y:r.values[r.values.length-1]},o=s.length?{x:s[s.length-2],y:s[s.length-1]}:"",p=s.length?{x:s[0],y:s[1]}:"";switch(n){case"A":if("function"!=typeof arcToBezier){let e=ie(i,o)/2,a=Z(i,o,.5),l=Y(a.x,a.y,e,e,0),r=Y(a.x,a.y,e,e,Math.PI);t.push(l,r,o);break}arcToBezier(i,s).forEach(e=>{let a=e.values,l={x:a[0],y:a[1]},r={x:a[2],y:a[3]},n={x:a[4],y:a[5]};t.push(l,r,n)});break;case"C":let e={x:s[2],y:s[3]};t.push(p,e);break;case"Q":t.push(p)}"z"!==n.toLowerCase()&&t.push(o)}return t}function $e(e,t=9){let a=0,l=[],r=ye(e),n=r.length>1,s=[];if(n){let e=De(r);e.forEach(function(t,a){for(let a=0;a<e.length;a++){let l=e[a];if(t!=l){Te(t,l)&&s.push(a)}}})}return r.forEach((e,t)=>{l=[];let r=0,n=0,i=1,o=[];e.forEach(function(t,a){let[n,s]=[t.type,t.values],i=s.length;if(s.length){let p=(a>0?e[a-1]:e[0]).values,h=p.length,u={x:p[h-2],y:p[h-1]},c={x:s[i-2],y:s[i-1]};if("C"===n||"Q"===n){let e={x:s[0],y:s[1]};o="C"===n?[u,e,{x:s[2],y:s[3]},c]:[u,e,c];let t=Math.abs(function(e,t=!1){let a,[l,r,n,s]=[e[0],e[1],e[2],e[e.length-1]];if(e.length<3)return 0;3===e.length&&(r={x:1*e[0].x/3+2*e[1].x/3,y:1*e[0].y/3+2*e[1].y/3},n={x:1*e[2].x/3+2*e[1].x/3,y:1*e[2].y/3+2*e[1].y/3});return a=3*(l.x*(-2*r.y-n.y+3*s.y)+r.x*(2*l.y-n.y-s.y)+n.x*(l.y+r.y-2*s.y)+s.x*(-3*l.y+r.y+2*n.y))/20,t?Math.abs(a):a}(o));r+=t,l.push(u,c)}else if("A"===n){let e=J(u.x,u.y,t.values[0],t.values[1],t.values[2],t.values[3],t.values[4],c.x,c.y),{cx:a,cy:n,rx:s,ry:i,startAngle:o,endAngle:p,deltaAngle:h}=e,y=Math.abs(function(e,t,a,l){const r=Math.PI*e*t;let n=(l-a+2*Math.PI)%(2*Math.PI);if(e===t)return r*(n/(2*Math.PI));const s=a=>Math.atan2(e*Math.sin(a),t*Math.cos(a));return a=s(a),l=s(l),n=(l-a+2*Math.PI)%(2*Math.PI),r*(n/(2*Math.PI))}(s,i,o,p));y-=Math.abs(Fe([u,{x:a,y:n},c])),l.push(u,c),r+=y}else l.push(u,c)}});let p=Fe(l);-1!==s.indexOf(t)&&(i=-1),n=p<0&&r<0?(Math.abs(r)-Math.abs(p))*i:(Math.abs(r)+Math.abs(p))*i,a+=n}),a}function Fe(e,t=!1){let a=0,l=e.length;for(let t=0;l&&t<l;t++){a+=e[t].x*e[t===e.length-1?0:t+1].y*.5-e[t===e.length-1?0:t+1].x*e[t].y*.5}return t&&(a=Math.abs(a)),a}function qe(e,t=0){t=parseFloat(t);let a=e.length,l=t>1,r=!l&&!t,n="",s=e[0].values.join(" "),i=l?"\n":r?"":" ",o=r?"":" ";n=`${e[0].type}${o}${s}${i}`;for(let t=1;t<a;t++){let a=e[t-1],l=e[t],{type:p,values:h}=l;if(s="",!r||"A"!==p&&"a"!==p||(h=[h[0],h[1],h[2],`${h[3]}${h[4]}${h[5]}`,h[6]]),p=r&&a.type===l.type&&"m"!==l.type.toLowerCase()||r&&"M"===a.type&&"L"===l.type?" ":l.type,r){let e=!1;for(let t=0,a=h.length;t<a;t++){let a=h[t],l=a.toString(),r=l.includes(".")&&Math.abs(a)<1;r&&e&&(l=l.replace(/^0\./,".")),!(t>0)||e&&r||(s+=" "),s+=l,e=r}n+=`${p}${o}${s}${i}`}else n+=`${p}${o}${h.join(" ")}${i}`}return r&&(n=n.replace(/[A-Za-z]0(?=\.)/g,e=>e[0]).replace(/ 0\./g," .").replace(/ -/g,"-").replace(/-0\./g,"-.").replace(/Z/g,"z")),n}function Ne(e,t,a=0,l=1,r=!1){const n=(e,t,a,l,r)=>{let n=1-r;return{x:3*n*n*(t.x-e.x)+6*n*r*(a.x-t.x)+3*r*r*(l.x-a.x),y:3*n*n*(t.y-e.y)+6*n*r*(a.y-t.y)+3*r*r*(l.y-a.y)}};let s=[e,t],i=he(e.p0,e.p)>he(t.p0,t.p),o=JSON.parse(JSON.stringify(e)),p=JSON.parse(JSON.stringify(t)),h=U(o.p0,o.cp1,p.p,p.cp2,!1);if(!h)return s;if(i){let a={p0:{x:e.p.x,y:e.p.y},cp1:{x:e.cp2.x,y:e.cp2.y},cp2:{x:e.cp1.x,y:e.cp1.y},p:{x:e.p0.x,y:e.p0.y}};e={p0:{x:t.p.x,y:t.p.y},cp1:{x:t.cp2.x,y:t.cp2.y},cp2:{x:t.cp1.x,y:t.cp1.y},p:{x:t.p0.x,y:t.p0.y}},t=a}let u=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),c=(e,t)=>({x:e.x*t,y:e.y*t}),y=(e,t)=>e.x*t.x+e.y*t.y,x=t.p0,f=n(t.p0,t.cp1,t.cp2,t.p,0),g=y(u(e.p0,x),f)/y(f,f),d=H([t.p0,t.cp1,t.cp2,t.p],g),m=n(t.p0,t.cp1,t.cp2,t.p,g);g-=y(u(d,e.p0),m)/y(m,m);let v=H([t.p0,t.cp1,t.cp2,t.p],g),b=t.p,M=n(t.p0,t.cp1,t.cp2,t.p,g),A=n(t.p0,t.cp1,t.cp2,t.p,1),w=1-g,C=(k=v,S=c(M,w/3),{x:k.x+S.x,y:k.y+S.y});var k,S;let E=u(b,c(A,w/3)),P={p0:v,cp1:C,cp2:E,p:b,t0:g};i&&(P={p0:b,cp1:E,cp2:C,p:v,t0:g});let L=.5*(1-g),D=H([P.p0,P.cp1,P.cp2,P.p],L,!1,!0),T=D.cpts[2],I=U(D,T,P.p0,h,!1),$=U(D,T,P.p,h,!1),F=Z(P.p0,I,1.333),q=Z(P.p,$,1.333);if(U(o.p0,F,p.p,q,!0))return s;P.cp1=F,P.cp2=q;let N=he(o.p0,P.p0)+he(p.p,P.p);if(P.p0=o.p0,P.p=p.p,P.extreme=p.extreme,P.corner=p.corner,P.dimA=p.dimA,P.directionChange=p.directionChange,P.type="C",P.values=[P.cp1.x,P.cp1.y,P.cp2.x,P.cp2.y,P.p.x,P.p.y],N<a){let t=i?1+g:Math.abs(g),n=1+Math.abs(g);if(t=i?1+g:Math.abs(g)/n,he(H([P.p0,P.cp1,P.cp2,P.p],t),e.p)>a*l)return s;let h=$e([{type:"M",values:[o.p0.x,o.p0.y]},{type:"C",values:[o.cp1.x,o.cp1.y,o.cp2.x,o.cp2.y,o.p.x,o.p.y]},{type:"C",values:[p.cp1.x,p.cp1.y,p.cp2.x,p.cp2.y,p.p.x,p.p.y]}]),u=[{type:"M",values:[P.p0.x,P.p0.y]},{type:"C",values:[P.cp1.x,P.cp1.y,P.cp2.x,P.cp2.y,P.p.x,P.p.y]}],c=$e(u),y=Math.abs(c/h-1);P.error=5*y*l,r&&qe(u),y<.05*l&&(s=[P])}return s}function ze(e,{keepExtremes:t=!0,keepInflections:a=!0,keepCorners:l=!0,extrapolateDominant:r=!0,tolerance:n=1}={}){let s=[e[0]],i=e.length;for(let r=2;i&&r<=i;r++){let o=e[r-1],p=r<i?e[r]:null,h=p?.type||null,{type:u,values:c,p0:y,p:x,cp1:f=null,cp2:g=null,extreme:d=!1,directionChange:m=!1,corner:v=!1,dimA:b=0}=o;if("C"===u&&"C"===h)if(l&&v||t&&d)s.push(o);else{let h=je(o,p,{tolerance:n}),u=0;if(1===h.length){o=h[0];let p=1;u+=o.error;for(let s=r+1;u<n&&s<i;s++){let r=e[s];if("C"!==r.type||a&&o.directionChange||l&&o.corner||t&&o.extreme)break;let i=je(o,r,{tolerance:n});if(i.length>1)break;u+=.5*i[0].error,p++,o=i[0]}s.push(o),r<i&&(r+=p)}else s.push(o)}else s.push(o)}return s}function je(e,t,{tolerance:a=1}={}){let l=[e,t],r=function(e,t){let a=pe(e.cp2,e.p);if(0===a)return 0;let l=pe(e.p,t.cp1);if(0===l)return 0;let r=pe(e.cp2,t.cp1);return a/r}(e,t);if(!r)return l;let n=pe(e.p0,e.p),s=pe(t.p0,t.p),i=.08*Math.max(0,Math.min(n,s))*a,o=function(e,t,a=0){let{p0:l,cp1:r}=e,{p:n,cp2:s}=t;return r={x:(r.x-(1-a)*l.x)/a,y:(r.y-(1-a)*l.y)/a},s={x:(s.x-a*n.x)/(1-a),y:(s.y-a*n.y)/(1-a)},{p0:l,cp1:r,cp2:s,p:n}}(e,t,r),p=H([o.p0,o.cp1,o.cp2,o.p],r),h=pe(e.p,p),u=0,c=0,y=!1,x=h;if(h<i){let a=.5*(1+r);if(u=pe(H([t.p0,t.cp1,t.cp2,t.p],.5),H([o.p0,o.cp1,o.cp2,o.p],a)),x+=u,u<i){let t=.5*r;c=pe(H([e.p0,e.cp1,e.cp2,e.p],.5),H([o.p0,o.cp1,o.cp2,o.p],t)),x+=c,x<i&&(y=!0)}}return y&&(o.p0=e.p0,o.p=t.p,o.dimA=pe(o.p0,o.p),o.type="C",o.extreme=t.extreme,o.directionChange=t.directionChange,o.corner=t.corner,o.values=[o.cp1.x,o.cp1.y,o.cp2.x,o.cp2.y,o.p.x,o.p.y],o.error=x/i,l=[o]),l}function Be(e,{tolerance:t=1,debug:a=!1}={}){let l=!1,r={flat:!0,steepness:0},n=e[0],s=e[e.length-1],i=new Set([...e.map(e=>+e.x.toFixed(8))]),o=new Set([...e.map(e=>+e.y.toFixed(8))]);if(1===i.size||1===o.size)return!a||r;let p=oe(n,s),h=p/1e3*t,u=Fe(e,!0);return u<h&&(l=!0),a&&(r.flat=l,r.steepness=u/p*10),a?r:l}function Qe(t=[],{detectExtremes:a=!0,detectCorners:l=!0,detectDirection:r=!0,detectSemiExtremes:n=!1,debug:s=!1,addSquareLength:i=!0,addArea:o=!0}={}){let p=[],h=Le(W(t=Oe(t,{addSquareLength:i,addArea:o}))),{left:u,right:c,top:y,bottom:x,width:f,height:g}=h;t[0].corner=!1,t[0].extreme=!1,t[0].semiExtreme=!1,t[0].directionChange=!1,t[0].closePath=!1;let d=[t[0]],m=t.length;for(let a=2;m&&a<=m;a++){let l=t[a-1],{type:r,values:i,p0:o,p:p,cp1:h=null,cp2:f=null,squareDist:g=0,cptArea:m=0,dimA:v=0}=l,b=t[a]||null;l.corner=!1,l.extreme=!1,l.semiExtreme=!1,l.directionChange=!1,l.closePath=!1;let M="C"===r||"Q"===r?"C"===r?[o,h,f,p]:[o,h,p]:[o,p],A=.1*v,w=.01*A,C="Q"===r||"C"===r,k=b&&("Q"===b.type||"C"===b.type),S=!1;
1
+ function e(e,t,a="red",l="1%",r="1",n="",s=!0,i="",o=""){Array.isArray(t)&&(t={x:t[0],y:t[1]});let u=`<circle class="${o}" opacity="${r}" id="${i}" cx="${t.x}" cy="${t.y}" r="${l}" fill="${a}">\n <title>${n}</title></circle>`;if(!s)return u;e.insertAdjacentHTML("beforeend",u)}function t(e,t="",a="green",l="1%",r="1",n=!0){let s=`<path d="${t}" fill="none" stroke="${a}" stroke-width="${l}" stroke-opacity="${r}" /> `;if(!n)return s;e.insertAdjacentHTML("beforeend",s)}const{abs:a,acos:l,asin:r,atan:n,atan2:s,ceil:i,cos:o,exp:u,floor:h,log:p,hypot:c,max:y,min:f,pow:x,random:g,round:d,sin:m,sqrt:v,tan:b,PI:M}=Math,A=180/Math.PI,w=Math.PI/180,C="http://www.w3.org/2000/svg",k=.39370078,{abs:S,acos:E,asin:P,atan:L,atan2:$,ceil:D,cos:T,exp:z,floor:I,log:q,max:j,min:N,pow:F,random:B,round:Q,sin:R,sqrt:O,tan:U,PI:V}=Math;function _(e,t,a=!1){let l=$(t.y-e.y,t.x-e.x);return a&&l<0&&(l+=2*Math.PI),l}function G(e,t,a,l=!1){let r=Math.atan2(t.y-e.y,t.x-e.x),n=Math.atan2(a.y-e.y,a.x-e.x),s=n-r;s=(e=>{let t=e%(2*Math.PI);return t>Math.PI?t-=2*Math.PI:t<=-Math.PI&&(t+=2*Math.PI),t})(s),l&&(s=2*Math.PI-Math.abs(s));let i=180/Math.PI;return{startAngle:r,endAngle:n,deltaAngle:s,startAngleDeg:r*i,endAngleDeg:n*i,deltaAngleDeg:s*i}}function H(e=null,t=null,a=null,l=null,r=!0,n=!1,s=!1){let i,o,u,h,p,c={};if(!(e&&t&&a&&l))return s&&console.warn("points missing"),!1;if(e.x===t.x&&e.y===t.y||a.x===l.x&&a.y===l.y)return!1;try{if(i=(l.y-a.y)*(t.x-e.x)-(l.x-a.x)*(t.y-e.y),0===i)return!1}catch{return s&&console.warn("!catch",e,t,"p3:",a,"p4:",l),!1}o=e.y-a.y,u=e.x-a.x,h=(l.x-a.x)*o-(l.y-a.y)*u,p=(t.x-e.x)*o-(t.y-e.y)*u,o=h/i,u=p/i,c={x:e.x+o*(t.x-e.x),y:e.y+o*(t.y-e.y)};let y=!1;return o>0&&o<1&&u>0&&u<1&&(y=!0),!r&&n&&(o>0&&u<0||o<0&&u>0)?(y=!1,!1):!(r&&!y)&&c}function X(e,t,a,l=!1){const r=(e,t,a)=>e>=t&&e<=a||e<=t&&e>=a;let n=!1;if((!l||!a.bottom)&&(a.left>e.x||a.top>e.y||a.bottom<e.y||a.right<e.x))return!1;let s=t.length;for(let a=s-1,l=0;l<s;a=l,l++){const s=t[a],i=t[l];if(e.x==s.x&&e.y==s.y||e.x==i.x&&e.y==i.y)return!0;if(s.y==i.y&&e.y==s.y&&r(e.x,s.x,i.x))return!0;if(r(e.y,s.y,i.y)){if(e.y==s.y&&i.y>=s.y||e.y==i.y&&s.y>=i.y)continue;const t=(s.x-e.x)*(i.y-e.y)-(i.x-e.x)*(s.y-e.y);if(0==t)return!0;s.y<i.y==t>0&&(n=!n)}}return!!n}function Z(e,t,a,l=!1){let r={x:(t.x-e.x)*a+e.x,y:(t.y-e.y)*a+e.y};return l&&(r.angle=_(e,t),r.angle<0&&(r.angle+=2*V)),r}function Y(e,t=.5,a=!1,l=!1,r=!1){let n;return Array.isArray(e[0])&&(e=e.map(e=>({x:e[0],y:e[1]})),r=!0),n=e.length>2?((e,t,a=!1)=>{let r=4===e.length,n=e[0],s=e[1],i=r?e[2]:e[1],o=e[e.length-1],u={x:0,y:0};if(a||l){let e,a,h,p,c,y=n.x===s.x&&n.y===s.y,f=o.x===i.x&&o.y===i.y;0!==t||y?1!==t||f?(y&&(t+=1e-7),f&&(t-=1e-7),e=Z(n,s,t),r?(a=Z(s,i,t),h=Z(i,o,t),p=Z(e,a,t),c=Z(a,h,t),u=Z(p,c,t),u.angle=_(p,c),l&&(u.cpts=[a,h,p,c])):(a=Z(n,s,t),h=Z(s,o,t),u=Z(a,h,t),u.angle=_(a,h),l&&(u.cpts=[a,h]))):(u.x=o.x,u.y=o.y,u.angle=_(i,o)):(u.x=n.x,u.y=n.y,u.angle=_(n,s))}else{let e=1-t;u=r?{x:e**3*n.x+3*e**2*t*s.x+3*e*t**2*i.x+t**3*o.x,y:e**3*n.y+3*e**2*t*s.y+3*e*t**2*i.y+t**3*o.y}:{x:e*e*n.x+2*e*t*s.x+t**2*o.x,y:e*e*n.y+2*e*t*s.y+t**2*o.y}}return u})(e,t,a):Z(e[0],e[1],t,a),a&&n.angle<0&&(n.angle+=2*V),r?[n.x,n.y]:n}function W(e){let t=[],a={x:e[0].values[0],y:e[0].values[1]};return e.forEach(e=>{let{type:l,values:r}=e;if(r.length){let e=r.length>1?{x:r[r.length-2],y:r[r.length-1]}:"V"===l?{x:a.x,y:r[0]}:{x:r[0],y:a.y};t.push(e),a=e}}),t}function J(e,t,a,l,r,n,s,i,o){const u=(e,t,a,l)=>$(l-t,a-e);let h={cx:0,cy:0,rx:a=S(a),ry:l=S(l),startAngle:0,endAngle:0,deltaAngle:0,clockwise:s,xAxisRotation:r,largeArc:n,sweep:s};if(0==a||0==l)throw Error("rx and ry can not be 0");if(a===l){let a=Math.abs(i-e),l=Math.abs(o-t),r=a,n=Math.min(e,i),u=Math.min(t,o),p=.5*Math.PI;if(0===a&&l||0===l&&a)return r=0===a&&l?l/2:a/2,h.rx=r,h.ry=r,0===a&&l?(h.cx=e,h.cy=u+l/2,h.startAngle=t>o?p:-p,h.endAngle=t>o?-p:p,h.deltaAngle=s?Math.PI:-Math.PI):0===l&&a&&(h.cx=n+a/2,h.cy=t,h.startAngle=e>i?Math.PI:0,h.endAngle=e>i?-Math.PI:Math.PI,h.deltaAngle=s?Math.PI:-Math.PI),h}let p,c,y=a===l?0:r*V/180,f=y?Math.sin(y):0,x=y?Math.cos(y):1,g=(e-i)/2,d=(t-o)/2,m=(e+i)/2,v=(t+o)/2,b=y?x*g+f*d:g,M=y?x*d-f*g:d,A=b*b/(a*a)+M*M/(l*l);A>1&&(a*=Math.sqrt(A),l*=Math.sqrt(A),h.rx=a,h.ry=l);let w=a*l,C=a*M,k=l*b,E=C**2+k**2;if(!E)throw Error("start point can not be same as end point");let P=Math.sqrt(Math.abs((w*w-E)/E));n==s&&(P=-P);let L=P*C/l,D=-P*k/a;p=y?x*L-f*D+m:m+L,c=y?f*L+x*D+v:v+D,h.cy=c,h.cx=p;let T=u(p,c,e,t),z=u(p,c,i,o);!s&&z>T&&(z-=2*Math.PI),s&&T>z&&(z=z<=0?z+2*Math.PI:z);let I=z-T;return h.startAngle=T,h.endAngle=z,h.deltaAngle=I,h}function K(e,t,a,l=0,r=!1){return l?(l=r?l/180*Math.PI:l,{x:t+(e.x-t)*Math.cos(l)-(e.y-a)*Math.sin(l),y:a+(e.x-t)*Math.sin(l)+(e.y-a)*Math.cos(l)}):e}function ee(e,t,a,l,r,n=0,s=!0,i=!1){if(r=i?r*V/180:r,n=i?n*V/180:n,n=a!==l&&n!==2*V?n:0,s&&a!==l){let e=L(U(r=n?r-n:r)*(a/l));r=T(r)<0?e+V:e}let o=e+a*T(r),u=t+l*R(r),h={x:o,y:u};return n&&(h.x=e+(o-e)*T(n)-(u-t)*R(n),h.y=t+(o-e)*R(n)+(u-t)*T(n)),h}function te(e,t,a){if(t===a||e%V*.5==0)return e;let l=L(U(e)*(t/a));return l=T(e)<0?l+V:l,l}function ae(e=null,t=[]){e||(e=t[0],t=t.slice(1,t.length));let a=t.length,l=t[a-1],r=t[0],n=3===a?t[1]:r,s=Math.min(e.y,l.y),i=Math.min(e.x,l.x),o=Math.max(e.x,l.x),u=Math.max(e.y,l.y);return!(r.y>=s&&r.y<=u&&n.y>=s&&n.y<=u&&r.x>=i&&r.x<=o&&n.x>=i&&n.x<=o)}function le(e,{addExtremes:t=!0,addSemiExtremes:a=!1}={}){let l=4===e.length?function(e,t,a,l,{addExtremes:r=!0,addSemiExtremes:n=!1}={}){const s=e=>{const t=Math.PI/4,a=Math.cos(t),l=Math.sin(t);return{x:e.x*a-e.y*l,y:e.x*l+e.y*a}};n&&(e=s(e),t=s(t),a=s(a),l=s(l));let[i,o,u,h,p,c,y,f]=[e.x,e.y,t.x,t.y,a.x,a.y,l.x,l.y],x=Math.min(e.y,l.y),g=Math.min(e.x,l.x),d=Math.max(e.x,l.x),m=Math.max(e.y,l.y);if(t.y>=x&&t.y<=m&&a.y>=x&&a.y<=m&&t.x>=g&&t.x<=d&&a.x>=g&&a.x<=d)return[];let v,b,M,A,w,C,k,S,E=[];for(let e=0;e<2;++e)if(0==e?(b=6*i-12*u+6*p,v=-3*i+9*u-9*p+3*y,M=3*u-3*i):(b=6*o-12*h+6*c,v=-3*o+9*h-9*c+3*f,M=3*h-3*o),Math.abs(v)<1e-8){if(Math.abs(b)<1e-8)continue;A=-M/b,0<A&&A<1&&E.push(A)}else k=b*b-4*M*v,k<0?Math.abs(k)<1e-8&&(A=-b/(2*v),0<A&&A<1&&E.push(A)):(S=Math.sqrt(k),w=(-b+S)/(2*v),0<w&&w<1&&E.push(w),C=(-b-S)/(2*v),0<C&&C<1&&E.push(C));let P=E.length;for(;P--;)A=E[P];return E}(e[0],e[1],e[2],e[3],{addExtremes:t,addSemiExtremes:a}):function(e,t,a,{addExtremes:l=!0,addSemiExtremes:r=!1}={}){const n=e=>{const t=-Math.PI/4,a=Math.cos(t),l=Math.sin(t);return{x:e.x*a-e.y*l,y:e.x*l+e.y*a}};r&&(e=n(e),t=n(t),a=n(a));let s,i,o,u=Math.min(e.y,a.y),h=Math.min(e.x,a.x),p=Math.max(e.x,a.x),c=Math.max(e.y,a.y);if(t.y>=u&&t.y<=c&&t.x>=h&&t.x<=p)return[];let[y,f,x,g,d,m]=[e.x,e.y,t.x,t.y,a.x,a.y],v=[];for(let e=0;e<2;++e)s=0==e?y-2*x+d:f-2*g+m,i=0==e?-2*y+2*x:-2*f+2*g,Math.abs(s)>1e-12&&(o=-i/(2*s),o>0&&o<1&&v.push(o));return v}(e[0],e[1],e[2],{addExtremes:t,addSemiExtremes:a});return l}function re(e,t){const a=(e,t,a,l,r,n)=>{var s=Math.cos(n),i=Math.sin(n),o=l*Math.cos(e),u=r*Math.sin(e);return{x:t+s*o-i*u,y:a+i*o+s*u}};let l,r,n,s,i,o=J(e.x,e.y,t[0],t[1],t[2],t[3],t[4],t[5],t[6]),{rx:u,ry:h,cx:p,cy:c,endAngle:y,deltaAngle:f}=o,x=t[2],g={x:t[5],y:t[6]},d=[g],m=x*Math.PI/180,v=Math.tan(m);i=Math.atan2(-h*v,u);let b=i,M=i+Math.PI,A=Math.atan2(h,u*v),w=A+Math.PI,C=[e.x,g.x],k=[e.y,g.y],S=Math.min(...C),E=Math.max(...C),P=Math.min(...k),L=Math.max(...k),$=a(y-.001*f,p,c,u,h,m),D=a(y-.999*f,p,c,u,h,m);return($.x>E||D.x>E)&&(l=a(b,p,c,u,h,m),d.push(l)),($.x<S||D.x<S)&&(r=a(M,p,c,u,h,m),d.push(r)),($.y<P||D.y<P)&&(s=a(w,p,c,u,h,m),d.push(s)),($.y>L||D.y>L)&&(n=a(A,p,c,u,h,m),d.push(n)),d}function ne(e=[],t=[]){let a=e.length,l=4===a;t.length||(t=[0]);let r=t.length,n=[];for(let s=0;s<r;s++){let r=t[s],i=r?[]:e.slice(0);if(r)for(let t=0;t<a;t++){let a=e[t];i.push(K(a,0,0,r))}let o=l?se(...i):ie(...i);n.push(...o)}return n=[...new Set(n)].sort(),n}function se(e,t,a,l){if(!ae(e,[t,a,l]))return[];let r,n,s,i,o,u,h,p,[c,y,f,x,g,d,m,v]=[e.x,e.y,t.x,t.y,a.x,a.y,l.x,l.y],b=[],M=1e-8;for(let e=0;e<2;++e)if(0==e?(n=6*c-12*f+6*g,r=-3*c+9*f-9*g+3*m,s=3*f-3*c):(n=6*y-12*x+6*d,r=-3*y+9*x-9*d+3*v,s=3*x-3*y),Math.abs(r)<M){if(Math.abs(n)<M)continue;i=-s/n,i>0&&i<1&&b.push(i)}else h=n*n-4*s*r,h<0?Math.abs(h)<M&&(i=-n/(2*r),i>0&&i<1&&b.push(i)):(p=Math.sqrt(h),o=(-n+p)/(2*r),o>0&&o<1&&b.push(o),u=(-n-p)/(2*r),u>0&&u<1&&b.push(u));let A=b.length;for(;A--;)i=b[A];return[...new Set(b)].sort()}function ie(e,t,a){if(!ae(e,[t,a]))return[];let l,r,n,[s,i,o,u,h,p]=[e.x,e.y,t.x,t.y,a.x,a.y],c=[];for(let e=0;e<2;++e)l=0==e?s-2*o+h:i-2*u+p,r=0==e?-2*s+2*o:-2*i+2*u,Math.abs(l)>1e-12&&(n=-r/(2*l),n>0&&n<1&&c.push(n));return[...new Set(c)].sort()}function oe(e,t=.001){let a=Math.PI/2,l=a/2;return!(Math.abs(e/a-Math.round(e/a))<t)&&Math.abs(e/l-Math.round(e/l))<t}function ue(e,t,a=!1){let l=a?t[0]-e[0]:t.x-e.x,r=a?t[1]-e[1]:t.y-e.y;return O(l*l+r*r)}function he(e,t){let a=t.x-e.x,l=t.y-e.y;return a*a+l*l}function pe(e,t){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)}function ce(e,t){return.5*(Math.abs(t.x-e.x)+Math.abs(t.y-e.y))}function ye(e,t=48){if(!Array.isArray(e)||e.length<=t)return e;let a=e.length,l=a/t,r=[];for(let a=0;a<t;a++)r.push(e[Math.floor(a*l)]);let n=r.length;return r[n-1]!==e[a-1]&&(r[n-1]=e[a-1]),r}function fe(e,t){if(!e||!t)return{a:1,b:0,c:0,d:1,e:0,f:0};return e.getScreenCTM().inverse().multiply(t.getScreenCTM())}function xe(e){let t=[],a=[e[0]],l=e.length;for(let r=1;r<l;r++){let l=e[r];"M"!==l.type&&"m"!==l.type||(t.push(a),a=[]),a.push(l)}return a.length&&t.push(a),t}function ge(e,t){let a,l,r,n,s,i,o=[],u=[],h=e[0],p=e[1],c=e[e.length-2],y=e[e.length-1];return 4===e.length?(a=Y([h,p],t),l=Y([p,c],t),r=Y([c,y],t),n=Y([a,l],t),s=Y([l,r],t),i=Y([n,s],t),o.push({x:h.x,y:h.y},{x:a.x,y:a.y},{x:n.x,y:n.y},{x:i.x,y:i.y}),u.push({x:i.x,y:i.y},{x:s.x,y:s.y},{x:r.x,y:r.y},{x:y.x,y:y.y})):3===e.length?(l=Y([h,p],t),r=Y([p,y],t),i=Y([l,r],t),o.push({x:h.x,y:h.y},{x:l.x,y:l.y},{x:i.x,y:i.y}),u.push({x:i.x,y:i.y},{x:r.x,y:r.y},{x:y.x,y:y.y})):2===e.length&&(l=Y([h,y],t),o.push({x:h.x,y:h.y},{x:l.x,y:l.y}),u.push({x:l.x,y:l.y},{x:y.x,y:y.y})),[o,u]}function de(e,t,{tMin:a=0,tMax:l=1,addExtremes:r=!0,addSemiExtremes:n=!1}={}){let s=[],i=6===t.length?"C":"Q",o={x:t[0],y:t[1]},u="C"===i?{x:t[2],y:t[3]}:o,h={x:t[4],y:t[5]},p=0;let c="C"===i?[e,o,u,h]:[e,o,h],y=r?le(c,{addExtremes:r,addSemiExtremes:!1}):[],f=n?le(c,{addExtremes:r,addSemiExtremes:n}):[],x=Array.from(new Set([...y,...f])).sort();if(x=x.filter(e=>e>0&&e<1),x.length){let a=function(e,t,a,l=!0){let r=[];if(!a.length)return!1;let n,s,i,o=t.length,u={x:t[o-2],y:t[o-1]};2===t.length?i=[e,u]:4===t.length?(n={x:t[0],y:t[1]},i=[e,n,u]):6===t.length&&(n={x:t[0],y:t[1]},s={x:t[2],y:t[3]},i=[e,n,s,u]);if(a.length)if(1===a.length){let e=ge(i,a[0]),t=e[0],l=e[1];r.push(t,l)}else{let e=a[0],t=ge(i,e),l=t[0];r.push(l),i=t[1];for(let t=1;t<a.length;t++){e=a[t-1];let l=ge(i,(a[t]-e)/(1-e));r.push(l[0]),t===a.length-1&&r.push(l[l.length-1]),i=l[1]}}if(l){let e,t,a=[];return r.forEach(l=>{e={type:"",values:[]},l.shift(),t=l.map(e=>Object.values(e)).flat(),e.values=t,3===l.length?e.type="C":2===l.length?e.type="Q":1===l.length&&(e.type="L"),a.push(e)}),a}return r}(e,t,x);s.push(...a),p+=a.length}else s.push({type:i,values:t});return{pathData:s,count:p}}function me(e,{tMin:t=0,tMax:a=1,addExtremes:l=!0,addSemiExtremes:r=!1}={}){let n=[e[0]],s={x:e[0].values[0],y:e[0].values[1]},i={x:e[0].values[0],y:e[0].values[1]},o=e.length;for(let u=1;o&&u<o;u++){let o=e[u],{type:h,values:p}=o,c=p.slice(-2);if(c[0],c[1],"C"!==h&&"Q"!==h)n.push(o);else if((l||r)&&("C"===h||"Q"===h)){let e=de(s,p,{tMin:t,tMax:a,addExtremes:l,addSemiExtremes:r}).pathData;n.push(...e)}s={x:c[0],y:c[1]},"z"===h.toLowerCase()?s=i:"M"===h&&(i={x:c[0],y:c[1]})}return n}function ve(e){let t=e.startsWith("#")?"rgbHex":e.includes("(")?"fn":typeof e,a={},l=null,r={mode:null,values:[]};if("rgbHex"===t)a=function(e=""){e.startsWith("#")&&(e=e.substring(1));(3===e.length||4===e.length)&&(e=e.split("").map(e=>e+e).join(""));let t=0,a=0,l=0,r=0;if(e.length<6||e.length>8)return console.warn("Invalid hex format"),{r:t,g:a,b:l,a:r};let n=8===e.length,s=parseInt(e,16);return t=n?parseInt(e.substring(0,2),16):s>>16&255,a=n?parseInt(e.substring(2,4),16):s>>8&255,l=n?parseInt(e.substring(4,6),16):255&s,r=n?parseInt(e.substring(6,8),16):255,{r:t,g:a,b:l,a:r}}(e),l="rgba";else if("fn"===t){let t=e.split(/\(|\)/).filter(Boolean);if(t.length<2)return e;l=t[0];let r=t[1].split(/,| /).filter(Boolean).map(Number);l.split("").forEach((e,t)=>{let n=r[t];"rgba"===l&&"a"===e&&(n=Math.floor(255*n)),a[e]=n})}else if("string"===t)return r.mode="keyword",r.values=[e],r;return"rgba"!==l&&"rgb"!==l||(a.a=a.a?a.a:255),r.mode=l,r.values=Object.values(a),r}function be({r:e=0,g:t=0,b:a=0,a:l=255,values:r=[]}){const n=e=>{const t=Math.min(255,Math.max(0,Math.round(e))).toString(16);return 1===t.length?"0"+t:t};e||t||a||!r.length||([e,t,a,l=255]=r);let s=n(e),i=n(t),o=n(a),u=l<255?n(l):0,h=s[0]===s[1]&&i[0]===i[1]&&o[0]===o[1];return!u&&h?`#${s[0]}${i[0]}${o[0]}`:u&&h?`#${s[0]}${i[0]}${o[0]}${u[0]}`:u?`#${s}${i}${o}${u}`:`#${s}${i}${o}`}function Me(e){let t=[];for(let a=1,l=e.length;a<l;a++){let l=e[a],{type:r,values:n,p0:s=null,p:i=null,dimA:o=0}=l;n.length&&i&&s&&(o=o||pe(s,i),o&&t.push(o))}let a=t.sort(),l=Math.ceil(a.length/8);a=a.slice(0,l);let r=a.reduce((e,t)=>e+t,0)/l,n=r>112.5?0:Math.floor(75/r).toString().length;return Math.min(Math.max(0,n),8)}function Ae(e=0,t=3){if(!t)return Math.round(e);let a=10**t;return Math.round(e*a)/a}function we(e,t=10){let a=8;a=e>t?0:e>5?1:Math.ceil(t/e).toString().length;let l=10**a;return Math.round(e*l)/l}function Ce(e,t=-1){if(t<0)return e;let a=e.length,l=t;for(let t=0;t<a;t++){let a=e[t],{values:r}=a,n=r.length;if(n)for(let a=0;a<n;a++)e[t].values[a]=Ae(r[a],l)}return e}const ke=["polygon","polyline","line","rect","circle","ellipse"],Se=["x","cx","rx","dx","width","translateX"],Ee=["y","cy","ry","dy","height","translateY"],Pe=["scaleX","translateX","skewX"],Le=["scaleY","translateY","skewY"],$e=["fill","stroke","stop-color"],De=["path",...ke],Te=["text","textPath","tspan",...De],ze=["textPath","text","tspan"],Ie=["stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-linecap","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","stroke-opacity"],qe={atts:{id:"*",class:"*",viewBox:["symbol","svg"],preserveAspectRatio:["symbol","svg"],width:["svg","rect","use","image"],height:["svg","rect","use","image"],d:["path"],points:["polygon","polyline"],x:["image","rect","text","textPath","tspan","use","mask"],y:["image","rect","text","textPath","tspan","use","mask"],x1:["line","linearGradient"],x2:["line","linearGradient"],y1:["line","linearGradient"],y2:["line","linearGradient"],r:["circle","radialGradient"],rx:["rect","ellipse"],ry:["rect","ellipse"],cx:["circle","ellipse","radialGradient"],cy:["circle","ellipse","radialGradient"],refX:["symbol","markers"],refY:["symbol","markers"],transform:["svg","g","use",...De,...ze],"transform-origin":["svg","g","use",...De,...ze],fill:["svg","g","use",...De,...ze,"animate","animateMotion"],"fill-opacity":["svg","g","use",...De,...ze],"fill-rule":["svg","g","path","polygon","text","textPath"],opacity:["svg","g","use",...De,...ze],stroke:["svg","g","use",...De,...ze],"stroke-width":["svg","g","use",...De,...ze,"mask"],"stroke-opacity":["svg","g","use",...De,...ze,"mask"],"stroke-miterlimit":["svg","g","use",...De,...ze,"mask"],"stroke-linejoin":["svg","g","use",...De,...ze,"mask"],"stroke-linecap":["svg","g","use",...De,...ze,"mask"],"stroke-dashoffset":["svg","g","use",...De,...ze,"mask"],"stroke-dasharray":["svg","g","use",...De,...ze,"mask"],"clip-path":["svg","g","use",...De,...ze],"clip-rule":["path","polygon"],clipPathUnits:["clipPath"],mask:["svg","g","use",...De,...ze],maskContentUnits:["mask"],maskUnits:["mask"],"font-family":["svg","g",...ze],"font-size":["svg","g",...ze],"font-style":["svg","g",...ze],"font-weight":["svg","g",...ze],"font-stretch":["svg","g",...ze],"dominant-baseline":[...ze],lengthAdjust:[...ze],"text-anchor":["text"],textLength:["text","textPath","tspan"],dx:["text","tspan"],dy:["text","tspan"],method:["textPath"],spacing:["textPath"],startOffset:["textPath"],rotate:["text","tspan","animateMotion"],side:["textPath"],"white-space":["svg","g",...ze],color:["svg","g",...ze],playbackorder:["svg"],timelinebegin:["svg"],dur:["animate","animateTransform","animateMotion"],end:["animate","animateTransform","animateMotion"],from:["animate","animateTransform","animateMotion"],to:["animate","animateTransform","animateMotion"],type:["animateTransform"],values:["animate","animateTransform","animateMotion"],accumulate:["animate","animateTransform","animateMotion"],additive:["animate","animateTransform","animateMotion"],attributeName:["animate","animateTransform"],begin:["animate","animateTransform","animateMotion"],by:["animate","animateTransform","animateMotion"],calcMode:["animate","animateTransform","animateMotion"],keyPoints:["animateMotion"],keySplines:["animate","animateTransform","animateMotion"],keyTimes:["animate","animateTransform","animateMotion"],max:["animate","animateTransform","animateMotion"],min:["animate","animateTransform","animateMotion"],origin:["animateMotion"],repeatCount:["animate","animateTransform","animateMotion"],repeatDur:["animate","animateTransform","animateMotion"],restart:["animate","animateTransform","animateMotion"],gradientUnits:["linearGradient","radialGradient"],gradientTransform:["linearGradient","radialGradient"],fr:["radialGradient"],fx:["radialGradient"],fy:["radialGradient"],offset:["stop"],"stop-color":["stop"],"stop-opacity":["stop"],spreadMethod:["linearGradient","radialGradient"],href:["pattern","textPath","linearGradient","radialGradient","use","animate","animateTransform","animateMotion","image"],pathLength:[...De]},defaults:{transform:["none","matrix(1, 0, 0, 1, 0, 0)","matrix(1 0 0 1 0 0)"],"transform-origin":["0px, 0px","0 0"],rx:["0","0px"],ry:["0","0px"],x:["0","0px"],y:["0","0px"],fill:["black","rgb(0, 0, 0)","rgba(0, 0, 0, 0)","#000","#000000"],color:["black","rgb(0, 0, 0)","rgba(0, 0, 0, 0)","#000","#000000"],stroke:["none"],opacity:["1"],"fill-opacity":["1"],"stroke-width":["1","1px"],"stroke-opacity":["1"],"stroke-linecap":["butt"],"stroke-miterlimit":["4"],"stroke-linejoin":["miter"],"stroke-dasharray":["none"],"stroke-dashoffset":["0","0px","none"],pathLength:["none"],"font-family":["serif"],"font-weight":["normal","400"],"font-stretch":["normal"],"font-width":["normal"],"letter-spacing":["auto","normal","0"],lengthAdjust:["spacing"],"text-anchor":["start"],"dominant-baseline":["auto"],spacing:["auto"],"white-space":["normal"],"stop-opacity":["1"],gradientUnits:["objectBoundingBox"],patternUnits:["objectBoundingBox"],"clip-path":["none"],"clip-rule":["nonzero"],"fill-rule":["nonzero"],clipPathUnits:["userSpaceOnUse"],mask:["none"],maskUnits:["objectBoundingBox"]}};function je(e=null,{unit:t=null,width:a=0,height:l=0,decimals:r=-1,isHorizontal:n=!1,isVertical:s=!1,autoRoundValues:i=!1,dpi:o=96,fontSize:u=16,normalizedDiagonal:h=!1}={}){h=a!==l&&h;let p=typeof e;if(!e)return e;let c="number"===p||Fe(e),y="string"===p&&e.split(/,| /).length>1,f="string"===p&&e.includes("(");if(!c||y||f)return e;t=t||Ne(e);let x=parseFloat(e),g=1,d=Math.sqrt(a*a+l*l)/1.4142135623730951;if(!t)return x;switch(t){case"%":g=a&&n?a/100:l&&s?l/100:h?d/100:1;break;case"rad":g=A;break;case"turn":g=360;break;case"in":g=o;break;case"pt":g=.01388889*o;break;case"pc":g=.16666667*o;break;case"cm":g=k*o;break;case"mm":g=k*o*.1;break;case"Q":g=k*o*.025;break;case"em":case"rem":g=u;break;default:g=1}let m=x*g;return i?m=we(m):r>-1&&(m=+m.toFixed(r)),m}function Ne(e){if(!e||!isNaN(e))return"";return(e=e.replace(/\+|\-/g,"")).match(/[^\d|.]+/g)[0]}function Fe(e=""){return!isNaN(e)||!isNaN(parseFloat(e))}function Be(e,{x:t=0,y:a=0,width:l=0,height:r=0}={}){let n=[...e.attributes],s={};return n.forEach(e=>{let n=je(e.nodeValue,{x:t,y:a,width:l,height:r});s[e.name]=n}),s}function Qe(e,t=-1){let a=e.map(e=>e.x),l=e.map(e=>e.y),r=Math.min(...a),n=Math.max(...a),s=Math.min(...l),i=Math.max(...l),o={x:r,left:r,right:n,y:s,top:s,bottom:i,width:n-r,height:i-s};if(t>-1)for(let e in o)o[e]=+o[e].toFixed(t);return o}function Re(e){let t=[];return e.forEach(e=>{let a=function(e){let t=Ue(e),a=Qe(t);return a}(e);t.push(a)}),t}function Oe(e,t){let[a,l,r,n,s,i]=[e.x,e.y,e.width,e.height,e.x+e.width,e.y+e.height],[o,u,h,p,c,y]=[t.x,t.y,t.width,t.height,t.x+t.width,t.y+t.height],f=!1;return r*n!=h*p&&r*n>h*p&&a<o&&s>c&&l<u&&i>y&&(f=!0),f}function Ue(e){let t=[];for(let a=0;a<e.length;a++){let l=e[a],r=a>0?e[a-1]:e[a],{type:n,values:s}=l,i={x:r.values[r.values.length-2],y:r.values[r.values.length-1]},o=s.length?{x:s[s.length-2],y:s[s.length-1]}:"",u=s.length?{x:s[0],y:s[1]}:"";switch(n){case"A":if("function"!=typeof arcToBezier){let e=ue(i,o)/2,a=Z(i,o,.5),l=ee(a.x,a.y,e,e,0),r=ee(a.x,a.y,e,e,Math.PI);t.push(l,r,o);break}arcToBezier(i,s).forEach(e=>{let a=e.values,l={x:a[0],y:a[1]},r={x:a[2],y:a[3]},n={x:a[4],y:a[5]};t.push(l,r,n)});break;case"C":let e={x:s[2],y:s[3]};t.push(u,e);break;case"Q":t.push(u)}"z"!==n.toLowerCase()&&t.push(o)}return t}function Ve(e,t=9){let a=0,l=[],r=xe(e),n=r.length>1,s=[];if(n){let e=Re(r);e.forEach(function(t,a){for(let a=0;a<e.length;a++){let l=e[a];if(t!=l){Oe(t,l)&&s.push(a)}}})}return r.forEach((e,t)=>{l=[];let r=0,n=0,i=1,o=[];e.forEach(function(t,a){let[n,s]=[t.type,t.values],i=s.length;if(s.length){let u=(a>0?e[a-1]:e[0]).values,h=u.length,p={x:u[h-2],y:u[h-1]},c={x:s[i-2],y:s[i-1]};if("C"===n||"Q"===n){let e={x:s[0],y:s[1]};o="C"===n?[p,e,{x:s[2],y:s[3]},c]:[p,e,c];let t=Math.abs(function(e,t=!1){let a,[l,r,n,s]=[e[0],e[1],e[2],e[e.length-1]];if(e.length<3)return 0;3===e.length&&(r={x:1*e[0].x/3+2*e[1].x/3,y:1*e[0].y/3+2*e[1].y/3},n={x:1*e[2].x/3+2*e[1].x/3,y:1*e[2].y/3+2*e[1].y/3});return a=3*(l.x*(-2*r.y-n.y+3*s.y)+r.x*(2*l.y-n.y-s.y)+n.x*(l.y+r.y-2*s.y)+s.x*(-3*l.y+r.y+2*n.y))/20,t?Math.abs(a):a}(o));r+=t,l.push(p,c)}else if("A"===n){let e=J(p.x,p.y,t.values[0],t.values[1],t.values[2],t.values[3],t.values[4],c.x,c.y),{cx:a,cy:n,rx:s,ry:i,startAngle:o,endAngle:u,deltaAngle:h}=e,y=Math.abs(function(e,t,a,l){const r=Math.PI*e*t;let n=(l-a+2*Math.PI)%(2*Math.PI);if(e===t)return r*(n/(2*Math.PI));const s=a=>Math.atan2(e*Math.sin(a),t*Math.cos(a));return a=s(a),l=s(l),n=(l-a+2*Math.PI)%(2*Math.PI),r*(n/(2*Math.PI))}(s,i,o,u));y-=Math.abs(_e([p,{x:a,y:n},c])),l.push(p,c),r+=y}else l.push(p,c)}});let u=_e(l);-1!==s.indexOf(t)&&(i=-1),n=u<0&&r<0?(Math.abs(r)-Math.abs(u))*i:(Math.abs(r)+Math.abs(u))*i,a+=n}),a}function _e(e,t=!1){let a=0,l=e.length;for(let t=0;l&&t<l;t++){a+=e[t].x*e[t===e.length-1?0:t+1].y*.5-e[t===e.length-1?0:t+1].x*e[t].y*.5}return t&&(a=Math.abs(a)),a}function Ge(e,t=0){t=parseFloat(t);let a=e.length,l=t>1,r=!l&&!t,n="",s=e[0].values.join(" "),i=l?"\n":r?"":" ",o=r?"":" ";n=`${e[0].type}${o}${s}${i}`;for(let t=1;t<a;t++){let a=e[t-1],l=e[t],{type:u,values:h}=l;if(s="",!r||"A"!==u&&"a"!==u||(h=[h[0],h[1],h[2],`${h[3]}${h[4]}${h[5]}`,h[6]]),u=r&&a.type===l.type&&"m"!==l.type.toLowerCase()||r&&"M"===a.type&&"L"===l.type?" ":l.type,r){let e=!1;for(let t=0,a=h.length;t<a;t++){let a=h[t],l=a.toString(),r=l.includes(".")&&Math.abs(a)<1;r&&e&&(l=l.replace(/^0\./,".")),!(t>0)||e&&r||(s+=" "),s+=l,e=r}n+=`${u}${o}${s}${i}`}else n+=`${u}${o}${h.join(" ")}${i}`}return r&&(n=n.replace(/[A-Za-z]0(?=\.)/g,e=>e[0]).replace(/ 0\./g," .").replace(/ -/g,"-").replace(/-0\./g,"-.").replace(/Z/g,"z")),n}function He(e,t,a=0,l=1,r=!1){const n=(e,t,a,l,r)=>{let n=1-r;return{x:3*n*n*(t.x-e.x)+6*n*r*(a.x-t.x)+3*r*r*(l.x-a.x),y:3*n*n*(t.y-e.y)+6*n*r*(a.y-t.y)+3*r*r*(l.y-a.y)}};let s=[e,t],i=ce(e.p0,e.p)>ce(t.p0,t.p),o=JSON.parse(JSON.stringify(e)),u=JSON.parse(JSON.stringify(t)),h=H(o.p0,o.cp1,u.p,u.cp2,!1);if(!h)return s;if(i){let a={p0:{x:e.p.x,y:e.p.y},cp1:{x:e.cp2.x,y:e.cp2.y},cp2:{x:e.cp1.x,y:e.cp1.y},p:{x:e.p0.x,y:e.p0.y}};e={p0:{x:t.p.x,y:t.p.y},cp1:{x:t.cp2.x,y:t.cp2.y},cp2:{x:t.cp1.x,y:t.cp1.y},p:{x:t.p0.x,y:t.p0.y}},t=a}let p=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),c=(e,t)=>({x:e.x*t,y:e.y*t}),y=(e,t)=>e.x*t.x+e.y*t.y,f=t.p0,x=n(t.p0,t.cp1,t.cp2,t.p,0),g=y(p(e.p0,f),x)/y(x,x),d=Y([t.p0,t.cp1,t.cp2,t.p],g),m=n(t.p0,t.cp1,t.cp2,t.p,g);g-=y(p(d,e.p0),m)/y(m,m);let v=Y([t.p0,t.cp1,t.cp2,t.p],g),b=t.p,M=n(t.p0,t.cp1,t.cp2,t.p,g),A=n(t.p0,t.cp1,t.cp2,t.p,1),w=1-g,C=(k=v,S=c(M,w/3),{x:k.x+S.x,y:k.y+S.y});var k,S;let E=p(b,c(A,w/3)),P={p0:v,cp1:C,cp2:E,p:b,t0:g};i&&(P={p0:b,cp1:E,cp2:C,p:v,t0:g});let L=.5*(1-g),$=Y([P.p0,P.cp1,P.cp2,P.p],L,!1,!0),D=$.cpts[2],T=H($,D,P.p0,h,!1),z=H($,D,P.p,h,!1),I=Z(P.p0,T,1.333),q=Z(P.p,z,1.333);if(H(o.p0,I,u.p,q,!0))return s;P.cp1=I,P.cp2=q;let j=ce(o.p0,P.p0)+ce(u.p,P.p);if(P.p0=o.p0,P.p=u.p,P.extreme=u.extreme,P.corner=u.corner,P.dimA=u.dimA,P.directionChange=u.directionChange,P.type="C",P.values=[P.cp1.x,P.cp1.y,P.cp2.x,P.cp2.y,P.p.x,P.p.y],j<a){let t=i?1+g:Math.abs(g),n=1+Math.abs(g);if(t=i?1+g:Math.abs(g)/n,ce(Y([P.p0,P.cp1,P.cp2,P.p],t),e.p)>a*l)return s;let h=Ve([{type:"M",values:[o.p0.x,o.p0.y]},{type:"C",values:[o.cp1.x,o.cp1.y,o.cp2.x,o.cp2.y,o.p.x,o.p.y]},{type:"C",values:[u.cp1.x,u.cp1.y,u.cp2.x,u.cp2.y,u.p.x,u.p.y]}]),p=[{type:"M",values:[P.p0.x,P.p0.y]},{type:"C",values:[P.cp1.x,P.cp1.y,P.cp2.x,P.cp2.y,P.p.x,P.p.y]}],c=Ve(p),y=Math.abs(c/h-1);P.error=5*y*l,r&&Ge(p),y<.05*l&&(s=[P])}return s}function Xe(e,{keepExtremes:t=!0,keepInflections:a=!0,keepCorners:l=!0,extrapolateDominant:r=!0,tolerance:n=1}={}){let s=[e[0]],i=e.length;for(let r=2;i&&r<=i;r++){let o=e[r-1],u=r<i?e[r]:null,h=u?.type||null,{type:p,values:c,p0:y,p:f,cp1:x=null,cp2:g=null,extreme:d=!1,directionChange:m=!1,corner:v=!1,dimA:b=0}=o;if("C"===p&&"C"===h)if(l&&v||t&&d)s.push(o);else{let h=Ze(o,u,{tolerance:n}),p=0;if(1===h.length){o=h[0];let u=1;p+=o.error;for(let s=r+1;p<n&&s<i;s++){let r=e[s];if("C"!==r.type||a&&o.directionChange||l&&o.corner||t&&o.extreme)break;let i=Ze(o,r,{tolerance:n});if(i.length>1)break;p+=.5*i[0].error,u++,o=i[0]}s.push(o),r<i&&(r+=u)}else s.push(o)}else s.push(o)}return s}function Ze(e,t,{tolerance:a=1}={}){let l=[e,t],r=function(e,t){let a=pe(e.cp2,e.p);if(0===a)return 0;let l=pe(e.p,t.cp1);if(0===l)return 0;let r=pe(e.cp2,t.cp1);return a/r}(e,t);if(!r)return l;let n=pe(e.p0,e.p),s=pe(t.p0,t.p),i=.08*Math.max(0,Math.min(n,s))*a,o=function(e,t,a=0){let{p0:l,cp1:r}=e,{p:n,cp2:s}=t;return r={x:(r.x-(1-a)*l.x)/a,y:(r.y-(1-a)*l.y)/a},s={x:(s.x-a*n.x)/(1-a),y:(s.y-a*n.y)/(1-a)},{p0:l,cp1:r,cp2:s,p:n}}(e,t,r),u=Y([o.p0,o.cp1,o.cp2,o.p],r),h=pe(e.p,u),p=0,c=0,y=!1,f=h;if(h<i){let a=.5*(1+r);if(p=pe(Y([t.p0,t.cp1,t.cp2,t.p],.5),Y([o.p0,o.cp1,o.cp2,o.p],a)),f+=p,p<i){let t=.5*r;c=pe(Y([e.p0,e.cp1,e.cp2,e.p],.5),Y([o.p0,o.cp1,o.cp2,o.p],t)),f+=c,f<i&&(y=!0)}}return y&&(o.p0=e.p0,o.p=t.p,o.dimA=pe(o.p0,o.p),o.type="C",o.extreme=t.extreme,o.directionChange=t.directionChange,o.corner=t.corner,o.values=[o.cp1.x,o.cp1.y,o.cp2.x,o.cp2.y,o.p.x,o.p.y],o.error=f/i,l=[o]),l}function Ye(e,{tolerance:t=1,debug:a=!1}={}){let l=!1,r={flat:!0,steepness:0},n=e[0],s=e[e.length-1],i=new Set([...e.map(e=>+e.x.toFixed(8))]),o=new Set([...e.map(e=>+e.y.toFixed(8))]);if(1===i.size||1===o.size)return!a||r;let u=he(n,s),h=u/1e3*t,p=_e(e,!0);return p<h&&(l=!0),a&&(r.flat=l,r.steepness=p/u*10),a?r:l}function We(t=[],{detectExtremes:a=!0,detectCorners:l=!0,detectDirection:r=!0,detectSemiExtremes:n=!1,debug:s=!1,addSquareLength:i=!0,addArea:o=!0}={}){let u=[],h=Qe(W(t=Je(t,{addSquareLength:i,addArea:o}))),{left:p,right:c,top:y,bottom:f,width:x,height:g}=h;t[0].corner=!1,t[0].extreme=!1,t[0].semiExtreme=!1,t[0].directionChange=!1,t[0].closePath=!1;let d=[t[0]],m=t.length;for(let e=2;m&&e<=m;e++){let a=t[e-1],{type:l,values:r,p0:s,p:i,cp1:o=null,cp2:u=null,squareDist:h=0,cptArea:x=0,dimA:g=0}=a,m=t[e]||null;a.corner=!1,a.extreme=!1,a.semiExtreme=!1,a.directionChange=!1,a.closePath=!1;let v="C"===l||"Q"===l?"C"===l?[s,o,u,i]:[s,o,i]:[s,i],b=.1*g,M=.01*b,A="Q"===l||"C"===l,w=m&&("Q"===m.type||"C"===m.type),C=!1;
2
2
  //!isFlat &&
3
- if(C){let e="C"===r?Math.abs(l.cp2.x-l.p.x):Math.abs(l.cp1.x-l.p.x),t="C"===r?Math.abs(l.cp2.y-l.p.y):Math.abs(l.cp1.y-l.p.y);if(((0===t||t<w)&&e>0||(0===e||e<w)&&t>0)&&(S=!0),p.x!==u&&p.y!==y&&p.x!==c&&p.y!==x||(S=!0),!S){if(ee(null,M)){let e=le(M);e.length&&e[0]>.2&&(S=!0)}}}if(S&&(l.extreme=!0),C&&k){if(n&&!l.extreme){let e=Math.abs(p.x-f.x),t=Math.abs(p.y-f.y),a=!1;if(e&&t&&e>A||t>A){let e=_(f,p),t=_(p,b.cp1);a=se(Math.abs(e+t)/2)}a&&(l.semiExtreme=!0)}if((l.cptArea<0&&b.cptArea>0||l.cptArea>0&&b.cptArea<0)&&(l.directionChange=!0),!l.extreme){let e=f||h,t=b.cp1,a=Fe([e,p,t],!1),r=.01*oe(e,t),n=Math.abs(a)<r,s=a<0&&l.cptArea>0||a>0&&l.cptArea<0;!n&&s&&(l.corner=!0)}}s&&(l.directionChange&&e(markers,l.p,"orange","1.5%","0.5"),l.corner&&e(markers,l.p,"magenta","1.5%","0.5"),l.extreme&&e(markers,l.p,"cyan","1%","0.5")),d.push(l)}return p={pathData:d,bb:h,dimA:(f+g)/2},p}function Oe(e,{addSquareLength:t=!0,addArea:a=!1,addArcParams:l=!1,addAverageDim:r=!0}={}){let n=e[0],s={x:n.values[0],y:n.values[1]},i=s,o=s;n.p0=i,n.p=o,n.idx=0,n.dimA=0;let p=e.length,h=[n];for(let r=1;r<p;r++){let n,p,u=e[r],{type:c,values:y}=u,x=y.length;if(o=x?{x:y[x-2],y:y[x-1]}:s,u.p0=i,u.p=o,u.dimA=pe(i,o),"M"===c&&(s=o),"Q"===c||"C"===c)n={x:y[0],y:y[1]},p="C"===c?{x:y[2],y:y[3]}:null,u.cp1=n,p&&(u.cp2=p);else if("A"===c&&l){let{rx:e,ry:t,cx:a,cy:l,startAngle:r,endAngle:n,deltaAngle:s}=J(i.x,i.y,...y);u.cx=a,u.cy=l,u.rx=e,u.ry=t,u.xAxisRotation=y[2]/180*Math.PI,u.largeArc=y[3],u.sweep=y[4],u.startAngle=r,u.endAngle=n,u.deltaAngle=s}if("Z"===c&&s.x!==o.x&&s.y!==o.y&&(u.closePath=!0),t&&(u.squareDist=oe(i,o)),a){let e=0;"C"===c&&(e=Fe([i,n,p,o],!1)),"Q"===c&&(e=Fe([i,n,o],!1)),u.cptArea=e}u.idx=r,i=o,h.push(u)}return h}const Re=new Set([77,109,65,97,67,99,76,108,81,113,83,115,84,116,72,104,86,118,90,122]),_e=new Uint8Array(128);_e[77]=2,_e[109]=2,_e[65]=7,_e[97]=7,_e[67]=6,_e[99]=6,_e[76]=2,_e[108]=2,_e[81]=4,_e[113]=4,_e[83]=4,_e[115]=4,_e[84]=2,_e[116]=2,_e[72]=1,_e[104]=1,_e[86]=1,_e[118]=1,_e[90]=0,_e[122]=0;const Ge=new Set([5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279]),Ue=e=>32===e||44===e||10===e||13===e||8232===e||8233===e||9===e||11===e||12===e||160===e||e>=5760&&Ge.has(e);function Ve(e,t=!0,a=0){e=e.trim(),a&&console.log("!!!limit",a);let l={pathData:[],hasRelatives:!1,hasShorthands:!1,hasArcs:!1,hasQuadratics:!1,isPolygon:!1,log:[]};if(""===e)return l;let r,n=0,s=e.length,i="",o=-1,p="",h=!1,u=0,c=0,y=0,x=!1,f=new Set([]);const g=()=>{x&&("M"===i?i="L":"m"===i&&(i="l"),l.pathData.push({type:i,values:[]}),o++,c=0,x=!1)},d=(e=!1)=>{(e?u>0:""!==p)&&(t&&-1===o&&(r="Pathdata must start with M command",l.log.push(r),i="M",l.pathData.push({type:i,values:[]}),y=2,c=0,o++),"A"===i||"a"===i?(({val:p,valueIndex:c}=((e="",t=0)=>{let a=e.length;return 3===t&&2===a?(e=[+e[0],+e[1]],t++):4===t&&a>1?(e=[+e[0],+e.substring(1)],t++):3===t&&a>=3?(e=[+e[0],+e[1],+e.substring(2)],t+=2):e=[+e],{val:e,valueIndex:t}})(p,c)),l.pathData[o].values.push(...p)):(t&&p[1]&&"."!==p[1]&&"0"===p[0]&&(r=`${o}. command: Leading zeros not valid: ${p}`,l.log.push(r)),l.pathData[o].values.push(+p)),c++,p="",u=0,x=c>=y)},m=()=>{if(o>0){let e=l.pathData[o].values.length;if(e&&e<y||e&&e>y||("z"===i||"Z"===i)&&e>0){r=`${o}. command of type "${i}": ${y-e} values too few - ${y} expected`,l.log[l.log.length-1]!==r&&l.log.push(r)}}};let v=!1,b=!1,M=!1,A="";for(;n<s;){A=e.charCodeAt(n);let a=A>47&&A<58;if(a||(v=101===A||69===A,b=45===A||43===A,M=46===A),a||b||M||v){if(h||45!==A&&46!==A)g();else{let e=46===A;d(e),g(),e&&u++}p+=e[n],h=v,n++}else if((A<48||A>5759)&&Ue(A))d(),n++;else{if(A>64){if(!Re.has(A)){r=`${o}. command "${e[n]}" is not a valid type`,l.log.push(r),n++;continue}""!==p&&(l.pathData[o].values.push(+p),c++,p=""),t&&m(),i=e[n],y=_e[A];let a="M"===i||"m"===i,s=o>0&&("z"===l.pathData[o].type||"Z"===l.pathData[o].type);f.add(i),s&&!a&&(l.pathData.push({type:"m",values:[0,0]}),o++),l.pathData.push({type:i,values:[]}),o++,u=0,c=0,x=!1,n++;continue}a||(r=`${o}. ${e[n]} is not a valid separarator or token`,l.log.push(r),p=""),n++}}d(),t&&m(),t&&l.log.length&&(r="Invalid path data:\n"+l.log.join("\n"),"log"===t?console.log(r):console.warn(r)),l.pathData[0].type="M";let w=Array.from(f).join("");return l.hasRelatives=/[lcqamtsvh]/g.test(w),l.hasShorthands=/[vhst]/gi.test(w),l.hasArcs=/[a]/gi.test(w),l.hasQuadratics=/[qt]/gi.test(w),l.isPolygon=!/[cqats]/gi.test(w),l}function Ze(e,{toAbsolute:t=!0,toLonghands:a=!0,quadraticToCubic:l=!1,arcToCubic:r=!1,arcAccuracy:n=4}={}){let s=Array.isArray(e),i=s&&"object"==typeof e[0]&&"function"==typeof e[0].constructor,o=s?e:Ve(e),{hasRelatives:p=!0,hasShorthands:h=!0,hasQuadratics:u=!0,hasArcs:c=!0}=o,y=i?o:o.pathData;return y=function(e=[],{toAbsolute:t=!0,toLonghands:a=!0,quadraticToCubic:l=!1,arcToCubic:r=!1,arcAccuracy:n=2,hasRelatives:s=!0,hasShorthands:i=!0,hasQuadratics:o=!0,hasArcs:p=!0,testTypes:h=!1}={}){return He(e,{toAbsolute:t,toLonghands:a,quadraticToCubic:l,arcToCubic:r,arcAccuracy:n,hasRelatives:s,hasShorthands:i,hasQuadratics:o,hasArcs:p,testTypes:h,decimals:-1})}(y,{toAbsolute:t,toLonghands:a,quadraticToCubic:l,arcToCubic:r,arcAccuracy:n,hasRelatives:p,hasShorthands:h,hasQuadratics:u,hasArcs:c}),y}function He(e,{toShorthands:t=!0,toLonghands:a=!1,toRelative:l=!0,toAbsolute:r=!1,decimals:n=3,arcToCubic:s=!1,quadraticToCubic:i=!1,hasRelatives:o=!0,hasShorthands:p=!0,hasQuadratics:h=!0,hasArcs:u=!0,testTypes:c=!1}={}){if(c){let t=Array.from(new Set(e.map(e=>e.type))).join("");/[lcqamts]/gi.test(t),h=/[qt]/gi.test(t),u=/[a]/gi.test(t),p=/[vhst]/gi.test(t),isPoly=/[mlz]/gi.test(t)}return l=!r&&l,t=!a&&t,h&&i&&(e=function(e){let t=[e[0]];for(let a=1,l=e.length;a<l;a++){let l=e[a],r=e[a-1].values,n=r.length,s={x:r[n-2],y:r[n-1]};"Q"===l.type?t.push(Je(s,l.values)):t.push(l)}return t}(e)),t&&(e=function(e,t=-1,a=!1){let l;if(a){let t=e.map(e=>e.type).join("");l=/[astvqmhlc]/g.test(t)}e=a&&l?Xe(e):e;let r=e.length,n=new Array(r),s=e[0];n[0]=s;let i={x:e[0].values[0],y:e[0].values[1]},o=i;for(let t=1;t<r;t++){let a=e[t];s=a;let{type:l,values:r}=a,p=r.length,h=[r[p-2],r[p-1]],u=e[t-1];o={x:h[0],y:h[1]};let c=Math.abs(o.x-i.x),y=Math.abs(o.y-i.y),x=.01*pe(i,o),f=!1,g=!1,d=!1;if("C"===l&&"C"===u.type||"Q"===l&&"Q"===u.type){let e="C"===u.type?{x:u.values[2],y:u.values[3]}:{x:u.values[0],y:u.values[1]},t={x:r[0],y:r[1]},a=i.x-e.x,l=i.y-e.y;x=.025*pe(e,t),f=pe({x:e.x+2*a,y:e.y+2*l},t)<x}else"L"===l&&(g=0===y||y<x,d=0===c||c<x,f=d||g);switch(l){case"L":g&&(s={type:"H",values:[r[0]]}),d&&(s={type:"V",values:[r[1]]});break;case"Q":f&&(s={type:"T",values:[o.x,o.y]});break;case"C":f&&(s={type:"S",values:[r[2],r[3],o.x,o.y]});break;default:s={type:l,values:r}}i=o,n[t]=s}return n}(e)),p&&a&&(e=function(e,t=-1,a=!0){let l=!1;if(a){let t=e.map(e=>e.type).join(""),a=/[hstv]/gi.test(t);if(l=/[astvqmhlc]/g.test(t),!a)return e}e=a&&l?Ye(e,t):e;let r=[],n={type:"M",values:e[0].values};r.push(n);for(let a=1,l=e.length;a<l;a++){let l,s,i,o,p,h,u,c,y=e[a],{type:x,values:f}=y,g=f.length,d=n.values,m=d.length,[v,b]=[f[g-2],f[g-1]],[M,A]=[d[m-2],d[m-1]];switch(x){case"H":n={type:"L",values:[f[0],A]};break;case"V":n={type:"L",values:[M,f[0]]};break;case"T":[l,s]=[d[0],d[1]],[M,A]=[d[m-2],d[m-1]],i=M+(M-l),o=A+(A-s),n={type:"Q",values:[i,o,v,b]};break;case"S":[l,s]=[d[0],d[1]],[M,A]=[d[m-2],d[m-1]],[u,c]=m>2&&"A"!==n.type?[d[2],d[3]]:[M,A],i=2*M-u,o=2*A-c,p=f[0],h=f[1],n={type:"C",values:[i,o,p,h,v,b]};break;default:n={type:x,values:f}}t>-1&&(n.values=n.values.map(e=>+e.toFixed(t))),r.push(n)}return r}(e)),r&&(e=Ye(e)),u&&s&&(e=function(e,{arcAccuracy:t=1}={}){let a=[e[0]];for(let l=1,r=e.length;l<r;l++){let r=e[l],n=e[l-1].values,s=n.length,i={x:n[s-2],y:n[s-1]};if("A"===r.type){et(i,r.values,t).forEach(e=>{a.push(e)})}else a.push(r)}return a}(e)),n>-1&&l&&(e=be(e,n)),l&&(e=function(e,t=-1){return Xe(e,!0,t)}(e)),n>-1&&(e=be(e,n)),e}function We(e={},t={},a={},l={},r=1){let n=Z(e,t,1.5),s=Z(l,a,1.5),i=.01*pe(e,l)*r,o=pe(n,s),p=null,h={type:"C",values:[t.x,t.y,a.x,a.y,l.x,l.y]};return o<i&&(p=U(e,t,l,a,!1,!0),p&&(h.type="Q",h.values=[p.x,p.y,l.x,l.y],h.p0=e,h.cp1=p,h.cp2=null,h.p=l)),h}function Je(e,t){Array.isArray(e)&&(e={x:e[0],y:e[1]});let a={x:e.x+2/3*(t[0]-e.x),y:e.y+2/3*(t[1]-e.y)},l={x:t[2]+2/3*(t[0]-t[2]),y:t[3]+2/3*(t[1]-t[3])};return{type:"C",values:[a.x,a.y,l.x,l.y,t[2],t[3]]}}function Xe(e,t=!1,a=-1){a>=0&&(e[0].values=e[0].values.map(e=>+e.toFixed(a)));let l=e.length,r=e[0].values,n=r[0],s=r[1],i=n,o=s;for(let r=1;r<l;r++){let l=e[r],{type:p,values:h}=l,u=h.length,c=p.toLowerCase(),y=p.toUpperCase(),x=t?c:y;if(p!==x)switch(l.type=x,c){case"a":h[5]=t?h[5]-n:h[5]+n,h[6]=t?h[6]-s:h[6]+s;break;case"v":h[0]=t?h[0]-s:h[0]+s;break;case"h":h[0]=t?h[0]-n:h[0]+n;break;case"m":t?(h[0]-=n,h[1]-=s):(h[0]+=n,h[1]+=s),i=t?h[0]+n:h[0],o=t?h[1]+s:h[1];break;default:if(h.length)for(let e=0;e<h.length;e++)h[e]=t?h[e]-(e%2?s:n):h[e]+(e%2?s:n)}switch(c){case"z":n=i,s=o;break;case"h":n=t?n+h[0]:h[0];break;case"v":s=t?s+h[0]:h[0];break;case"m":i=h[u-2]+(t?n:0),o=h[u-1]+(t?s:0);default:n=h[u-2]+(t?n:0),s=h[u-1]+(t?s:0)}a>=0&&(l.values=l.values.map(e=>+e.toFixed(a)))}return e}function Ye(e,t=-1){return Xe(e,!1,t)}function Ke({p0:e={x:0,y:0},p:t={x:0,y:0},centroid:a={x:0,y:0},rx:l=0,ry:r=0,xAxisRotation:n=0,radToDegree:s=!1,startAngle:i=null,endAngle:o=null,deltaAngle:p=null}={}){if(!l||!r)return[];let h=[];const u=1.5707963267948966;let c=s?n:n*Math.PI/180,y=Math.cos(c),x=Math.sin(c);null!==i&&null!==o&&null!==p||({startAngle:i,endAngle:o,deltaAngle:p}=G(a,e,t));let f=l!==r?K(i,l,r):i,g=l!==r?K(p,l,r):p,d=Math.max(1,Math.ceil(Math.abs(g)/u)),m=g/d;for(let e=0;e<d;e++){const e=Math.abs(m)===u?.551785*Math.sign(m):4/3*Math.tan(m/4);let t=Math.cos(f),n=Math.sin(f),s=Math.cos(f+m),i=Math.sin(f+m),o=[];[{x:t-n*e,y:n+t*e},{x:s+i*e,y:i-s*e},{x:s,y:i}].forEach(e=>{let t=e.x*l,n=e.y*r;o.push(y*t-x*n+a.x,x*t+y*n+a.y)}),h.push({type:"C",values:o,cp1:{x:o[0],y:o[1]},cp2:{x:o[2],y:o[3]},p:{x:o[4],y:o[5]}}),f+=m}return h}function et(e,t,a=1){const l=2*Math.PI;let[r,n,s,i,o,p,h]=t;if(0===r||0===n)return[];let u=s?s*l/360:0,c=u?Math.sin(u):0,y=u?Math.cos(u):1,x=y*(e.x-p)/2+c*(e.y-h)/2,f=-c*(e.x-p)/2+y*(e.y-h)/2;if(0===x&&0===f)return[];r=Math.abs(r),n=Math.abs(n);let g=x*x/(r*r)+f*f/(n*n);if(g>1){let e=Math.sqrt(g);r*=e,n*=e}let d=r*r,m=r===n?d:n*n,v=x*x,b=f*f,M=d*m-d*b-m*v;M<=0?M=0:(M/=d*b+m*v,M=Math.sqrt(M)*(i===o?-1:1));let A=M?M*r/n*f:0,w=M?M*-n/r*x:0,C=y*A-c*w+(e.x+p)/2,k=c*A+y*w+(e.y+h)/2,S=(x-A)/r,E=(f-w)/n,P=(-x-A)/r,L=(-f-w)/n;const D=(e,t,a,l)=>{let r=+(e*a+t*l).toFixed(9);return 1===r||-1===r?1===r?0:Math.PI:(r=r>1?1:r<-1?-1:r,(e*l-t*a<0?-1:1)*Math.acos(r))};let T=D(1,0,S,E),I=D(S,E,P,L);0===o&&I>0?I-=2*Math.PI:1===o&&I<0&&(I+=2*Math.PI);let $=(+(Math.abs(I)/(l/4)).toFixed(0)||1)*a;I/=$;let F=[];const q=1.5707963267948966,N=.551785;let z=I===q?N:I===-q?-N:4/3*Math.tan(I/4),j=I?Math.cos(I):1,B=I?Math.sin(I):0;const Q=(e,t,a,l,r)=>{let n=e!=t?Math.cos(e):l,s=e!=t?Math.sin(e):r,i=Math.cos(e+t),o=Math.sin(e+t);return[{x:n-s*a,y:s+n*a},{x:i+o*a,y:o-i*a},{x:i,y:o}]};for(let e=0;e<$;e++){let e={type:"C",values:[]};Q(T,I,z,j,B).forEach(t=>{let a=t.x*r,l=t.y*n;e.values.push(y*a-c*l+C,c*a+y*l+k)}),F.push(e),T+=I}return F}function tt(e,{areaThreshold:t=2.5}={}){for(let a=0,l=e.length;a<l;a++){let l=e[a],r=e[a+1]||null,{type:n,values:s,p0:i,cp1:o=null,cp2:p=null,p:h=null}=l;if("C"===n&&r&&"C"===r.type){let l=at(i,o,p,h,t),n=at(r.p0,r.cp1,r.cp2,r.p,t);if(l.isArc&&n.isArc){let t=.01*pe(i,r.p),s=Math.abs(r.p.x-i.x),o=Math.abs(r.p.y-i.y),p=o<t&&s>t,u=s<t&&o>t,{rx:c,ry:y}=l,x=Fe([i,h,r.p])<0?0:1;if(u||p){c=Math.min(c,n.rx),y=Math.min(y,n.ry),e[a]=null,e[a+1].type="A",e[a+1].values=[c,y,0,0,x,r.p.x,r.p.y];continue}}}}return e=e.filter(Boolean)}function at(e,t,a,l,r=7.5){let n,s={type:"C",values:[t.x,t.y,a.x,a.y,l.x,l.y]},i=0,o=!1,p=_(e,t,!0),h=_(l,a,!0),u=180*Math.abs(p-h)/Math.PI,c=0,y=0;if(Math.abs(u%180-90)<3){n=U(e,X(t,e.x,e.y,-.5*Math.PI),l,X(a,l.x,l.y,.5*Math.PI),!1);let p=U(e,t,l,a,!1);if(p){let n=ie(e,p),h=ie(l,p),u=+Math.max(n,h).toFixed(8),x=+Math.min(n,h).toFixed(8);c=x,y=u;let f=Fe([e,t,a,l])<0?0:1,g=Math.abs(l.x-e.x)>Math.abs(l.y-e.y);100/c*Math.abs(c-y)<5&&(c=u,y=c),g&&(c=u,y=x);let d=$e([{type:"M",values:[e.x,e.y]},{type:"C",values:[t.x,t.y,a.x,a.y,l.x,l.y]}]),m={type:"A",values:[c,y,0,0,f,l.x,l.y]};i=Math.PI*(c*y)/4,i-=Math.abs(Fe([e,l,p])),function(e,t){let a=Math.abs(e-t);return Math.abs(100-100/e*(e+a))}(d,i)<r&&(o=!0,s=m)}}return{com:s,isArc:o,area:i,rx:c,ry:y,centroid:n}}function lt(e=null,{autoRoundValues:t=!0,decimals:a=-1}={}){if(!e)return!1;let l=e.hasAttribute("width"),r=e.hasAttribute("height"),n=e.hasAttribute("viewBox"),s=l?e.getAttribute("width"):0,i=r?e.getAttribute("height"):0,o=s?s.includes("%")?0:Ee(s,{isHorizontal:!0}):300,p=i?i.includes("%")?0:Ee(i,{isVertical:!0}):150,h=n?e.getAttribute("viewBox").split(/,| /).filter(Boolean).map(Number):[0,0,o,p];t?([o,p]=[o,p].map(e=>ve(e)),h=h.map(e=>ve(e))):!t&&a>-1&&([o,p]=[o,p].map(e=>+e.toFixed(a)),h=h.map(e=>+e.toFixed(a)));let[u=0,c=0,y=0,x=0]=h;return n&&(o=y,p=x),{x:u,y:c,width:y,height:x,w:o,h:p,hasViewBox:n,hasWidth:l,hasHeight:r,widthUnit:"",heightUnit:""}}function rt(e,{width:t=0,height:a=0,convert_rects:l=!1,convert_ellipses:r=!1,convert_poly:n=!1,convert_lines:s=!1}={}){let i=e.nodeName.toLowerCase();if("path"===i||"rect"===i&&!l||("circle"===i||"ellipse"===i)&&!r||("polygon"===i||"polyline"===i)&&!n||"line"===i&&!s)return e;let o=function(e,{stringify:t=!1,width:a=0,height:l=0}={}){let r,n,s,i,o,p,h,u,c,y,x,f,g=[],d=e.nodeName.toLowerCase();if(!a||!l){let t=function(e){let t=e.parentNode.closest("svg");for(;t&&t.parentNode&&t.parentNode.closest;){let e=t.parentNode.closest("svg");if(!e)break;t=e}return t}(e),r=lt(t);a=r.width,l=r.height}let m=function(e,{width:t=0,height:a=0,fontSize:l=16,dpi:r=96,autoRoundValues:n=!1,decimals:s=-1}={}){let i=[...e.attributes],o=i.map(e=>e.name),p=i.map(e=>e.nodeValue),h=t===a,u={};return o.forEach((l,r)=>{let s=Me.includes(l),i=Ae.includes(l),o=!h&&"r"===l,c=Ee(p[r],{isHorizontal:s,isVertical:i,width:t,height:a,normalizedDiagonal:o,autoRoundValues:n});u[l]=c,e.setAttribute(l,c)}),u}(e,{width:a,height:l});switch(d){case"path":r=e.getAttribute("d"),g=Ze(r);break;case"rect":({x:n=0,y:s=0,width:a=0,height:l=0,rx:o=0,ry:p=0}=m),o||p?(o=o||p,p=p||o,o>a/2&&(o=a/2),p>l/2&&(p=l/2),g=[{type:"M",values:[n+o,s]},{type:"L",values:[n+a-o,s]},{type:"A",values:[o,p,0,0,1,n+a,s+p]},{type:"L",values:[n+a,s+l-p]},{type:"A",values:[o,p,0,0,1,n+a-o,s+l]},{type:"L",values:[n+o,s+l]},{type:"A",values:[o,p,0,0,1,n,s+l-p]},{type:"L",values:[n,s+p]},{type:"A",values:[o,p,0,0,1,n+o,s]},{type:"Z",values:[]}]):g=[{type:"M",values:[n,s]},{type:"L",values:[n+a,s]},{type:"L",values:[n+a,s+l]},{type:"L",values:[n,s+l]},{type:"Z",values:[]}];break;case"circle":case"ellipse":({cx:h=0,cy:u=0,r:i,rx:o,ry:p}=m);let t="circle"===d;t?(o=i,p=i):(o=o||i,p=p||i);let v=t&&i>=1?1:o,b=t&&i>=1?1:p;g=[{type:"M",values:[h+o,u]},{type:"A",values:[v,b,0,1,1,h-o,u]},{type:"A",values:[v,b,0,1,1,h+o,u]}];break;case"line":({x1:c,y1:x,x2:y,y2:f}=m),g=[{type:"M",values:[c,x]},{type:"L",values:[y,f]}];break;case"polygon":case"polyline":let M=e.getAttribute("points").split(/,| /).filter(Boolean).map(Number);for(let e=0;e<M.length;e+=2)g.push({type:0===e?"M":"L",values:[M[e],M[e+1]]});"polygon"===d&&g.push({type:"Z",values:[]})}return t?function(e){return e.map(e=>`${e.type} ${e.values.join(" ")}`).join(" ")}(g):g}(e,{width:t,height:a}),p=o.map(e=>`${e.type} ${e.values} `).join(" "),h=[...e.attributes].map(e=>e.name),u=document.createElementNS(w,"path");u.setAttribute("d",p);let c=["x","y","x1","y1","x2","y2","cx","cy","dx","dy","r","rx","ry","width","height","points"];return h.forEach(t=>{if(!c.includes(t)){let a=e.getAttribute(t);u.setAttribute(t,a)}}),u}function nt(e,{tolerance:t=1,flatBezierToLinetos:a=!0}={}){let l=[e[0]],r={x:e[0].values[0],y:e[0].values[1]},n=r,s=r;e[e.length-1].type.toLowerCase();for(let i=1,o=e.length;i<o;i++){let p=e[i],h=e[i+1]||e[o-1],u="z"===h.type.toLowerCase()?r:{x:h.values[h.values.length-2],y:h.values[h.values.length-1]},{type:c,values:y}=p,x=y.slice(-2);s="Z"!==c?{x:x[0],y:x[1]}:r;let f=u?Fe([n,s,u],!0):1/0,g=oe(n,u),d=f<(g?g/333*t:0),m=!1;if(a||"C"!==c||(d=!1),a&&("C"===c||"Q"===c)){m=Be([n,..."C"===c?[{x:y[0],y:y[1]},{x:y[2],y:y[3]}]:"Q"===c?[{x:y[0],y:y[1]}]:[],s],{tolerance:t}),m&&i<o-1&&(c="L",p.type="L",p.values=x)}d&&i<o-1&&"A"!==h.type&&("L"===c||a&&m)||(n=s,"M"===c&&(r=s),l.push(p))}return l}function st(e){let t=[];for(let a=0,l=e.length;a<l;a++){let l=e[a];if(!l)continue;let{type:r=null,values:n=[]}=l,s=e[a+1]?e[a+1]:null;"M"!==r&&"m"!==r||s&&(!s||"Z"!==s.type&&"z"!==s.type)?t.push(l):s&&a++}return t}function it(e){let t={x:e[0].values[0],y:e[0].values[1]},a=t,l=[e[0]];for(let r=1,n=e.length;r<n;r++){let n=e[r],s=e[r-1],i=e[r+1]||null,{type:o,values:p}=n,h="m"===s.type.toLowerCase()&&!i,u=p.length;if(a={x:p[u-2],y:p[u-1]},h||"L"!==o||a.x!==t.x||a.y!==t.y){if(!h&&("l"===o||"v"===o||"h"===o)){if("l"===o?"00"===p.join(""):0===p[0])continue}l.push(n),t=a}}return l}function ot(e){let t=e.length;if(!("z"===e[t-1].type.toLowerCase()))return e;let a=0,l=[];for(let a=0;a<t;a++){let t=e[a],{type:r,values:n}=t,s=n.length;if(s){let e={type:r,x:n[s-2],y:n[s-1],index:0};e.index=a,l.push(e)}}return l=l.sort((e,t)=>+e.y.toFixed(8)-+t.y.toFixed(8)||e.x-t.x),a=l[0].index,a?ht(e,a):e}function pt(e,{removeFinalLineto:t=!0,autoClose:a=!0}={}){let l=[],r=e.length,n={x:+e[0].values[0].toFixed(8),y:+e[0].values[1].toFixed(8)},s="z"===e[r-1].type.toLowerCase(),i=e.filter(e=>"L"===e.type),o=e[s?r-2:r-1],p=o.type,h=o.values.slice(-2).map(e=>+e.toFixed(8)),u=h[0]===n.x&&h[1]===n.y;!s&&a&&u&&(e.push({type:"Z",values:[]}),s=!0,r++);let c="L"!==e[1].type&&(!u||"L"===o.type);if(c=!1,!s)return e;let y=0;{let t=[];for(let a=0;a<r;a++){let l=e[a],{type:r,values:n}=l;if(n.length){let l=n.slice(-2),s=e[a-1]&&"L"===e[a-1].type,i=e[a+1]&&"L"===e[a+1].type,o=e[a-1]?e[a-1].type.toUpperCase():null,p=e[a+1]?e[a+1].type.toUpperCase():null,h={type:r,x:l[0],y:l[1],dist:0,index:0,prevL:s,nextL:i,prevCom:o,nextCom:p};h.index=a,t.push(h)}}if(i.length){let e=t.filter(e=>"L"!==e.type&&"M"!==e.type&&e.prevCom&&"L"===e.prevCom||"M"===e.prevCom&&"L"===p).sort((e,t)=>e.y-t.y||e.x-t.x)[0];y=e?e.index-1:0}else t=t.sort((e,t)=>+e.y.toFixed(8)-+t.y.toFixed(8)||e.x-t.x),y=t[0].index;e=y?ht(e,y):e}return n={x:+e[0].values[0].toFixed(8),y:+e[0].values[1].toFixed(8)},r=e.length,o=e[r-2],p=o.type,h=o.values.slice(-2).map(e=>+e.toFixed(8)),u="L"===p&&h[0]===n.x&&h[1]===n.y,t&&u&&e.splice(r-2,1),l.push(...e),l}function ht(e,t){let a=0,l="z"===e[e.length-1].type.toLowerCase();if(!l||t<1||e.length<3)return e;let r=l?1:0;!function(e){let t=e.length,a="z"===e[t-1].type.toLowerCase(),l=e[0],[r,n]=[l.values[0],l.values[1]].map(e=>+e.toFixed(8)),s=a?e[t-2]:e[t-1],i=s.values.length,[o,p]=[s.values[i-2],s.values[i-1]].map(e=>+e.toFixed(8));!a||r==o&&n==p||(e.pop(),e.push({type:"L",values:[r,n]},{type:"Z",values:[]}))}(e),a=t+1<e.length-1?t+1:e.length-1-r;let n,s,i=e.slice(a),o=e.slice(0,a);return o.shift(),n=o[o.length-1].values||[],s=[n[n.length-2],n[n.length-1]],r&&(i.pop(),o.push({type:"Z",values:[]})),e=[{type:"M",values:s},...i,...o]}function ut(e,{arcToCubic:t=!1,quadraticToCubic:a=!1,toClockwise:l=!1,returnD:r=!1}={}){const n=(e,t)=>{let a=[],l=[];if("A"!==e){for(let e=0;e<t.length;e+=2)a.push([t[e],t[e+1]]);l=a.pop(),a.reverse()}else{let e=0==t[4]?1:0;a=[t[0],t[1],t[2],t[3],e],l=[t[5],t[6]]}return{controlPoints:a,endPoints:l}};let s=[],i="z"===e[e.length-1].type.toLowerCase();i&&(e=(e=>{let t="z"===e[e.length-1].type.toLowerCase(),a=e[0],[l,r]=[a.values[0],a.values[1]],n=t?e[e.length-2]:e[e.length-1],[s,i]=[n.values[n.values.length-2],n.values[n.values.length-1]];return!t||l==s&&r==i||(e.pop(),e.push({type:"L",values:[l,r]},{type:"Z",values:[]})),e})(e),e.pop());let o=e[e.length-1].values,p=o.length,h=i?e[0]:{type:"M",values:[o[p-2],o[p-1]]};s.push(h),e.reverse();for(let t=1;t<e.length;t++){let a=e[t],l=a.type,r=a.values,i=e[t-1],o=i.type,p=[];p=[n(o,i.values).controlPoints,n(l,r).endPoints].flat(),s.push({type:o,values:p.flat()})}return i&&s.push({type:"z",values:[]}),s}function ct(e,{threshold:t=null,tolerance:a=1}={}){if(!t){let a=function(e){let t=1/0,a=-1/0,l=1/0,r=-1/0;const n=e=>{e.x<t&&(t=e.x),e.x>a&&(a=e.x),e.y<l&&(l=e.y),e.y>r&&(r=e.y)};for(let t=0;t<e.length;t++){let a=e[t],{type:l,values:r}=a,s=r.length,i=(e[t-1]?e[t-1]:e[t]).values,o=i.length;if(s){let e={x:i[o-2],y:i[o-1]},t={x:r[s-2],y:r[s-1]};if(n(t),"C"===l||"Q"===l){let a={x:r[0],y:r[1]},s="C"===l?{x:r[2],y:r[3]}:a,i="C"===l?[e,a,s,t]:[e,a,t];te(i).forEach(e=>{let t=H(i,e);n(t)})}else"A"===l&&ae(e,r).forEach(e=>{n(e)})}}return{x:t,y:l,width:a-t,height:r-l}}(e);t=.05*(a.width+a.height)}let l=e.length;for(let r=0;r<l;r++){let l=e[r],{type:n,values:s,extreme:i,corner:o=!1,dimA:p,p0:h,p:u}=l,c=e[r+1]?e[r+1]:null,y=e[r+2]?e[r+2]:null,x=(c?pe(u,c.p):1/0)<t,f=(y?pe(y.p,c.p):1/0)<1*t;if(c&&y&&"C"===n&&"C"===c.type&&i&&y.extreme&&(f||x)){let l=Ne(c,y,t,a,!1);if(1===l.length){l=l[0],e[r+1]=null,e[r+2].values=[l.cp1.x,l.cp1.y,l.cp2.x,l.cp2.y,l.p.x,l.p.y],e[r+2].cp1=l.cp1,e[r+2].cp2=l.cp2,e[r+2].p0=l.p0,e[r+2].p=l.p,e[r+2].extreme=l.extreme,r++;continue}}if(c&&"C"===n&&"C"===c.type&&i&&x){let e=Fe([l.p0,l.p,c.p]),t=Fe([l.p0,l.cp1,l.cp2,l.p]);if(e<0&&t>0||e>0&&t<0)continue}}l=(e=e.filter(Boolean)).length;let r="z"===e[l-1].type.toLowerCase()?l-2:l-1,n=e[r],s=e[r-1]||null,i={x:e[0].values[0],y:e[0].values[1]},o=n.values.slice(-2),p=+o[0].toFixed(8)===+i.x.toFixed(8)&&+o[1].toFixed(8)===+i.y.toFixed(8),h="C"===e[1].type&&e[1].extreme?e[1]:null,u=pe(n.p0,n.p)<t;if(s&&"C"===s.type&&u&&p&&h){let l=Ne(s,n,t,a,!1);1===l.length&&(e[r-1]=l[0],e[r]=null,e=e.filter(Boolean))}return e}function yt({transforms:e=[],transformOrigin:t={x:0,y:0}}={}){let a=function(e=[],t={x:0,y:0}){const a=(e,t)=>({a:e.a*t.a+e.c*t.b,b:e.b*t.a+e.d*t.b,c:e.a*t.c+e.c*t.d,d:e.b*t.c+e.d*t.d,e:e.a*t.e+e.c*t.f+e.e,f:e.b*t.e+e.d*t.f+e.f}),l=(e,t)=>({a:1,b:0,c:0,d:1,e:e,f:t}),r=(e,t)=>({a:e,b:0,c:0,d:t,e:0,f:0}),n=(e,t)=>{const a=e=>e*Math.PI/180;let[l,r]=e.map(e=>a(e)),n={};if("rot"===t){let e=Math.cos(l),t=Math.sin(l);n={a:e,b:t,c:-t,d:e,e:0,f:0}}else if("skew"===t){let e=Math.tan(l);n={a:1,b:Math.tan(r),c:e,d:1,e:0,f:0}}return n};let s={a:1,b:0,c:0,d:1,e:0,f:0};0===t.x&&0===t.y||(s=a(s,l(t.x,t.y)));const i={translate:[0,0],scale:[1,1],skew:[0,0],rotate:[0],matrix:[1,0,0,1,0,0]};for(let t of e){let e=Object.keys(t)[0],o=t[e]||i[e],[p,h=i[e][1]]=o;switch("rotate"===e&&3===o.length&&(p=o[2]),e){case"matrix":let t=["a","b","c","d","e","f"];s=a(s,Object.fromEntries(t.map((e,t)=>[e,o[t]])));break;case"translate":(p||h)&&(s=a(s,l(p,h)));break;case"skew":(p||h)&&(s=a(s,n([p,h],"skew")));break;case"rotate":p&&(s=a(s,n([p],"rot")));break;case"scale":1===p&&1===h||(s=a(s,r(p,h)));break;default:throw new Error(`Unknown transformation type: ${e}`)}}0===t.x&&0===t.y||(s=a(s,l(-t.x,-t.y)));return s}(e,t);return a}function xt(e,{removeNameSpaced:t=!0,decimals:a=-1}={}){let l=e.nodeName.toLowerCase(),r=function(e){let t={},a=[...e.attributes].map(e=>e.name),l=a.length;if(!l)return t;for(let r=0;r<l;r++){let l=a[r],n=e.getAttribute(l);t[l]=n}return t}(e),n=function(e){let t=e.getAttribute("style"),a=t?function(e=""){let t={};if(!e)return t;let a=e.split(";").filter(Boolean).map(e=>e.trim()),l=a.length;if(!l)return t;for(let e=0;l&&e<l;e++){let l=a[e],[r,n]=l.split(":").filter(Boolean);t[r]=n}return t}(t):{};return a}(e),s={...r,...n},i={},o=n.transform;if(o){let e=yt(function(e,t={x:0,y:0}){if(!e)return!1;let a,l={transforms:[],transformOrigin:t},r=/(\w+)\(([^)]+)\)/g;function n(e){if("string"==typeof e){if(e.includes("rad"))return parseFloat(e)*(180/Math.PI);if(e.includes("turn"))return 360*parseFloat(e)}return parseFloat(e)}for(;null!==(a=r.exec(e));){let e=a[1],t=a[2].split(/,\s*/).map(e=>n(e));switch(e){case"translate":l.transforms.push({translate:[t[0]||0,t[1]||0]});break;case"translateX":l.transforms.push({translate:[t[0]||0,0,0]});break;case"translateY":l.transforms.push({translate:[0,t[0]||0,0]});break;case"scale":l.transforms.push({scale:[t[0]||0,t[1]||0]});break;case"skew":l.transforms.push({skew:[t[0]||0,t[1]||0]});break;case"skewX":l.transforms.push({skew:[t[0]||0,0]});break;case"skewY":l.transforms.push({skew:[0,t[0]||0]});break;case"rotate":console.log("rotate",t),l.transforms.push({rotate:[0,0,t[0]||0]});break;case"matrix":l.transforms.push({matrix:t})}}return e.split(/;\s*/).forEach(e=>{let[t,a]=e.split(":").map(e=>e.trim());if("transform-origin"===t||"perspective-origin"===t){let[e,r]=a.split(/\s+/).map(parseFloat);"transform-origin"===t&&(l.transformOrigin={x:e||0,y:r||0})}}),l}(`${o}`));s.transform=`matrix(${Object.values(e).join(",")})`}let p=["inline-size"],h=[];for(let a in s){let r=s[a];r&&a.startsWith("--")||p.includes(a)||!t&&a.startsWith("-")?h.push(`${a}:${r}`):(r&&Se.atts[a]&&("*"===Se.atts[a]||Se.atts[a].includes(l)||!t&&a.includes(":"))&&(i[a]=r),e.removeAttribute(a))}for(let t in i){let a=i[t];e.setAttribute(t,a)}return h.length&&e.setAttribute("style",h.join(";")),i}function ft(e,{toObject:t=!0,toArray:a=!1,flatten:l=!1}={}){if("string"==typeof e&&!isNaN(e[0]))return e=gt(e.split(/,| /).filter(Boolean).map(Number));l&&(e=e.flat(2));let r=a?function(e){if(!Array.isArray(e[0][0])&&2===e[0].length)return e;let t=[];if(Array.isArray(e[0][0])&&2===e[0][0].length)return e.forEach(e=>{t.push(e.map(e=>[e.x,e.y]))}),t;return t=Array.from(e).map(e=>[e.x,e.y]),t}(e):function(e){if(void 0!==e[0].x&&void 0!==e[0].y)return e;let t=[];if(Array.isArray(e[0])&&void 0!==e[0][0].x&&void 0!==e[0][0].y)return e;if(Array.isArray(e[0][0])&&2===e[0][0].length)return e.forEach(e=>{t.push(e.map(e=>({x:e[0],y:e[1]})))}),t;if(e.length>3)return e=gt(e);return e.map(e=>({x:e[0],y:e[1]}))}(e);return r}function gt(e){let t=[];for(let a=1,l=e.length;a<l;a+=2)t.push({x:e[a-1],y:e[a]});return t}function dt(e,{removeHidden:t=!0,stylesToAttributes:a=!0,removePrologue:l=!0,removeIds:r=!1,removeClassNames:n=!1,removeDimensions:s=!1,fixHref:i=!1,legacyHref:o=!1,cleanupDefs:p=!0,cleanupClip:h=!0,addViewBox:u=!1,addDimensions:c=!1,mergePaths:y=!1,removeOffCanvas:x=!0,cleanupSVGAtts:f=!0,removeNameSpaced:g=!0,attributesToGroup:d=!0,shapeConvert:m=!1,convert_rects:v=!1,convert_ellipses:b=!1,convert_poly:M=!1,convert_lines:A=!1,convertTransforms:C=!1,cleanUpStrokes:k=!0,decimals:S=-1,excludedEls:E=[]}={}){d=!!f,i&&(e=e.replaceAll("xlink:href=","href="));let P=(new DOMParser).parseFromString(e,"text/html").querySelector("svg"),L=lt(P),{x:D,y:T,width:I,height:$}=L;if(f){!function(e,t=["viewBox","xmlns","width","height","id","class"]){[...e.attributes].map(e=>e.name).forEach(a=>{t.includes(a)||e.removeAttribute(a)})}(P,["viewBox","xmlns","width","height","id","class","fill","stroke","stroke-width","stroke-linecap","stroke-linejoin"])}u&&function(e,{x:t=0,y:a=0,width:l=0,height:r=0}={}){if(e.hasAttribute("viewBox"))return;l&&r||({x:t,y:a,width:l,height:r}=lt(e));e.setAttribute("viewBox",[t,a,l,r].join(" "))}(P,{x:D,y:T,width:I,height:$}),c&&(P.setAttribute("width",I),P.setAttribute("height",$)),p&&function(e,{x:t=0,y:a=0,width:l=0,height:r=0,cleanupClip:n=!0}={}){let s=e.querySelectorAll("defs"),i=e.querySelectorAll("symbol, pattern, linearGradient, radialGradient, clipPath, mask, marker, filter");if(!s.length&&!i.length)return;s.forEach(t=>{[...t.children].length?e.insertBefore(t,e.children[0]):t.remove()});let o=new Set([]);i.forEach(e=>{o.add(e.id)}),Array.from(o).forEach(t=>{e.querySelectorAll(`[href="#${t}"], [xlink\\:href="#${t}"], [clip-path="url(#${t})"], [mask="url(#${t})"], [fill="url(#${t})"], [stroke="url(#${t})"]`).length||e.getElementById(t).remove()})}(P,{x:D,y:T,width:I,height:$,cleanupClip:h}),x&&function(e,{x:t=0,y:a=0,width:l=0,height:r=0}={}){let n=[...e.querySelectorAll("path, polygon, polyline, line, rect, circle, ellipse, text")];n=n.filter(e=>!(e.parentNode.closest("defs")||e.parentNode.closest("symbol")||e.parentNode.closest("clipPath")||e.parentNode.closest("mask")||e.parentNode.closest("pattern")));let s={x:t,y:a,width:l,height:r};s.right=t+l,s.bottom=a+r,n.forEach(e=>{let t=function(e){let t=e.nodeName.toLowerCase(),a=Pe(e),l={x:0,y:0,width:0,height:0},r=[];switch(t){case"path":l=Le(Ie(Ze(a.d)));break;case"rect":l={x:a.x||0,y:a.y||0,width:a.width,height:a.height};break;case"circle":let e=2*a.r;l={x:a.cx-a.r,y:a.cy-a.r,width:e,height:e};break;case"ellipse":l={x:a.cx-a.rx,y:a.cy-a.ry,width:2*a.rx,height:2*a.ry};break;case"line":r=[{x:a.x1,y:a.y1},{x:a.x2,y:a.y2}],l=Le(r);break;case"polyline":case"polygon":r=ft(a.points),l=Le(r)}return l}(e);(t.right<s.x||t.bottom<s.y||t.x>s.right||t.y>t.bottom)&&e.remove()})}(P,{x:D,y:T,width:I,height:$});let F=["metadata","script",...E],q=P.querySelectorAll("*"),N=[],z=["polygon","polyline","line","rect","circle","ellipse"];if("toShapes"===m){P.querySelectorAll("path").forEach(e=>{let t=function(e,{convert_rects:t=!1,convert_ellipses:a=!1,convert_poly:l=!1,convert_lines:r=!1}={}){let n=Ze(e.getAttribute("d")),s=Array.from(new Set(n.map(e=>e.type))).join(""),i=/[a]/gi.test(s),o=/[csqt]/gi.test(s),p=/[l]/gi.test(s),h=!/[acqts]/gi.test(s),u=/[z]/gi.test(s),c=null,y=null,x=Pe(e),f={};if(h)if(2===n.length&&r){y="line",c=document.createElementNS(w,y);let[e,t,a,l]=[...n[0].values,...n[1].values].map(e=>me(e,7));f={x1:e,y1:t,x2:a,y2:l}}else{let e=W(n),a=Le(e),r=Fe(e,!0),s=a.width*a.height,i=Math.abs(1-s/r);if(t&&i<.01){y="rect",c=document.createElementNS(w,y);let{x:e,y:t,width:l,height:r}=a;f={x:e,y:t,width:l,height:r}}else l&&(y=u?"polygon":"polyline",c=document.createElementNS(w,y),f={points:e.map(e=>[e.x,e.y]).flat().map(e=>me(e,7)).join(" ")})}else if(!p&&a&&(!i&&o&&(n=tt(n,{areaThreshold:2.5}),i=n.filter(e=>"A"===e.type).length),i)){let e=Oe(n,{addArcParams:!0}),t=e.filter(e=>"A"===e.type),a=new Set,l=new Set,r=new Set,s=new Set;if(t.length>1&&e.forEach(e=>{"A"===e.type&&(a.add(me(e.cx,7)),l.add(me(e.cy,7)),r.add(me(e.rx,7)),s.add(me(e.ry,7)))}),a=Array.from(a),l=Array.from(l),r=Array.from(r),s=Array.from(s),1===a.length&&1===l.length&&1===r.length&&1===s.length){let[e,t,n,i]=[r[0],s[0],a[0],l[0]];y=e===t?"circle":"ellipse",c=document.createElementNS(w,y),f="circle"===y?{r:e,cx:n,cy:i}:{rx:e,ry:t,cx:n,cy:i}}}if(c){let t=["id","class"];for(let e in f)c.setAttribute(e,f[e]);for(let e in x)(Se.atts[e].includes(y)||t.includes(e)||e.startsWith("data-"))&&c.setAttribute(e,x[e]);e=c}return e}(e,{convert_rects:v,convert_ellipses:b,convert_poly:M,convert_lines:A});e.replaceWith(t),e=t})}for(let e=0;e<q.length;e++){let l=q[e],r=l.nodeName.toLowerCase();if("toPaths"===m&&"path"!==r&&z.includes(r)){let e=rt(l,{width:I,height:$,convert_rects:v,convert_ellipses:b,convert_poly:M,convert_lines:A});l.replaceWith(e),r="path",l=e}let n=l.getAttribute("style")||"",s=!!n&&n.trim().includes("display:none"),i=l.getAttribute("display")&&"none"===l.getAttribute("display")||s;if(r.includes(":")||F.includes(r)||t&&i)l.remove();else if(a||d||y||k){let t=xt(l,{removeNameSpaced:g,decimals:S});N.push({el:l,name:r,idx:e,propsFiltered:t})}}if(k)for(let e of N){let{el:t,propsFiltered:a}=e;Object.keys(a).includes("stroke")||ke.forEach(a=>{t.removeAttribute(a),void 0!==e.propsFiltered[a]&&delete e.propsFiltered[a]})}if((d||y)&&function(e=[],t=!0){let a,l=[[e[0]]],r=0,n="",s=e.length,i=e.filter(e=>e.propstr),o="";if(!i.length&&t){let t=null;for(let a=0;a<s;a++){let l=e[a];if("path"!==l.name)continue;let r=!0,n=l.el;t||(t=n,r=!1);let s=l.propsFiltered.d;o+=s.startsWith("M")?s:Ve(s).pathData.map(e=>`${e.type} ${e.values.join(" ")}`).join(" "),r&&n.remove()}return void(t&&t.setAttribute("d",o))}for(let t=0;t<s;t++){let a=e[t],i=a.propsFiltered,o=[];for(let e in i)"d"!==e&&"id"!==e&&o.push(`${e}:${i[e]}`);o=o.join("_"),a.propstr=o,s>1&&o===n?l[r].push(a):s>1&&l[r].length&&(l.push([]),r++),n=o}for(let e=0;e<l.length;e++){let r=l[e];if(r.length>1){let e=r[0].el,l=r[0].propsFiltered,n=e.parentNode.closest("g")?e.parentNode.closest("g"):null;n||(n=document.createElementNS("http://www.w3.org/2000/svg","g"),e.parentNode.insertBefore(n,e),r.forEach(e=>{n.append(e.el)}));let s=[...n.children];for(let e in l){if("d"!==e&&"id"!==e){let t=l[e];n.setAttribute(e,t),s.forEach(a=>{a.getAttribute(e)===t&&a.removeAttribute(e)})}if(t){r=r.filter(Boolean);let e=r.length;if(1===e)return r[0].el;a=r[0].el;let t=r[0].propsFiltered.d;for(let a=1;a<e;a++){let e=r[a],l=e.el,n=e.propsFiltered.d,s=n.startsWith("M")?n:Ve(n).pathData.map(e=>`${e.type} ${e.values.join(" ")}`).join(" ");console.log("dAbs",s),t+=s,l.remove()}a.setAttribute("d",t)}}}}}(N,y),s&&(P.removeAttribute("width"),P.removeAttribute("height")),n||r){let e=n?"class":"id",t=`[${e}]`,a=P.querySelectorAll(t);P.removeAttribute(e),a.forEach(t=>{t.removeAttribute(e)})}if(h&&function(e,{x:t=0,y:a=0,width:l=0,height:r=0}={}){let n=e.querySelectorAll("clipPath");if(!n.length)return;l&&r||({x:t,y:a,width:l,height:r}=lt(e));n.forEach(n=>{let s=[...n.children];if(s.length>1)return;let i=s[0],o=i.nodeName.toLowerCase();if("path"===o||"rect"===o){let s={x:0,y:0,width:0,height:0};if("path"===o){let e=Ze(i.getAttribute("d")),t=Array.from(new Set(e.map(e=>e.type.toLowerCase()))).join("");if(!!/[acqts]/gi.test(t)||e.length>5)return;s=Le(W(e))}else"rect"===o&&(s={x:+i.getAttribute("x"),y:+i.getAttribute("y"),width:+i.getAttribute("width"),height:+i.getAttribute("height")});if(s.x===t&&s.y===a&&s.width===l&&s.height===r){n.remove(),e.querySelectorAll(`[clip-path="url(#${n.id})"]`).forEach(e=>{e.removeAttribute("clip-path")})}}})}(P,{x:D,y:T,width:I,height:$}),o){P.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),P.querySelectorAll("[href]").forEach(e=>{let t=e.getAttribute("href");e.setAttribute("xlink:href",t),e.removeAttribute("href")})}return{svg:P,svgElProps:N}}function mt(e,{threshold:t=0,tolerance:a=1}={}){let l=e.length,r=[e[0]],n="z"===e[l-1].type.toLowerCase(),s=!!n&&(e[l-1].p.x===e[0].p0.x&&e[l-1].p.y===e[0].p0.y),i=n?2:1,o=e[l-i],p="L"===o.type,h="C"===o.type,u="L"===e[1].type,c="C"===e[1].type,y=n&&c&&(p||s);y&&(e[l-1].values=e[0].values,e[l-1].type="L",p=!0);for(let t=1;t<l;t++){let s=e[t],{type:o}=s,x=e[t+1]?e[t+1]:null;if("L"===o&&x&&"C"===x.type||"C"===o&&x&&"L"===x.type){let y="L"===o?s:null,f=null,g=[],d=0;if(1===t&&c&&p&&(g=[e[1]],y=e[l-1],f=x),!y){r.push(s);continue}n&&h&&u&&t===l-i-1&&(f=e[1],g=[e[l-i]]);for(let a=t+1;a<l;a++){let t=e[a]?e[a]:null,l=e[a-1];if("C"===l.type&&g.push(l),"L"===t.type&&"C"===l.type){f=t;break}d++}if(f){let e=pe(y.p0,y.p),l=pe(f.p0,f.p),n=pe(y.p,f.p0),i=Fe([y.p0,y.p,f.p0,f.p],!1),o=Fe([g[0].p0,g[0].cp1,g[0].cp2,g[0].p],!1),p=i<0&&o>0||i>0&&o<0,h=.5*n*a,u=h<e&&h<l;if(g.length&&!p&&u){let e=Math.abs(o)<.005*oe(g[0].p0,g[0].p)?null:U(y.p0,y.p,f.p,f.p0,!1,!0);if(!e){r.push(s);continue}if(e){let t=Fe([y.p0,y.p,f.p0,f.p],!1),a=Math.abs(t),l=Fe([y.p0,y.p,e,f.p0,f.p],!1),n=Math.abs(l),i=Math.abs(a-n)/a;if(!e||(t<0&&l>0||t>0&&l<0)||i>.5){r.push(s);continue}}let a=.75*pe(H([y.p,e,f.p0],.5),1===g.length?H([g[0].p0,g[0].cp1,g[0].cp2,g[0].p],.5):g[0].p);if(h&&a>h&&a>.3*n){r.push(s);continue}{let a={type:"Q",values:[e.x,e.y,f.p0.x,f.p0.y]};a.p0=y.p,a.cp1=e,a.p=f.p0,r.push(y,a),t+=d;continue}}}}y&&t===l-1&&"L"===o||r.push(s)}return(y||n&&"Z"!==r[r.length-1].type)&&r.push({type:"Z",values:[]}),r}function vt(e){if(e.length<3)return!1;let t=e[0],a=e[Math.floor(e.length/2)],l=e[e.length-1],r=t.x,n=t.y,s=a.x,i=a.y,o=l.x,p=l.y,h=r-s,u=n-i,c=r-o,y=n-p,x=(r*r-s*s+(n*n-i*i))/2,f=(r*r-o*o+(n*n-p*p))/2,g=h*y-u*c;if(Math.abs(g)<1e-10)return console.warn("Points are collinear or numerically unstable"),!1;let d={x:(y*x-u*f)/g,y:(-c*x+h*f)/g},m=ie(d,t),v=G(d,t,l),{deltaAngle:b,startAngle:M,endAngle:A}=v;return{centroid:d,r:m,startAngle:M,endAngle:A,deltaAngle:b}}function bt(e,{threshold:a=0,tolerance:l=1,toCubic:r=!1,debug:n=!1}={}){let s=e.length,i=[e[0]],o=[];for(let a=1;a<s;a++){let l=e[a],{type:s}=l,p=e[a-1],h=e[a+1]?e[a+1]:null,u=e[a+2]?e[a+2]:null,c=e[a+3]?e[a+3]:null,y=null;"C"===l.type||"Q"===l.type?y=l:!h||"C"!==h.type&&"Q"!==h.type||(y=h);let x,f,g,d,m,v=y?"C"===y.type?[y.p0,y.cp1,y.cp2,y.p]:[y.p0,y.cp1,y.p]:[],b=0,M=0,A=!1,w=!1,C=[];if("L"===p.type&&"L"===s&&y&&"L"===u.type&&c&&("L"===c.type||"Z"===c.type)?(x=[l.p0,l.p],f=[u.p0,u.p],g=l.p0,d=u.p,b=Fe(v,!1),M=Fe([...x,...f],!1),A=b<0&&M>0||b>0&&M<0,A||(m=H(v,.5),C=[g,m,d],w=!0)):"C"!==s&&"Q"!==s||"L"!==p.type||"C"!==h.type&&"Q"!==h.type||"L"!==u.type||(w=!0,x=[p.p0,p.p],f=[u.p0,u.p],g=p.p,d=u.p0,m=y.p,C=[g,y.p,d]),w){let e=vt(C);if(e){let s,{centroid:p,r:h,deltaAngle:u,startAngle:c,endAngle:y}=e,x=0,f=u>0?1:0,v=Math.abs(u)>Math.PI?1:0;if(he(X(g,p.x,p.y,.5*u),m)<.05*he(g,d)){if(s=Ke({p0:g,p:d,centroid:p,rx:h,ry:h,xAxisRotation:x,sweep:f,largeArc:v,deltaAngle:u,startAngle:c,endAngle:y}),1===s.length){let e=We(g,s[0].cp1,s[0].cp2,d);"Q"===e.type&&(r=!0),l=e}if(s.length>1&&(r=!1),r||(l.type="A",l.values=[h,h,x,v,f,d.x,d.y]),l.p0=g,l.p=d,l.extreme=!1,l.corner=!1,n){o=r?[{type:"M",values:[g.x,g.y]},...s]:[{type:"M",values:[g.x,g.y]},{type:"A",values:[h,h,x,v,f,d.x,d.y]}];let e=qe(o);t(markers,e,"orange","0.5%","0.5")}i.push(l),a++;continue}}}i.push(l)}return i}function Mt(e=[],{threshold:t=0}={}){let a=e.length,l="z"===e[a-1].type.toLowerCase(),r=l?a-2:a-1,n=e[r],s=n.values.slice(-2),i={x:e[0].values[0],y:e[0].values[1]},o=he(i,{x:s[0],y:s[1]});if(o&&o<t){let a=e[r].values.length;e[r].values[a-2]=i.x,e[r].values[a-1]=i.y;let l=e[1];if("C"===l.type&&"C"===n.type){let a=Math.abs(l.values[0]-n.values[2]),s=Math.abs(l.values[1]-n.values[3]),o=Math.abs(e[1].values[0]-l.values[0]),p=Math.abs(e[1].values[1]-l.values[1]),h=Math.abs(e[1].values[0]-n.values[2]),u=Math.abs(e[1].values[1]-n.values[3]),c=p<t&&u<t&&a;a&&a<t&&(o<t&&h<t&&s)&&(e[1].values[0]=i.x,e[r].values[2]=i.x),s&&s<t&&c&&(e[1].values[1]=i.y,e[r].values[3]=i.y)}}return e}function At(e,t=1){let a=[];for(let l=0,r=e.length;l<r;l++){let r=e[l],{type:n,values:s}=r,i={type:n,values:[]};switch(n.toLowerCase()){case"h":case"v":i.values=[s[0]*t];break;case"a":i.values=[s[0]*t,s[1]*t,s[2],s[3],s[4],s[5]*t,s[6]*t];break;default:s.length&&(i.values=s.map((e,a)=>e*t))}a.push(i)}return a}function wt(e,t=1){for(let a=1,l=e.length;a<l;a++){let l=e[a],{type:r,values:n,p0:s,cp1:i=null,cp2:o=null,p:p=null}=l;if("C"===r){let r=We(s,i,o,p,t);"Q"===r.type&&(r.extreme=l.extreme,r.corner=l.corner,r.dimA=l.dimA,r.squareDist=l.squareDist,e[a]=r)}}return e}function Ct(e,{quality:t=.9,width:a=0,height:l=0}={}){let r=!1;if("string"==typeof t&&(r=!0,t=parseFloat(t)),e.length<4||(!r&&t)>=1)return e;let n=t;if(!r){if(n=1-t,t>.5&&(n/=2),!a&&!l){let t=ue(e,12);({width:a,height:l}=Le(t))}n=(n*((a+l)/2/100))**2}const s=(e,t,a)=>{let l=t.x,r=t.y,n=a.x-l,s=a.y-r;if(0!==n||0!==s){let t=((e.x-l)*n+(e.y-r)*s)/(n*n+s*s);t>1?(l=a.x,r=a.y):t>0&&(l+=n*t,r+=s*t)}return(e.x-l)**2+(e.y-r)**2};let i=[e[0]],o=[];for(o.push([0,e.length-1]);o.length>0;){let[t,a]=o.pop(),l=n,r=-1;for(let n=t+1;n<a;n++){let i=s(e[n],e[t],e[a]);i>l&&(r=n,l=i)}l>n?(o.push([r,a]),o.push([t,r])):i.push(e[a])}return i}function kt(e,{quality:t=.9,width:a=0,height:l=0}={}){let r=!1;if("string"==typeof t){r=!0,t=parseFloat(t)}if(e.length<4||(!r&&t)>=1)return e;let n,s=e[0],i=[s],o=t;if(!r){if(o=1-t,!a&&!l){let t=ue(e,12);({width:a,height:l}=Le(t))}o=(o*((a+l)/2/25))**2,t>.5&&(o/=10)}for(let t=1,a=e.length;t<a;t++){n=e[t],oe(s,n)>o&&(i.push(n),s=n)}return s.x!==n.x&&s.y!==n.y&&i.push(n),i}function St(e,t=!0){let a=[],l=[];return Array.isArray(e[0])?e.forEach(e=>{l=[{type:"M",values:[e[0].x,e[0].y]},...e.slice(1).map(e=>({type:"L",values:[e.x,e.y]}))],a.push(...l)}):a=[{type:"M",values:[e[0].x,e[0].y]},...e.slice(1).map(e=>({type:"L",values:[e.x,e.y]}))],t&&a.push({type:"Z",values:[]}),a}function Et(e,{maxError:t=0,adjustCpts:a=!0,harmonize:l=!0,keepCorners:r=!0}={}){if(1===e.length)return[];if(2===e.length)return[{type:"L",values:[e[0].x,e[0].y]},{type:"L",values:[e[1].x,e[1].y]}];let n=e.length,s=function(e=[]){let t=[];return e.forEach(e=>{let a=4===e.length?"C":3===e.length?"Q":"L",l="C"===a||"Q"===a?e[1]:null,r="C"===a?e[2]:null,n=e[e.length-1],s={type:a,values:"C"===a?[l.x,l.y,r.x,r.y,n.x,n.y]:"Q"===a?[l.x,l.y,n.x,n.y]:[n.x,n.y]};t.push(s)}),t}(Pt(e,It(e[1],e[0]),It(e[n-2],e[n-1]),t,r));return s}function Pt(e,t,a,l,r=!1){let n,s=function(e){let t=[],a=e.length,l=e[0],r=e[1],n=0,s=0;for(let i=0;i<a;i++)r=e[i],n=s+ie(r,l,!1),t.push(n),s=n,l=r;return t=t.map(function(e){return e/s}),t}(e),i=Lt(e,s,s,t,a);n=i[0];let o=i[1],p=i[2];if(r){let t=function(e,t){let a,l=4,r=1/l,n=e.length,s=[t[0]];for(let e=1;e<l;e++){a=H(t,r*e),s.push(a)}s.push(t[t.length-1]);let i=Fe(e,!1);i||2!==e.length||(i=.01*oe(e[0],e[1]));let o=Fe(s,!1)/i>1.1,p=t;if(o){let a=e[Math.floor(.5*n)],l=e[n-1];p=t=[e[0],a,a,l]}return{isBulged:o,bezierNew:p}}(e,n),{isBulged:a,bezierNew:l}=t;a&&(n=l)}if(0===o||o<l)return[n];if(o<l*l){let r=s,i=o,h=p;for(let u=0;u<20;u++){r=Dt(n,e,r);let u=Lt(e,s,r,t,a);if(n=u[0],o=u[1],p=u[2],o<l)return[n];if(p===h){let e=o/i;if(e>.9999&&e<1.0001)break}i=o,h=p}}let h=[],u=$t(e[p-1],e[p+1]);if(0===u.x&&0===u.y){u=$t(e[p-1],e[p]);let t={x:-u.y,y:u.x};u.x=t.x,u.y=t.y}let c=function(e){let t=Math.sqrt(e.x*e.x+e.y*e.y);return 0===t?{x:0,y:0}:{x:e.x/t,y:e.y/t}}(u),y=qt(c,-1);return e.length,h.push(...Pt(e.slice(0,p+1),t,c,l,r),...Pt(e.slice(p),y,a,l,r)),h}function Lt(e,t,a,l,r){let n,s,i;n=function(e,t,a,l){let r,n,s,i,o=e[0],p=e[e.length-1],h=[o,null,null,p],u=function(e){let t=[];for(;e--;)t.push([0,0]);return t}(t.length),c=t.length;for(let e=0;e<c;e++)s=t[e],i=1-s,r=u[e],r[0]=qt(a,3*s*(i*i)),r[1]=qt(l,3*i*(s*s));let y=[[0,0],[0,0]],x=[0,0],f=e.length;for(let a=0;a<f;a++)s=t[a],r=u[a],y[0][0]+=Nt(r[0],r[0]),y[0][1]+=Nt(r[0],r[1]),y[1][0]+=Nt(r[0],r[1]),y[1][1]+=Nt(r[1],r[1]),n=$t(e[a],H([o,o,p,p],s)),x[0]+=Nt(r[0],n),x[1]+=Nt(r[1],n);let g=y[0][0]*y[1][1]-y[1][0]*y[0][1],d=y[0][0]*x[1]-y[1][0]*x[0],m=x[0]*y[1][1]-x[1]*y[0][1],v=0===g?0:m/g,b=0===g?0:d/g,M=ie(o,p,!1),A=1e-6*M;return v<A||b<A?(h[1]=Ft(o,qt(a,.333*M)),h[2]=Ft(p,qt(l,.333*M))):(h[1]=Ft(o,qt(a,v)),h[2]=Ft(p,qt(l,b))),h}(e,a,l,r);let o=function(e,t,a){let l,r,n,s,i,o;r=0,n=Math.floor(.5*e.length);let p=function(e,t){let a,l=[0],r=e[0],n=0;for(let s=1;s<=t;s++)a=H(e,s/t),n+=ie(a,r),l.push(n),r=a;return l=l.map(e=>e/n),l}(t,10),h=e.length,u=null;for(s=0;s<h;s++)i=e[s],o=Tt(a[s],p,10),u=H(t,o),l=oe(u,i),l>r&&(r=l,n=s);return[r,n]}(e,n,t);return s=o[0],i=o[1],[n,s,i]}function Dt(e,t,a){return a.map((a,l)=>function(e,t,a){let l=H(e,a),r=l.x-t.x,n=l.y-t.y,s=zt(e,a),i=r*s[0]+n*s[1],o=s[0]*s[0]+s[1]*s[1],p=zt(e,a,!0),h=2*(r*p[0]+n*p[1]),u=o+h;if(Math.abs(u)<1e-10)return a;return a-i/u}(e,t[l],a))}function Tt(e,t,a){if(e<0)return 0;if(e>1)return 1;let l,r,n,s,i;for(let o=1;o<=a;o++)if(e<=t[o]){s=(o-1)/a,n=o/a,r=t[o-1],l=t[o],i=(e-r)/(l-r)*(n-s)+s;break}return i}function It(e,t){let a=e.x-t.x,l=e.y-t.y,r=Math.sqrt(a*a+l*l);return 0===r?{x:0,y:0}:{x:a/r,y:l/r}}function $t(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ft(e,t){return{x:e.x+t.x,y:e.y+t.y}}function qt(e,t){return{x:e.x*t,y:e.y*t}}function Nt(e,t){return e.x*t.x+e.y*t.y}function zt(e,t,a=!1){let l,r,n=e[0],s=e[1],i=e[2],o=e[3],p=t,h=1-p,u=h*h,c=p*p;return a?(l=6*h*(i.x-2*s.x+n.x)+6*p*(o.x-2*i.x+s.x),r=6*h*(i.y-2*s.y+n.y)+6*p*(o.y-2*i.y+s.y)):(l=3*u*(s.x-n.x)+6*h*p*(i.x-s.x)+3*c*(o.x-i.x),r=3*u*(s.y-n.y)+6*h*p*(i.y-s.y)+3*c*(o.y-i.y)),[l,r]}function jt(e,{debug:t=!1,width:a=0,height:l=0,denoise:r=.9,keepCorners:n=!0,keepExtremes:s=!0,keepInflections:i=!1,manhattan:o=!1,absolute:p=!1,closed:h=!0,tolerance:u=1,simplifyRD:c=1,simplifyRDP:y=1}={}){let x=s||n?function(e,{x:t=0,y:a=0,width:l=0,height:r=0,debug:n=!1}={}){let s=e.length,i=Le(e);l&&r||({x:t,y:a,width:l,height:r}=i);let o=.01*(l+r);for(let t=0;t<s;t++){let a=t>0?e[t-1]:e[s-1],l=e[t],r=Fe([a,l,t<s-1?e[t+1]:e[s-1]],!1);l.area=r,l.dist=pe(a,l),l.idx=t}for(let t=0;t<s;t++){t>1?e[t-2]:e[s-1];let a=t>0?e[t-1]:e[s-1],l=e[t],r=t<s-1?e[t+1]:e[s-1];oe(a,r),Math.abs(a.area);let n=Math.abs(l.area);Math.abs(r.area);let p=!1,h=!l.area||n<o;pe(l,a);let u=!1;l.x!==i.left&&l.x!==i.right&&l.y!==i.top&&l.y!==i.bottom||(u=!0);let c=l.y===a.y&&l.x!==a.x,y=l.x===a.x&&l.y!==a.y;(c||y)&&(a.isExtreme=!0,u=!0);let x=Le([a,r]),{left:f,right:g,top:d,bottom:m}=x,v=l.x<f||l.x>g||l.y<d||l.y>m;!u&&v&&(u=!0);let b=(a.area<0&&l.area>0||a.area>0&&l.area<0)&&!h&&!a.isDirChange;if(u){let e=G(l,r,a),{deltaAngleDeg:t}=e;t=Math.abs(t),t>10&&t<160&&(p=!0)}l.isCorner=p,l.isExtreme=u,l.isHorizontal=c,l.isVertical=y,l.isDirChange=b}let p=[],h=[];for(let t=0;t<e.length;t++){let a=e[t],l=e[t+1]||null,r=e[t+2]||null,n=[];if(l&&l.isExtreme&&a.isExtreme&&!a.isCorner){let e=l.dist<2*o&&!l.isCorner,s=r&&r.isExtreme&&r.dist<2*o&&!r.isCorner;if(e&&!s?n.push(a,l):s&&n.push(a,l,r),n.length){let e=n.reduce((e,t)=>e+t.x,0)/n.length,l=n.reduce((e,t)=>e+t.y,0)/n.length;a.x=e,a.y=l,t+=n.length-1}}(a.isExtreme||a.isCorner||a.isDirChange)&&h.push(p.length),p.push(a);let s=p.length,i=p[0],u=p[s-1],c=pe(i,u)<2*o;i.isExtreme&&u.isExtreme&&c&&(u.x=i.x,u.y=i.y)}return p}(e,{debug:!1}):e,f=s||n?function(e,{closed:t=!0,keepCorners:a=!0,keepExtremes:l=!0,keepInflections:r=!1}={}){let n=[[e[0]]],s=0,i=n[s],o=e.length;for(let t=1;t<o;t++){t>0?e[t]:e[o-1];let r=e[t];t<o-1?e[t+1]:e[o-1],(l&&r.isExtreme||a&&r.isCorner)&&(s++,n.push([])),i=n[s],i.push(r)}return n}(x,{keepCorners:n,keepExtremes:s,keepInflections:i}):[x],g=function(e=[],{closed:t=!0,keepCorners:a=!0,tolerance:l=1}={}){let r=e.length,n=[{type:"M",values:[e[0][0].x,e[0][0].y]}];for(let t=0;t<r;t++){let r=e[t],s=e[t+1]?e[t+1]:null,i=[],o=r.length;r[r.length-1],s&&r.push(s[0]),o<2||2===o&&r[1].isExtreme?(r[r.length-1],i=r.map(e=>({type:"L",values:[e.x,e.y]}))):i=Et(r,{maxError:l,keepCorners:a}),n.push(...i)}t&&n.push({type:"Z",values:[]});return n}(f,{closed:h,tolerance:a&&l?(a+l)/2*.004*u:2.5,keepCorners:n});return g}function Bt(e,{precisionPoly:t=1,autoAccuracy:a=!1,polyFormat:l="points",decimals:r=-1,simplifyRD:n=1,simplifyRDP:s=1}={}){let i=e.length,o=[],p=[{x:e[0].values[0],y:e[0].values[1]}],h=[];for(let t=1;t<i;t++){let a=e[t],{type:l,values:r,p0:n,p:s,dimA:i=0}=a;h.push(+i.toFixed(8)),p.push(s)}let u=[p[0]];h=h.filter(Boolean).sort();let c=h[h.length-1];t*=c>2&&c<25?1:20/c;for(let a=1;a<i;a++){let l=e[a],{type:r,values:n,p0:s,p:i,cp1:o=null,cp2:p=null,dimA:h}=l,c=h,y=o&&p?[s,o,p,i]:o?[s,o,i]:[];if(y.length){let e=p?Z(o,p,.5):o;c=.2*(pe(s,e)+pe(i,e))+h}let x=Math.ceil(.2*c*t),f=Math.ceil(x);if(f&&y.length){let e=f?1/(f+1):0;for(let t=1;t<=f;t++){let a=H(y,e*t);u.push(a)}}u.push(i)}n>0&&(u=kt(u,{quality:n+"px"})),s>0&&(u=Ct(u,{quality:s+"px"})),o=St(u),e=o,a&&(r=function(e){let t=[];for(let a=1,l=e.length;a<l;a++){let l=e[a],{p0:r=null,p:n=null,dimA:s=0}=l;n&&r&&(s=s||pe(r,n),s&&t.push(s))}let a=t.sort(),l=Math.ceil(a.length/8);a=a.slice(0,l);let r=a.reduce((e,t)=>e+t,0)/l,n=r>112.5?0:Math.floor(75/r).toString().length;return Math.min(Math.max(0,n),8)}(p));let y=r>-1?u.map(e=>({x:me(e.x,r),y:me(e.y,r)})):u.map(e=>({x:e.x,y:e.y}));return"array"===l?y=y.map(e=>[e.x,e.y]):"string"===l&&(y=y.map(e=>[e.x,e.y].join(",")).join(" ")),{pathData:e,poly:y}}function Qt(e){for(let t=1,a=e.length;t<a;t++){let a=e[t],{type:l,values:r,p0:n,cp1:s=null,cp2:i=null,p:o=null}=a;if("L"===l){let a=Z(n,o,.333),l=Z(o,n,.333);e[t].type="C",e[t].values=[a.x,a.y,l.x,l.y,o.x,o.y],e[t].cp1=a,e[t].cp2=l}}return e}function Ot(e=[],t=!1){let a=[];e.forEach((e,t)=>{let l=function(e=[],{precision:t=1}={}){let a=[];for(let t=0;t<e.length;t++){let l=e[t],r=t>0?e[t-1]:e[t],{type:n,values:s}=l,i={x:r.values[r.values.length-2],y:r.values[r.values.length-1]},o=s.length?{x:s[s.length-2],y:s[s.length-1]}:"",p=s.length?{x:s[0],y:s[1]}:"";switch(n){case"A":et(i,s).forEach(e=>{let t=e.values,l={x:t[0],y:t[1]},r={x:t[2],y:t[3]},n={x:t[4],y:t[5]};a.push(l,r,n)});break;case"C":let e={x:s[2],y:s[3]};a.push(p,e);break;case"Q":a.push(p)}"z"!==n.toLowerCase()&&a.push(o)}return a}(e.pathData),r=Fe(l)>=0;a.push({pts:l,bb:Le(l),cw:r,index:t,inter:0,includes:[],includedIn:[]})});let l=a.length;for(let e=0;e<l;e++){let t=a[e],r=t.bb;for(let n=0;n<l;n++){let l=a[n],s=l.bb;e===n||l.includes.includes(e)||V({x:s.left+s.width/2,y:s.top+s.height/2},t.pts,r)&&(a[n].inter+=1,l.includedIn.push(e),t.includes.push(n))}}for(let r=0;r<l;r++){let l=a[r],{cw:n,includedIn:s,includes:i}=l;(!s.length&&n&&!t||!s.length&&!n&&t)&&(e[r].pathData=ut(e[r].pathData),a[r].cw=!a[r].cw,n=a[r].cw);for(let t=0;t<i.length;t++){let l=i[t];a[l].cw===n&&(e[l].pathData=ut(e[l].pathData),a[l].cw=!a[l].cw)}}return e}function Rt(e="",{getObject:t=!1,toAbsolute:a=!1,toRelative:l=!0,toShorthands:r=!0,toLonghands:n=!1,quadraticToCubic:s=!0,arcToCubic:i=!1,cubicToArc:o=!1,simplifyBezier:p=!0,optimizeOrder:h=!0,autoClose:u=!1,removeZeroLength:c=!0,refineClosing:y=!0,removeColinear:x=!0,flatBezierToLinetos:f=!0,revertToQuadratics:g=!0,refineExtremes:d=!0,simplifyCorners:m=!1,removeDimensions:v=!1,removeIds:b=!1,removeClassNames:M=!1,omitNamespace:A=!1,fixDirections:w=!1,keepExtremes:C=!0,keepCorners:k=!0,extrapolateDominant:S=!0,keepInflections:E=!1,addExtremes:P=!1,addSemiExtremes:L=!1,toPolygon:D=!1,smoothPoly:T=!1,polyFormat:I="points",precisionPoly:$=1,simplifyRD:F=1,simplifyRDP:q=1,harmonizeCpts:N=!1,removeOrphanSubpaths:z=!1,simplifyRound:j=!1,scale:B=1,scaleTo:Q=0,crop:O=!1,alignToOrigin:R=!1,convertTransforms:_=!1,decimals:G=3,autoAccuracy:U=!0,minifyD:V=0,tolerance:Z=1,reversePath:H=!1,removePrologue:J=!0,removeHidden:X=!0,removeUnused:Y=!0,cleanupDefs:K=!0,cleanupClip:ee=!0,cleanupSVGAtts:te=!0,stylesToAttributes:ae=!1,fixHref:le=!1,legacyHref:re=!1,removeNameSpaced:ne=!0,attributesToGroup:se=!1,removeOffCanvas:ie=!1,mergePaths:oe=!1,shapesToPaths:pe=!1,shapeConvert:he=0,convert_rects:ue=!1,convert_ellipses:ce=!1,convert_poly:xe=!1,convert_lines:fe=!1,lineToCubic:me=!1,cleanUpStrokes:ve=!0,addViewBox:be=!1,addDimensions:Me=!1}={}){Z=Math.max(.1,Z),B=Math.max(.001,B);let Ae=function(e){let t="string";if(Array.isArray(e)){if(Array.isArray(e[0])){if(2===e[0].length)return"polyArray";if(Array.isArray(e[0][0])&&2===e[0][0].length)return"polyComplexArray";if(void 0!==e[0][0].x&&void 0!==e[0][0].y)return"polyComplexObjectArray"}else{if(void 0!==e[0].x&&void 0!==e[0].y)return"polyObjectArray";if(e[0]?.type&&e[0]?.values)return"pathData"}return"array"}if("string"==typeof e){let a=(e=e.trim()).includes("<svg")&&e.includes("</svg"),l=e.startsWith("M")||e.startsWith("m"),r=!isNaN(e.substring(0,1))&&!isNaN(e.substring(e.length-1,e.length));if(a)t="svgMarkup";else if(l)t="pathDataString";else if(r)t="polyString";else{let a=/^(file:|https?:\/\/|\/|\.\/|\.\.\/)/.test(e),l=e.startsWith("data:image");t=a||l?"url":"string"}return t}return t=typeof e,(e.constructor.name||t).toLowerCase()}(e),we="",Ce=0,ke=0,Se=0,Ee={},Pe="",De="svgMarkup"===Ae?1:0,Te=[],Ie=[],$e=[],Fe="";Ce=e.length;let Ne={x:0,y:0,width:0,height:0},je={x:0,y:0,width:0,height:0},Be=[],Oe=[];i=!!D||i;let Re=[];if("svgMarkup"!==Ae){if("pathDataString"===Ae)Pe=e;else if("polyString"===Ae)Pe="M"+e;else if("polyArray"===Ae||"polyObjectArray"===Ae||"polyComplexArray"===Ae||"polyComplexObjectArray"===Ae){Pe=St(ft(e)),Fe=Pe.map(e=>`${e.type} ${e.values.join(" ")}`).join(" "),Ce=Fe.length}else"pathData"===Ae&&(Pe=e,Fe=Array.from(Pe).map(e=>`${e.type} ${e.values.join(" ")}`).join(" "),Ce=Fe.length);Ie.push({d:Pe,el:null})}else{we=dt(e,{removeIds:b,removeClassNames:M,removeDimensions:v,cleanupSVGAtts:te,cleanUpStrokes:ve,removeHidden:X,removeUnused:Y,removeNameSpaced:ne,stylesToAttributes:ae,removePrologue:J,fixHref:le,mergePaths:oe,convertTransforms:_,legacyHref:re,cleanupDefs:K,cleanupClip:ee,addViewBox:be,removeOffCanvas:ie,addDimensions:Me,shapeConvert:he,convert_rects:ue,convert_ellipses:ce,convert_poly:xe,convert_lines:fe}).svg,we.querySelectorAll("path").forEach((e,t)=>{Ie.push({d:e.getAttribute("d"),el:e,idx:t})}),Ne=lt(we,G)}let _e={toRelative:l,toAbsolute:a,toLonghands:n,toShorthands:r,decimals:G},Ge=[];for(let e=0,t=Ie.length;t&&e<t;e++){let t=[],a=Ie[e],{d:l,el:r}=a,n=Ze(l,{quadraticToCubic:s,arcToCubic:i}),u=T||D?Le(W(n)):null;if(1!==B||Q){if(Q)if(Ne.width&&!O)B=Q/Ne.width;else{let e=n.map(e=>({type:e.type,values:e.values}));e=He(e,{arcToCubic:!0}),e=ge(e);let t=Le(W(e));Be.push(t.x,t.x+t.width),Oe.push(t.y,t.y+t.height);let a=Q/t.width;B=a}n=At(n,B)}let v=n.length;z&&(n=st(n));let b=ye(n),M=b.length;for(let e=0;e<M;e++){let a=b[e],l=[],r=Array.from(new Set(a.map(e=>e.type))).join(""),n=!/[acqts]/gi.test(r),s=/[z]/gi.test(r);if(n)l=W(a),F>0&&(l=kt(l,{quality:F+"px"})),q>0&&(l=Ct(l,{quality:q+"px"})),a=St(l,s);else if(D){p=!1,T=!1;let e=Qe(a),{bb:t,pathData:l}=e;a=l;let r=Bt(a,{precisionPoly:$,autoAccuracy:U,polyFormat:I,decimals:G,simplifyRD:F,simplifyRDP:q});$e.push(r.poly),a=r.pathData}if(T&&n){a=it(a),a=jt(W(a),{denoise:.8,tolerance:Z,width:u.width,height:u.height,manhattan:!1,absolute:!1,keepCorners:k,keepExtremes:C,keepInflections:E,closed:s,simplifyRD:F,simplifyRDP:q})}(x||c)&&(a=it(a)),h&&(a=ot(a)),x&&(a=nt(a,{tolerance:Z,flatBezierToLinetos:!1})),(P||L)&&(a=ge(a,{tMin:0,tMax:1,addExtremes:P,addSemiExtremes:L,angles:[30]})),H&&(a=ut(a));let v=Qe(a,{detectSemiExtremes:L}),{pathData:M,bb:A,dimA:w}=v;if(Be.push(A.x,A.x+A.width),Oe.push(A.y,A.y+A.height),y&&(M=Mt(M,{threshold:.001*w})),M=p?ze(M,{simplifyBezier:p,keepInflections:E,keepExtremes:C,keepCorners:k,extrapolateDominant:S,revertToQuadratics:g,tolerance:Z}):M,d){M=ct(M,{threshold:.05*(A.width+A.height),tolerance:Z})}if(!i&&o&&(M=tt(M,{areaThreshold:2.5})),x&&f&&(M=nt(M,{tolerance:Z,flatBezierToLinetos:f})),m){M=mt(M,{threshold:.1*(A.width+A.height),tolerance:Z})}if(j&&(M=bt(M)),g&&(M=wt(M,Z)),me&&(M=Qt(M)),h&&(M=pt(M,{autoClose:false})),U){let e=de(M);Re.push(e)}t.push({pathData:M,bb:A})}let A=Math.min(...Be),N=Math.min(...Oe);je={x:A,y:N,width:Math.max(...Be)-A,height:Math.max(...Oe)-N};let _=je.height>je.width;if(h&&(t=_?t.sort((e,t)=>e.bb.y-t.bb.y||e.bb.x-t.bb.x):t.sort((e,t)=>e.bb.x-t.bb.x||e.bb.y-t.bb.y)),w&&(t=Ot(t)),n=[],Te.push(t),t.forEach(e=>{n.push(...e.pathData)}),U){Re=Re.sort().reverse();let e=Re[Math.floor(.5*Re.length)];G=Math.floor(.5*(Re[0]+e)),_e.decimals=G}if(oe=!1,r&&oe)Ge.push(...n);else{n=JSON.parse(JSON.stringify(n)),n=He(n,_e),c&&(n=it(n)),R&&(n[0].values[0]=(n[0].values[0]-je.x).toFixed(G),n[0].values[1]=(n[0].values[1]-je.y).toFixed(G),je.x=0,je.y=0);let e=n.length,t=qe(n,V);ke=t.length,Se=+(100/Ce*ke).toFixed(2),a.d=t,a.report={original:v,new:e,saved:v-e,compression:Se,decimals:G},r&&r.setAttribute("d",t)}}if(De){if(Ge.length){let e=He(Ge,_e);e=it(e);let t=qe(e,V);Ie[0].el.setAttribute("d",t);for(let e=1;e<Ie.length;e++){let t=Ie[e].el;t&&t.remove()}!function(e){e.querySelectorAll("g, defs").forEach(e=>{e.children.length||e.remove()})}(we)}if(B){let{x:e,y:t,width:a,height:l,w:r,h:n,hasViewBox:s,hasWidth:i,hasHeight:o,widthUnit:p,heightUnit:h}=Ne;O&&(e=je.x,t=je.y,a=je.width,l=je.height,r=a,n=l),s&&we.setAttribute("viewBox",[e,t,a,l].map(e=>+(e*B).toFixed(G)).join(" ")),i&&we.setAttribute("width",+(r*B).toFixed(G)+p),o&&we.setAttribute("height",+(n*B).toFixed(G)+h)}if(w){we.querySelectorAll("path[fill-rule], path[clip-rule]").forEach(e=>{e.removeAttribute("fill-rule"),e.removeAttribute("clip-rule")})}we=function(e,t=!1){let a=(new XMLSerializer).serializeToString(e);return t&&(a=a.replaceAll('xmlns="http://www.w3.org/2000/svg"',"")),a=a.replace(/\t/g,"").replace(/[\n\r|]/g,"\n").replace(/\n\s*\n/g,"\n").replace(/ +/g," ").replace(/> </g,"><").trim().replaceAll("&#10;","\n"),a}(we,A),ke=we.length,Se=+(100/Ce*ke).toFixed(2),Ce=+(Ce/1024).toFixed(3),ke=+(ke/1024).toFixed(3),Ee={svgSize:Ce,svgSizeOpt:ke,compression:Se,decimals:G}}else({d:Pe,report:Ee}=Ie[0]);return $e.length&&1===$e.length&&($e=$e[0]),t?{svg:we,d:Pe,polys:$e,report:Ee,pathDataPlusArr:Te,inputType:Ae}:Pe||we}"undefined"!=typeof window&&(window.svgPathSimplify=Rt,window.getElementTransform=ce,window.getViewBox=lt);export{M as PI,a as abs,l as acos,r as asin,n as atan,s as atan2,i as ceil,o as cos,p as exp,h as floor,ce as getElementTransform,lt as getViewBox,c as hypot,u as log,y as max,x as min,f as pow,g as random,d as round,m as sin,v as sqrt,Rt as svgPathSimplify,b as tan};
3
+ if(A){let e="C"===l?Math.abs(a.cp2.x-a.p.x):Math.abs(a.cp1.x-a.p.x),t="C"===l?Math.abs(a.cp2.y-a.p.y):Math.abs(a.cp1.y-a.p.y);if(((0===t||t<=M)&&e>0||(0===e||e<=M)&&t>0)&&(C=!0),(o.x===s.x&&o.y!==s.y||o.y===s.y&&o.x!==s.x)&&(d[d.length-1].extreme=!0),i.x!==p&&i.y!==y&&i.x!==c&&i.y!==f||(C=!0),!C){if(ae(null,v)){let e=ne(v);e.length&&e[0]>.2&&(C=!0)}}}if(C&&(a.extreme=!0),A&&w){if(n&&!a.extreme){let e=Math.abs(i.x-u.x),t=Math.abs(i.y-u.y),l=!1;if(e&&t&&e>b||t>b){let e=_(u,i),t=_(i,m.cp1);l=oe(Math.abs(e+t)/2)}l&&(a.semiExtreme=!0)}if((a.cptArea<0&&m.cptArea>0||a.cptArea>0&&m.cptArea<0)&&(a.directionChange=!0),!a.extreme){let e=u||o,t=m.cp1,l=_e([e,i,t],!1),r=.01*he(e,t),n=Math.abs(l)<r,s=l<0&&a.cptArea>0||l>0&&a.cptArea<0;!n&&s&&(a.corner=!0)}}d.push(a)}return s&&d.forEach(t=>{t.directionChange&&e(markers,t.p,"orange","1.5%","0.5"),t.corner&&e(markers,t.p,"magenta","1.5%","0.5"),t.extreme&&e(markers,t.p,"cyan","1%","0.5")}),u={pathData:d,bb:h,dimA:(x+g)/2},u}function Je(e,{addSquareLength:t=!0,addArea:a=!1,addArcParams:l=!1,addAverageDim:r=!0}={}){let n=e[0],s={x:n.values[0],y:n.values[1]},i=s,o=s;n.p0=i,n.p=o,n.idx=0,n.dimA=0;let u=e.length,h=[n];for(let r=1;r<u;r++){let n,u,p=e[r],{type:c,values:y}=p,f=y.length;if(o=f?{x:y[f-2],y:y[f-1]}:s,p.p0=i,p.p=o,p.dimA=pe(i,o),"M"===c&&(s=o),"Q"===c||"C"===c)n={x:y[0],y:y[1]},u="C"===c?{x:y[2],y:y[3]}:null,p.cp1=n,u&&(p.cp2=u);else if("A"===c&&l){let{rx:e,ry:t,cx:a,cy:l,startAngle:r,endAngle:n,deltaAngle:s}=J(i.x,i.y,...y);p.cx=a,p.cy=l,p.rx=e,p.ry=t,p.xAxisRotation=y[2]/180*Math.PI,p.largeArc=y[3],p.sweep=y[4],p.startAngle=r,p.endAngle=n,p.deltaAngle=s}if("Z"===c&&s.x!==o.x&&s.y!==o.y&&(p.closePath=!0),t&&(p.squareDist=he(i,o)),a){let e=0;"C"===c&&(e=_e([i,n,u,o],!1)),"Q"===c&&(e=_e([i,n,o],!1)),p.cptArea=e}p.idx=r,i=o,h.push(p)}return h}const Ke=new Set([77,109,65,97,67,99,76,108,81,113,83,115,84,116,72,104,86,118,90,122]),et=new Uint8Array(128);et[77]=2,et[109]=2,et[65]=7,et[97]=7,et[67]=6,et[99]=6,et[76]=2,et[108]=2,et[81]=4,et[113]=4,et[83]=4,et[115]=4,et[84]=2,et[116]=2,et[72]=1,et[104]=1,et[86]=1,et[118]=1,et[90]=0,et[122]=0;const tt=new Set([5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279]),at=e=>32===e||44===e||10===e||13===e||8232===e||8233===e||9===e||11===e||12===e||160===e||e>=5760&&tt.has(e);function lt(e,{toAbsolute:t=!0,toLonghands:a=!0,quadraticToCubic:l=!1,arcToCubic:r=!1,arcAccuracy:n=4}={}){let s=Array.isArray(e),i=s&&"object"==typeof e[0]&&"function"==typeof e[0].constructor,o=s?e:function(e,t=!0,a=0){e=e.trim(),a&&console.log("!!!limit",a);let l={pathData:[],hasRelatives:!1,hasShorthands:!1,hasArcs:!1,hasQuadratics:!1,isPolygon:!1,log:[]};if(""===e)return l;let r,n=0,s=e.length,i="",o=-1,u="",h=!1,p=0,c=0,y=0,f=!1,x=new Set([]);const g=()=>{f&&("M"===i?i="L":"m"===i&&(i="l"),l.pathData.push({type:i,values:[]}),o++,c=0,f=!1)},d=(e=!1)=>{(e?p>0:""!==u)&&(t&&-1===o&&(r="Pathdata must start with M command",l.log.push(r),i="M",l.pathData.push({type:i,values:[]}),y=2,c=0,o++),"A"===i||"a"===i?(({val:u,valueIndex:c}=((e="",t=0)=>{let a=e.length;return 3===t&&2===a?(e=[+e[0],+e[1]],t++):4===t&&a>1?(e=[+e[0],+e.substring(1)],t++):3===t&&a>=3?(e=[+e[0],+e[1],+e.substring(2)],t+=2):e=[+e],{val:e,valueIndex:t}})(u,c)),l.pathData[o].values.push(...u)):(t&&u[1]&&"."!==u[1]&&"0"===u[0]&&(r=`${o}. command: Leading zeros not valid: ${u}`,l.log.push(r)),l.pathData[o].values.push(+u)),c++,u="",p=0,f=c>=y)},m=()=>{if(o>0){let e=l.pathData[o].values.length;(e&&e<y||e&&e>y||("z"===i||"Z"===i)&&e>0)&&(r=`${o}. command of type "${i}": ${y-e} values too few - ${y} expected`,l.log[l.log.length-1]!==r&&l.log.push(r))}};let v=!1,b=!1,M=!1,A="";for(;n<s;){A=e.charCodeAt(n);let a=A>47&&A<58;if(a||(v=101===A||69===A,b=45===A||43===A,M=46===A),a||b||M||v){if(h||45!==A&&46!==A)g();else{let e=46===A;d(e),g(),e&&p++}u+=e[n],h=v,n++}else if((A<48||A>5759)&&at(A))d(),n++;else{if(A>64){if(!Ke.has(A)){r=`${o}. command "${e[n]}" is not a valid type`,l.log.push(r),n++;continue}""!==u&&(l.pathData[o].values.push(+u),c++,u=""),t&&m(),i=e[n],y=et[A];let a="M"===i||"m"===i,s=o>0&&("z"===l.pathData[o].type||"Z"===l.pathData[o].type);x.add(i),s&&!a&&(l.pathData.push({type:"m",values:[0,0]}),o++),l.pathData.push({type:i,values:[]}),o++,p=0,c=0,f=!1,n++;continue}a||(r=`${o}. ${e[n]} is not a valid separarator or token`,l.log.push(r),u=""),n++}}d(),t&&m(),t&&l.log.length&&(r="Invalid path data:\n"+l.log.join("\n"),"log"===t?console.log(r):console.warn(r)),l.pathData[0].type="M";let w=Array.from(x).join("");return l.hasRelatives=/[lcqamtsvh]/g.test(w),l.hasShorthands=/[vhst]/gi.test(w),l.hasArcs=/[a]/gi.test(w),l.hasQuadratics=/[qt]/gi.test(w),l.isPolygon=!/[cqats]/gi.test(w),l}(e),{hasRelatives:u=!0,hasShorthands:h=!0,hasQuadratics:p=!0,hasArcs:c=!0}=o,y=i?o:o.pathData;return y=function(e=[],{toAbsolute:t=!0,toLonghands:a=!0,quadraticToCubic:l=!1,arcToCubic:r=!1,arcAccuracy:n=2,hasRelatives:s=!0,hasShorthands:i=!0,hasQuadratics:o=!0,hasArcs:u=!0,testTypes:h=!1}={}){return rt(e,{toAbsolute:t,toLonghands:a,quadraticToCubic:l,arcToCubic:r,arcAccuracy:n,hasRelatives:s,hasShorthands:i,hasQuadratics:o,hasArcs:u,testTypes:h,decimals:-1})}(y,{toAbsolute:t,toLonghands:a,quadraticToCubic:l,arcToCubic:r,arcAccuracy:n,hasRelatives:u,hasShorthands:h,hasQuadratics:p,hasArcs:c}),y}function rt(e,{toShorthands:t=!0,toLonghands:a=!1,toRelative:l=!0,toAbsolute:r=!1,decimals:n=3,arcToCubic:s=!1,quadraticToCubic:i=!1,hasRelatives:o=!0,hasShorthands:u=!0,hasQuadratics:h=!0,hasArcs:p=!0,optimizeArcs:c=!0,testTypes:y=!1}={}){if(y){let t=Array.from(new Set(e.map(e=>e.type))).join("");/[lcqamts]/gi.test(t),h=/[qt]/gi.test(t),p=/[a]/gi.test(t),u=/[vhst]/gi.test(t),isPoly=/[mlz]/gi.test(t)}return l=!r&&l,t=!a&&t,r&&(e=ot(e)),u&&a&&(e=function(e,t=-1,a=!0){let l=!1;if(a){let t=e.map(e=>e.type).join(""),a=/[hstv]/gi.test(t);if(l=/[astvqmhlc]/g.test(t),!a)return e}e=a&&l?ot(e,t):e;let r=[],n={type:"M",values:e[0].values};r.push(n);for(let a=1,l=e.length;a<l;a++){let l,s,i,o,u,h,p,c,y=e[a],{type:f,values:x}=y,g=x.length,d=n.values,m=d.length,[v,b]=[x[g-2],x[g-1]],[M,A]=[d[m-2],d[m-1]];switch(f){case"H":n={type:"L",values:[x[0],A]};break;case"V":n={type:"L",values:[M,x[0]]};break;case"T":[l,s]=[d[0],d[1]],[M,A]=[d[m-2],d[m-1]],i=M+(M-l),o=A+(A-s),n={type:"Q",values:[i,o,v,b]};break;case"S":[l,s]=[d[0],d[1]],[M,A]=[d[m-2],d[m-1]],[p,c]=m>2&&"A"!==n.type?[d[2],d[3]]:[M,A],i=2*M-p,o=2*A-c,u=x[0],h=x[1],n={type:"C",values:[i,o,u,h,v,b]};break;default:n={type:f,values:x}}t>-1&&(n.values=n.values.map(e=>+e.toFixed(t))),r.push(n)}return r}(e)),c&&(e=function(e=[]){return e.forEach((t,a)=>{let{type:l,values:r}=t;if("A"===l){let[t,l,n,s,i]=[r[0],r[1],r[3],r[5],r[6]],o=e[a-1],[u,h]=[o.values[o.values.length-2],o.values[o.values.length-1]],p={x:u,y:h},c={x:s,y:i};if(t>=1&&(s===u||i===h)){if(Math.abs(t-l)/t<.01){let l=ue(Z(p,c,.5),p);Math.abs(l-t)/t<.01&&(e[a].values[0]=1,e[a].values[1]=1,e[a].values[2]=0)}}}}),e}(e)),t&&(e=function(e,t=-1,a=!1){let l;if(a){let t=e.map(e=>e.type).join("");l=/[astvqmhlc]/g.test(t)}e=a&&l?it(e):e;let r=e.length,n=new Array(r),s=e[0];n[0]=s;let i={x:e[0].values[0],y:e[0].values[1]},o=i;for(let t=1;t<r;t++){let a=e[t];s=a;let{type:l,values:r}=a,u=r.length,h=[r[u-2],r[u-1]],p=e[t-1];o={x:h[0],y:h[1]};let c=Math.abs(o.x-i.x),y=Math.abs(o.y-i.y),f=.01*pe(i,o),x=!1,g=!1,d=!1;if("C"===l&&"C"===p.type||"Q"===l&&"Q"===p.type){let e="C"===p.type?{x:p.values[2],y:p.values[3]}:{x:p.values[0],y:p.values[1]},t={x:r[0],y:r[1]},a=i.x-e.x,l=i.y-e.y;f=.01*pe(e,t),x=pe({x:e.x+2*a,y:e.y+2*l},t)<f}else"L"===l&&(g=0===y||y<f,d=0===c||c<f,x=d||g);switch(l){case"L":g&&(s={type:"H",values:[r[0]]}),d&&(s={type:"V",values:[r[1]]});break;case"Q":x&&(s={type:"T",values:[o.x,o.y]});break;case"C":x&&(s={type:"S",values:[r[2],r[3],o.x,o.y]});break;default:s={type:l,values:r}}i=o,n[t]=s}return n}(e)),p&&s&&(e=function(e,{arcAccuracy:t=1}={}){let a=[e[0]];for(let l=1,r=e.length;l<r;l++){let r=e[l],n=e[l-1].values,s=n.length,i={x:n[s-2],y:n[s-1]};if("A"===r.type){ht(i,r.values,t).forEach(e=>{a.push(e)})}else a.push(r)}return a}(e)),h&&i&&(e=function(e){let t=[e[0]];for(let a=1,l=e.length;a<l;a++){let l=e[a],r=e[a-1].values,n=r.length,s={x:r[n-2],y:r[n-1]};"Q"===l.type?t.push(st(s,l.values)):t.push(l)}return t}(e)),n>-1&&l&&(e=Ce(e,n)),l&&(e=function(e,t=-1){return it(e,!0,t)}(e)),n>-1&&(e=Ce(e,n)),e}function nt(e={},t={},a={},l={},r=1){let n=Z(e,t,1.5),s=Z(l,a,1.5),i=.01*pe(e,l)*r,o=pe(n,s),u=null,h={type:"C",values:[t.x,t.y,a.x,a.y,l.x,l.y]};return o<i&&(u=H(e,t,l,a,!1,!0),u&&(h.type="Q",h.values=[u.x,u.y,l.x,l.y],h.p0=e,h.cp1=u,h.cp2=null,h.p=l)),h}function st(e,t){Array.isArray(e)&&(e={x:e[0],y:e[1]});let a={x:e.x+2/3*(t[0]-e.x),y:e.y+2/3*(t[1]-e.y)},l={x:t[2]+2/3*(t[0]-t[2]),y:t[3]+2/3*(t[1]-t[3])};return{type:"C",values:[a.x,a.y,l.x,l.y,t[2],t[3]]}}function it(e,t=!1,a=-1){a>=0&&(e[0].values=e[0].values.map(e=>+e.toFixed(a)));let l=e.length,r=e[0].values,n=r[0],s=r[1],i=n,o=s;for(let r=1;r<l;r++){let l=e[r],{type:u,values:h}=l,p=h.length,c=u.toLowerCase(),y=u.toUpperCase(),f=t?c:y;if(u!==f)switch(l.type=f,c){case"a":h[5]=t?h[5]-n:h[5]+n,h[6]=t?h[6]-s:h[6]+s;break;case"v":h[0]=t?h[0]-s:h[0]+s;break;case"h":h[0]=t?h[0]-n:h[0]+n;break;case"m":t?(h[0]-=n,h[1]-=s):(h[0]+=n,h[1]+=s),i=t?h[0]+n:h[0],o=t?h[1]+s:h[1];break;default:if(h.length)for(let e=0;e<h.length;e++)h[e]=t?h[e]-(e%2?s:n):h[e]+(e%2?s:n)}switch(c){case"z":n=i,s=o;break;case"h":n=t?n+h[0]:h[0];break;case"v":s=t?s+h[0]:h[0];break;case"m":i=h[p-2]+(t?n:0),o=h[p-1]+(t?s:0);default:n=h[p-2]+(t?n:0),s=h[p-1]+(t?s:0)}a>=0&&(l.values=l.values.map(e=>+e.toFixed(a)))}return e}function ot(e,t=-1){return it(e,!1,t)}function ut({p0:e={x:0,y:0},p:t={x:0,y:0},centroid:a={x:0,y:0},rx:l=0,ry:r=0,xAxisRotation:n=0,radToDegree:s=!1,startAngle:i=null,endAngle:o=null,deltaAngle:u=null}={}){if(!l||!r)return[];let h=[];const p=1.5707963267948966;let c=s?n:n*Math.PI/180,y=Math.cos(c),f=Math.sin(c);null!==i&&null!==o&&null!==u||({startAngle:i,endAngle:o,deltaAngle:u}=G(a,e,t));let x=l!==r?te(i,l,r):i,g=l!==r?te(u,l,r):u,d=Math.max(1,Math.ceil(Math.abs(g)/p)),m=g/d;for(let e=0;e<d;e++){const e=Math.abs(m)===p?.551785*Math.sign(m):4/3*Math.tan(m/4);let t=Math.cos(x),n=Math.sin(x),s=Math.cos(x+m),i=Math.sin(x+m),o=[];[{x:t-n*e,y:n+t*e},{x:s+i*e,y:i-s*e},{x:s,y:i}].forEach(e=>{let t=e.x*l,n=e.y*r;o.push(y*t-f*n+a.x,f*t+y*n+a.y)}),h.push({type:"C",values:o,cp1:{x:o[0],y:o[1]},cp2:{x:o[2],y:o[3]},p:{x:o[4],y:o[5]}}),x+=m}return h}function ht(e,t,a=1){const l=2*Math.PI;let[r,n,s,i,o,u,h]=t;if(0===r||0===n)return[];let p=s?s*l/360:0,c=p?Math.sin(p):0,y=p?Math.cos(p):1,f=y*(e.x-u)/2+c*(e.y-h)/2,x=-c*(e.x-u)/2+y*(e.y-h)/2;if(0===f&&0===x)return[];r=Math.abs(r),n=Math.abs(n);let g=f*f/(r*r)+x*x/(n*n);if(g>1){let e=Math.sqrt(g);r*=e,n*=e}let d=r*r,m=r===n?d:n*n,v=f*f,b=x*x,M=d*m-d*b-m*v;M<=0?M=0:(M/=d*b+m*v,M=Math.sqrt(M)*(i===o?-1:1));let A=M?M*r/n*x:0,w=M?M*-n/r*f:0,C=y*A-c*w+(e.x+u)/2,k=c*A+y*w+(e.y+h)/2,S=(f-A)/r,E=(x-w)/n,P=(-f-A)/r,L=(-x-w)/n;const $=(e,t,a,l)=>{let r=+(e*a+t*l).toFixed(9);return 1===r||-1===r?1===r?0:Math.PI:(r=r>1?1:r<-1?-1:r,(e*l-t*a<0?-1:1)*Math.acos(r))};let D=$(1,0,S,E),T=$(S,E,P,L);0===o&&T>0?T-=2*Math.PI:1===o&&T<0&&(T+=2*Math.PI);let z=(+(Math.abs(T)/(l/4)).toFixed(0)||1)*a;T/=z;let I=[];const q=1.5707963267948966,j=.551785;let N=T===q?j:T===-q?-j:4/3*Math.tan(T/4),F=T?Math.cos(T):1,B=T?Math.sin(T):0;const Q=(e,t,a,l,r)=>{let n=e!=t?Math.cos(e):l,s=e!=t?Math.sin(e):r,i=Math.cos(e+t),o=Math.sin(e+t);return[{x:n-s*a,y:s+n*a},{x:i+o*a,y:o-i*a},{x:i,y:o}]};for(let e=0;e<z;e++){let e={type:"C",values:[]};Q(D,T,N,F,B).forEach(t=>{let a=t.x*r,l=t.y*n;e.values.push(y*a-c*l+C,c*a+y*l+k)}),I.push(e),D+=T}return I}function pt(e,{areaThreshold:t=2.5}={}){for(let a=0,l=e.length;a<l;a++){let l=e[a],r=e[a+1]||null,{type:n,values:s,p0:i,cp1:o=null,cp2:u=null,p:h=null}=l;if("C"===n&&r&&"C"===r.type){let l=ct(i,o,u,h,t),n=ct(r.p0,r.cp1,r.cp2,r.p,t);if(l.isArc&&n.isArc){let t=.01*pe(i,r.p),s=Math.abs(r.p.x-i.x),o=Math.abs(r.p.y-i.y),u=o<t&&s>t,p=s<t&&o>t,{rx:c,ry:y}=l,f=_e([i,h,r.p])<0?0:1;if(p||u){c=Math.min(c,n.rx),y=Math.min(y,n.ry),e[a]=null,e[a+1].type="A",e[a+1].values=[c,y,0,0,f,r.p.x,r.p.y];continue}}}}return e=e.filter(Boolean)}function ct(e,t,a,l,r=7.5){let n,s={type:"C",values:[t.x,t.y,a.x,a.y,l.x,l.y]},i=0,o=!1,u=_(e,t,!0),h=_(l,a,!0),p=180*Math.abs(u-h)/Math.PI,c=0,y=0;if(Math.abs(p%180-90)<3){n=H(e,K(t,e.x,e.y,-.5*Math.PI),l,K(a,l.x,l.y,.5*Math.PI),!1);let u=H(e,t,l,a,!1);if(u){let n=ue(e,u),h=ue(l,u),p=+Math.max(n,h).toFixed(8),f=+Math.min(n,h).toFixed(8);c=f,y=p;let x=_e([e,t,a,l])<0?0:1,g=Math.abs(l.x-e.x)>Math.abs(l.y-e.y);100/c*Math.abs(c-y)<5&&(c=p,y=c),g&&(c=p,y=f);let d=Ve([{type:"M",values:[e.x,e.y]},{type:"C",values:[t.x,t.y,a.x,a.y,l.x,l.y]}]),m={type:"A",values:[c,y,0,0,x,l.x,l.y]};i=Math.PI*(c*y)/4,i-=Math.abs(_e([e,l,u])),function(e,t){let a=Math.abs(e-t);return Math.abs(100-100/e*(e+a))}(d,i)<r&&(o=!0,s=m)}}return{com:s,isArc:o,area:i,rx:c,ry:y,centroid:n}}function yt(e=null,{autoRoundValues:t=!0,decimals:a=-1}={}){if(!e)return!1;let l=e.hasAttribute("width"),r=e.hasAttribute("height"),n=e.hasAttribute("viewBox"),s=l?e.getAttribute("width"):0,i=r?e.getAttribute("height"):0,o=s?s.includes("%")?0:je(s,{isHorizontal:!0}):300,u=i?i.includes("%")?0:je(i,{isVertical:!0}):150,h=n?e.getAttribute("viewBox").split(/,| /).filter(Boolean).map(Number):[0,0,o,u];t?([o,u]=[o,u].map(e=>we(e)),h=h.map(e=>we(e))):!t&&a>-1&&([o,u]=[o,u].map(e=>+e.toFixed(a)),h=h.map(e=>+e.toFixed(a)));let[p=0,c=0,y=0,f=0]=h;return n&&(o=y,u=f),{x:p,y:c,width:y,height:f,w:o,h:u,hasViewBox:n,hasWidth:l,hasHeight:r,widthUnit:"",heightUnit:""}}function ft(e,t){let a=[];const l=(e,t)=>{let{a:a,b:l,c:r,d:n,e:s,f:i}=t,{x:o,y:u}=e;return{x:a*o+r*u+s,y:l*o+n*u+i}},r=(e,t,a)=>{let[r,n,s,i,o,u,h]=t,p=J(e.x,e.y,t[0],t[1],s,i,o,u,h);({rx:r,ry:n}=p);let{a:c,b:y,c:f,d:x,e:g,f:d}=a,m=function(e,t,a,l){const r=Math.PI/180,n=1e-7;l=Array.isArray(l)?{a:l[0],b:l[1],c:l[2],d:l[3],e:l[4],f:l[5]}:l;let s=Math.cos(a*r),i=Math.sin(a*r),o=[e*(l.a*s+l.c*i),e*(l.b*s+l.d*i),t*(-l.a*i+l.c*s),t*(-l.b*i+l.d*s)],u=o[0]*o[0]+o[2]*o[2],h=o[1]*o[1]+o[3]*o[3],p=Math.sqrt(((o[0]-o[3])*(o[0]-o[3])+(o[2]+o[1])*(o[2]+o[1]))*((o[0]+o[3])*(o[0]+o[3])+(o[2]-o[1])*(o[2]-o[1]))),c=(u+h)/2;if(p<=n)return{rx:e=t=Math.sqrt(c),ry:t,ax:a=0};if(Math.abs(p-Math.abs(u-h))<=n)return{rx:e=Math.sqrt(u),ry:t=Math.sqrt(h),ax:a=0};let y=o[0]*o[1]+o[2]*o[3],f=c+p/2,x=c-p/2;if(Math.abs(y)<=n&&Math.abs(f-h)<=n)return a=0,{rx:e=Math.sqrt(x),ry:t=Math.sqrt(f),ax:a};(a=Math.atan(Math.abs(y)>Math.abs(f-h)?(f-u)/y:y/(f-h))/r)>=0?(e=Math.sqrt(f),t=Math.sqrt(x)):(a+=90,e=Math.sqrt(x),t=Math.sqrt(f));return{rx:e,ry:t,ax:a}}(r,n,s,a),v=l({x:u,y:h},a),b=c*c+y*y,M=Math.sqrt(b);return(M<0||(c*x-f*y)/M<0)&&(o=0===o?1:0),{type:"A",values:[m.rx,m.ry,m.ax,i,o,v.x,v.y]}};return"100100"===[(t=(e=>(e="string"==typeof e?e=e.replace(/^matrix\(|\)$/g,"").split(",").map(Number):e,e=Array.isArray(e)?{a:e[0],b:e[1],c:e[2],d:e[3],e:e[4],f:e[5]}:{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e,f:e.f}))(t)).a,t.b,t.c,t.d,t.e,t.f].map(e=>+e.toFixed(1)).join("")?e:(e.forEach((n,s)=>{let{type:i,values:o}=n,u=i.toLowerCase(),h=(s>0?e[s-1]:e[s]).values,p=h.length,c={x:h[p-2],y:h[p-1]};o[o.length-2],o[o.length-1];let y={type:i,values:[]};if("a"===u)y=r(c,o,t);else if(o.length)for(let e=0;e<o.length;e+=2){let a=l({x:n.values[e],y:n.values[e+1]},t);y.values[e]=a.x,y.values[e+1]=a.y}a.push(y)}),a)}function xt(e,{convert_rects:t=!1,convert_ellipses:a=!1,convert_poly:l=!1,convert_lines:r=!1}={}){let n=lt(e.getAttribute("d")),s=Array.from(new Set(n.map(e=>e.type))).join(""),i=/[a]/gi.test(s),o=/[csqt]/gi.test(s),u=/[l]/gi.test(s),h=!/[acqts]/gi.test(s),p=/[z]/gi.test(s),c=null,y=null,f=Be(e),x={};if(h)if(2===n.length&&r){y="line",c=document.createElementNS(C,y);let[e,t,a,l]=[...n[0].values,...n[1].values].map(e=>Ae(e,7));x={x1:e,y1:t,x2:a,y2:l}}else{let e=W(n),a=Qe(e),r=_e(e,!0),s=a.width*a.height,i=Math.abs(1-s/r);if(t&&i<.01){y="rect",c=document.createElementNS(C,y);let{x:e,y:t,width:l,height:r}=a;x={x:e,y:t,width:l,height:r}}else if(l){y=p?"polygon":"polyline",c=document.createElementNS(C,y),x={points:e.map(e=>[e.x,e.y]).flat().map(e=>Ae(e,7)).join(" ")}}}else if(!u&&a&&(!i&&o&&(n=pt(n,{areaThreshold:2.5}),i=n.filter(e=>"A"===e.type).length),i)){let e=Je(n,{addArcParams:!0}),t=e.filter(e=>"A"===e.type),a=new Set,l=new Set,r=new Set,s=new Set;if(t.length>1&&e.forEach(e=>{"A"===e.type&&(a.add(Ae(e.cx,7)),l.add(Ae(e.cy,7)),r.add(Ae(e.rx,7)),s.add(Ae(e.ry,7)))}),a=Array.from(a),l=Array.from(l),r=Array.from(r),s=Array.from(s),1===a.length&&1===l.length&&1===r.length&&1===s.length){let[e,t,n,i]=[r[0],s[0],a[0],l[0]];y=e===t?"circle":"ellipse",c=document.createElementNS(C,y),x="circle"===y?{r:e,cx:n,cy:i}:{rx:e,ry:t,cx:n,cy:i}}}if(c){let t=["id","class"];for(let e in x)c.setAttribute(e,x[e]);for(let e in f)(qe.atts[e].includes(y)||t.includes(e)||e.startsWith("data-"))&&c.setAttribute(e,f[e]);e=c}return e}function gt(e,{width:t=0,height:a=0,convert_rects:l=!1,convert_ellipses:r=!1,convert_poly:n=!1,convert_lines:s=!1,matrix:i=null}={}){let o=e.nodeName.toLowerCase();if("path"===o&&!i||"rect"===o&&!l||("circle"===o||"ellipse"===o)&&!r||("polygon"===o||"polyline"===o)&&!n||"line"===o&&!s)return e;let u=function(e,{stringify:t=!1,width:a=0,height:l=0}={}){let r,n,s,i,o,u,h,p,c,y,f,x,g=[],d=e.nodeName.toLowerCase();if(!a||!l){let t=function(e){let t=e.parentNode.closest("svg");for(;t&&t.parentNode&&t.parentNode.closest;){let e=t.parentNode.closest("svg");if(!e)break;t=e}return t}(e),r=yt(t);a=r.width,l=r.height}let m=function(e,{width:t=0,height:a=0,fontSize:l=16,dpi:r=96,autoRoundValues:n=!1,decimals:s=-1}={}){let i=[...e.attributes],o=i.map(e=>e.name),u=i.map(e=>e.nodeValue),h=t===a,p={};return o.forEach((l,r)=>{let s=Se.includes(l),i=Ee.includes(l),o=!h&&"r"===l,c=je(u[r],{isHorizontal:s,isVertical:i,width:t,height:a,normalizedDiagonal:o,autoRoundValues:n});p[l]=c,e.setAttribute(l,c)}),p}(e,{width:a,height:l});switch(d){case"path":r=e.getAttribute("d"),g=lt(r);break;case"rect":({x:n=0,y:s=0,width:a=0,height:l=0,rx:o=0,ry:u=0}=m),o||u?(o=o||u,u=u||o,o>a/2&&(o=a/2),u>l/2&&(u=l/2),g=[{type:"M",values:[n+o,s]},{type:"L",values:[n+a-o,s]},{type:"A",values:[o,u,0,0,1,n+a,s+u]},{type:"L",values:[n+a,s+l-u]},{type:"A",values:[o,u,0,0,1,n+a-o,s+l]},{type:"L",values:[n+o,s+l]},{type:"A",values:[o,u,0,0,1,n,s+l-u]},{type:"L",values:[n,s+u]},{type:"A",values:[o,u,0,0,1,n+o,s]},{type:"Z",values:[]}]):g=[{type:"M",values:[n,s]},{type:"L",values:[n+a,s]},{type:"L",values:[n+a,s+l]},{type:"L",values:[n,s+l]},{type:"Z",values:[]}];break;case"circle":case"ellipse":({cx:h=0,cy:p=0,r:i,rx:o,ry:u}=m);let t="circle"===d;t?(o=i,u=i):(o=o||i,u=u||i);let v=t&&i>=1?1:o,b=t&&i>=1?1:u;g=[{type:"M",values:[h+o,p]},{type:"A",values:[v,b,0,1,1,h-o,p]},{type:"A",values:[v,b,0,1,1,h+o,p]}];break;case"line":({x1:c,y1:f,x2:y,y2:x}=m),g=[{type:"M",values:[c,f]},{type:"L",values:[y,x]}];break;case"polygon":case"polyline":let M=e.getAttribute("points").split(/,| /).filter(Boolean).map(Number);for(let e=0;e<M.length;e+=2)g.push({type:0===e?"M":"L",values:[M[e],M[e+1]]});"polygon"===d&&g.push({type:"Z",values:[]})}return t?function(e){return e.map(e=>`${e.type} ${e.values.join(" ")}`).join(" ")}(g):g}(e,{width:t,height:a}),h=["d","x","y","x1","y1","x2","y2","cx","cy","dx","dy","r","rx","ry","width","height","points"];i&&"100100"!==Object.values(i).join("")&&(u=ft(u,i),h.push("transform","transform-origin"));let p=u.map(e=>`${e.type} ${e.values} `).join(" "),c=[...e.attributes].map(e=>e.name),y=document.createElementNS(C,"path");return y.setAttribute("d",p),c.forEach(t=>{if(!h.includes(t)){let a=e.getAttribute(t);y.setAttribute(t,a)}}),y}function dt(e,{tolerance:t=1,flatBezierToLinetos:a=!0}={}){let l=[e[0]],r={x:e[0].values[0],y:e[0].values[1]},n=r,s=r;e[e.length-1].type.toLowerCase();for(let i=1,o=e.length;i<o;i++){let u=e[i],h=e[i+1]||e[o-1],p="z"===h.type.toLowerCase()?r:{x:h.values[h.values.length-2],y:h.values[h.values.length-1]},{type:c,values:y}=u,f=y.slice(-2);s="Z"!==c?{x:f[0],y:f[1]}:r;let x=p?_e([n,s,p],!0):1/0,g=he(n,p),d=x<(g?g/333*t:0),m=!1;if(a||"C"!==c||(d=!1),a&&("C"===c||"Q"===c)){m=Ye([n,..."C"===c?[{x:y[0],y:y[1]},{x:y[2],y:y[3]}]:"Q"===c?[{x:y[0],y:y[1]}]:[],s],{tolerance:t}),m&&i<o-1&&(c="L",u.type="L",u.values=f)}d&&i<o-1&&"A"!==h.type&&("L"===c||a&&m)||(n=s,"M"===c&&(r=s),l.push(u))}return l}function mt(e){let t=[];for(let a=0,l=e.length;a<l;a++){let l=e[a];if(!l)continue;let{type:r=null,values:n=[]}=l,s=e[a+1]?e[a+1]:null;"M"!==r&&"m"!==r||s&&(!s||"Z"!==s.type&&"z"!==s.type)?t.push(l):s&&a++}return t}function vt(e){let t={x:e[0].values[0],y:e[0].values[1]},a=t,l=[e[0]];for(let r=1,n=e.length;r<n;r++){let n=e[r],s=e[r-1],i=e[r+1]||null,{type:o,values:u}=n,h="m"===s.type.toLowerCase()&&!i,p=u.length;if(a={x:u[p-2],y:u[p-1]},h||"L"!==o||a.x!==t.x||a.y!==t.y){if(!h&&("l"===o||"v"===o||"h"===o)){if("l"===o?"00"===u.join(""):0===u[0])continue}l.push(n),t=a}}return l}function bt(e){let t=e.length;if(!("z"===e[t-1].type.toLowerCase()))return e;let a=0,l=[];for(let a=0;a<t;a++){let t=e[a],{type:r,values:n}=t,s=n.length;if(s){let e={type:r,x:n[s-2],y:n[s-1],index:0};e.index=a,l.push(e)}}return l=l.sort((e,t)=>+e.y.toFixed(8)-+t.y.toFixed(8)||e.x-t.x),a=l[0].index,a?At(e,a):e}function Mt(e,{removeFinalLineto:t=!0,autoClose:a=!0}={}){let l=[],r=e.length,n={x:+e[0].values[0].toFixed(8),y:+e[0].values[1].toFixed(8)},s="z"===e[r-1].type.toLowerCase(),i=e.filter(e=>"L"===e.type),o=e[s?r-2:r-1],u=o.type,h=o.values.slice(-2).map(e=>+e.toFixed(8)),p=h[0]===n.x&&h[1]===n.y;!s&&a&&p&&(e.push({type:"Z",values:[]}),s=!0,r++);let c="L"!==e[1].type&&(!p||"L"===o.type);if(c=!1,!s)return e;let y=0;{let t=[];for(let a=0;a<r;a++){let l=e[a],{type:r,values:n}=l;if(n.length){let l=n.slice(-2),s=e[a-1]&&"L"===e[a-1].type,i=e[a+1]&&"L"===e[a+1].type,o=e[a-1]?e[a-1].type.toUpperCase():null,u=e[a+1]?e[a+1].type.toUpperCase():null,h={type:r,x:l[0],y:l[1],dist:0,index:0,prevL:s,nextL:i,prevCom:o,nextCom:u};h.index=a,t.push(h)}}if(i.length){let e=t.filter(e=>"L"!==e.type&&"M"!==e.type&&e.prevCom&&"L"===e.prevCom||"M"===e.prevCom&&"L"===u).sort((e,t)=>e.y-t.y||e.x-t.x)[0];y=e?e.index-1:0}else t=t.sort((e,t)=>+e.y.toFixed(8)-+t.y.toFixed(8)||e.x-t.x),y=t[0].index;e=y?At(e,y):e}return n={x:+e[0].values[0].toFixed(8),y:+e[0].values[1].toFixed(8)},r=e.length,o=e[r-2],u=o.type,h=o.values.slice(-2).map(e=>+e.toFixed(8)),p="L"===u&&h[0]===n.x&&h[1]===n.y,t&&p&&e.splice(r-2,1),l.push(...e),l}function At(e,t){let a=0,l="z"===e[e.length-1].type.toLowerCase();if(!l||t<1||e.length<3)return e;let r=l?1:0;!function(e){let t=e.length,a="z"===e[t-1].type.toLowerCase(),l=e[0],[r,n]=[l.values[0],l.values[1]].map(e=>+e.toFixed(8)),s=a?e[t-2]:e[t-1],i=s.values.length,[o,u]=[s.values[i-2],s.values[i-1]].map(e=>+e.toFixed(8));!a||r==o&&n==u||(e.pop(),e.push({type:"L",values:[r,n]},{type:"Z",values:[]}))}(e),a=t+1<e.length-1?t+1:e.length-1-r;let n,s,i=e.slice(a),o=e.slice(0,a);return o.shift(),n=o[o.length-1].values||[],s=[n[n.length-2],n[n.length-1]],r&&(i.pop(),o.push({type:"Z",values:[]})),e=[{type:"M",values:s},...i,...o]}function wt(e,{arcToCubic:t=!1,quadraticToCubic:a=!1,toClockwise:l=!1,returnD:r=!1}={}){const n=(e,t)=>{let a=[],l=[];if("A"!==e){for(let e=0;e<t.length;e+=2)a.push([t[e],t[e+1]]);l=a.pop(),a.reverse()}else{let e=0==t[4]?1:0;a=[t[0],t[1],t[2],t[3],e],l=[t[5],t[6]]}return{controlPoints:a,endPoints:l}};let s=[],i="z"===e[e.length-1].type.toLowerCase();i&&(e=(e=>{let t="z"===e[e.length-1].type.toLowerCase(),a=e[0],[l,r]=[a.values[0],a.values[1]],n=t?e[e.length-2]:e[e.length-1],[s,i]=[n.values[n.values.length-2],n.values[n.values.length-1]];return!t||l==s&&r==i||(e.pop(),e.push({type:"L",values:[l,r]},{type:"Z",values:[]})),e})(e),e.pop());let o=e[e.length-1].values,u=o.length,h=i?e[0]:{type:"M",values:[o[u-2],o[u-1]]};s.push(h),e.reverse();for(let t=1;t<e.length;t++){let a=e[t],l=a.type,r=a.values,i=e[t-1],o=i.type,u=[];u=[n(o,i.values).controlPoints,n(l,r).endPoints].flat(),s.push({type:o,values:u.flat()})}return i&&s.push({type:"z",values:[]}),s}function Ct(e,{threshold:t=null,tolerance:a=1}={}){if(!t){let a=function(e){let t=1/0,a=-1/0,l=1/0,r=-1/0;const n=e=>{e.x<t&&(t=e.x),e.x>a&&(a=e.x),e.y<l&&(l=e.y),e.y>r&&(r=e.y)};for(let t=0;t<e.length;t++){let a=e[t],{type:l,values:r}=a,s=r.length,i=(e[t-1]?e[t-1]:e[t]).values,o=i.length;if(s){let e={x:i[o-2],y:i[o-1]},t={x:r[s-2],y:r[s-1]};if(n(t),"C"===l||"Q"===l){let a={x:r[0],y:r[1]},s="C"===l?{x:r[2],y:r[3]}:a,i="C"===l?[e,a,s,t]:[e,a,t];le(i).forEach(e=>{let t=Y(i,e);n(t)})}else"A"===l&&re(e,r).forEach(e=>{n(e)})}}return{x:t,y:l,width:a-t,height:r-l}}(e);t=.05*(a.width+a.height)}let l=e.length;for(let r=0;r<l;r++){let l=e[r],{type:n,values:s,extreme:i,corner:o=!1,dimA:u,p0:h,p:p}=l,c=e[r+1]?e[r+1]:null,y=e[r+2]?e[r+2]:null,f=(c?pe(p,c.p):1/0)<t,x=(y?pe(y.p,c.p):1/0)<1*t;if(c&&y&&"C"===n&&"C"===c.type&&i&&y.extreme&&(x||f)){let l=He(c,y,t,a,!1);if(1===l.length){l=l[0],e[r+1]=null,e[r+2].values=[l.cp1.x,l.cp1.y,l.cp2.x,l.cp2.y,l.p.x,l.p.y],e[r+2].cp1=l.cp1,e[r+2].cp2=l.cp2,e[r+2].p0=l.p0,e[r+2].p=l.p,e[r+2].extreme=l.extreme,r++;continue}}if(c&&"C"===n&&"C"===c.type&&i&&f){let e=_e([l.p0,l.p,c.p]),t=_e([l.p0,l.cp1,l.cp2,l.p]);if(e<0&&t>0||e>0&&t<0)continue}}l=(e=e.filter(Boolean)).length;let r="z"===e[l-1].type.toLowerCase()?l-2:l-1,n=e[r],s=e[r-1]||null,i={x:e[0].values[0],y:e[0].values[1]},o=n.values.slice(-2),u=+o[0].toFixed(8)===+i.x.toFixed(8)&&+o[1].toFixed(8)===+i.y.toFixed(8),h="C"===e[1].type&&e[1].extreme?e[1]:null,p=pe(n.p0,n.p)<t;if(s&&"C"===s.type&&p&&u&&h){let l=He(s,n,t,a,!1);1===l.length&&(e[r-1]=l[0],e[r]=null,e=e.filter(Boolean))}return e}function kt(e,{toObject:t=!0,toArray:a=!1,flatten:l=!1}={}){if("string"==typeof e&&!isNaN(e[0]))return e=St(e.split(/,| /).filter(Boolean).map(Number));l&&(e=e.flat(2));let r=a?function(e){if(!Array.isArray(e[0][0])&&2===e[0].length)return e;let t=[];if(Array.isArray(e[0][0])&&2===e[0][0].length)return e.forEach(e=>{t.push(e.map(e=>[e.x,e.y]))}),t;return t=Array.from(e).map(e=>[e.x,e.y]),t}(e):function(e){if(void 0!==e[0].x&&void 0!==e[0].y)return e;let t=[];if(Array.isArray(e[0])&&void 0!==e[0][0].x&&void 0!==e[0][0].y)return e;if(Array.isArray(e[0][0])&&2===e[0][0].length)return e.forEach(e=>{t.push(e.map(e=>({x:e[0],y:e[1]})))}),t;if(e.length>3)return e=St(e);return e.map(e=>({x:e[0],y:e[1]}))}(e);return r}function St(e){let t=[];for(let a=1,l=e.length;a<l;a+=2)t.push({x:e[a-1],y:e[a]});return t}function Et(e,{fontSize:t=16,removeNameSpaced:a=!0,autoRoundValues:l=!1,minifyRgbColors:r=!1,removeInvalid:n=!0,removeDefaults:s=!0,cleanUpStrokes:i=!0,normalizeTransforms:o=!0,exclude:u=[],width:h=0,height:p=0}={}){let c=e.nodeName.toLowerCase(),y=function(e){let t={},a=[...e.attributes].map(e=>e.name),l=a.length;if(!l)return t;for(let r=0;r<l;r++){let l=a[r],n=e.getAttribute(l);if("transform"===l){let e=[],t=n.split(/(\w+)\(([^)]+)\)/).map(e=>e.trim()).filter(Boolean);for(let a=1;a<t.length;a+=2){let l=t[a-1],r=t[a],n=r.split(/,| /).map(e=>Ne(e.trim())).filter(Boolean);n.length||e.push(`${l}(${r})`)}n=e.join(" ")}t[l]=n.trim()}return t}(e),f=function(e){let t=e.getAttribute("style"),a=t?function(e=""){let t={};if(!e)return t;let a=e.split(";").filter(Boolean).map(e=>e.trim()),l=a.length;if(!l)return t;for(let e=0;l&&e<l;e++){let l=a[e],[r,n]=l.split(":").filter(Boolean);t[r]=n}return t}(t):{};return a}(e),x={...y,...f};delete x.style,u.push("style");let g=["style"];if(n||s||a){let e=Lt(c,x,{removeDefaults:s,removeNameSpaced:a,exclude:u,cleanUpStrokes:i,include:["scale","translate","rotate"],cleanUpStrokes:!1});x=e.propsFiltered,g.push(...e.remove)}let d=[];for(let e in x){let t=x[e];if("d"===e||e.startsWith("data-"))continue;let a={prop:e,values:[]};if(r&&$e.includes(e)){let e=ve(t);if("rgba"===e.mode||"rgb"===e.mode){t=be(e)}}if("transform"===e){let e=[],a=t.split(/(\w+)\(([^)]+)\)/).map(e=>e.trim()).filter(Boolean);for(let t=1;t<a.length;t+=2){let l=a[t-1],r=Pe.includes(l),n=Le.includes(l);r&&(l=l.replace("X","")),n&&(l=l.replace("Y",""));let s=a[t].split(/,| /).filter(Boolean),i={fn:l,values:[]};for(let e=0;e<s.length;e++){let t=$t(s[e]);i.values.push(...t)}let o=l.startsWith("scale")?1:0,u=l.startsWith("scale")?1:0;r&&(i.values=[i.values[0],{value:o,unit:"",numeric:!0}]),n&&(i.values=[{value:u,unit:"",numeric:!0},i.values[0]]),e.push(i)}e.length&&d.push({prop:"transforms",values:e})}else a.values=$t(t);a.values.length&&d.push(a)}let m={transformArr:[],matrix:null,transComponents:null},v=[],b=!1;for(let e=0;e<d.length;e++){let a=d[e],{prop:r,values:n}=a,s=[],o=0,u=0,c="",y="";if("transforms"!==r){if(!i||"stroke-dasharray"!==r&&"stroke-dashoffset"!==r)if("transform-origin"===r)n.forEach((e,t)=>{let a=e.value;"left"===a?n[t].value=0:"right"===a?n[t].value=h:"top"===a?n[t].value=0:"bottom"===a?n[t].value=p:"center"===a&&(n[t].value="50%")}),o=n[0].value,u=n[1]?n[1].value:o,c=n[0].unit,y=n[1]?n[1].unit:c,o=je(o,{unit:c,width:h,height:p,isHorizontal:!0,fontSize:t}),u=je(u,{unit:y,width:h,height:p,isVertical:!0,fontSize:t}),v.push(o,u);else for(let e=0;e<n.length;e++){let a=n[e],i=a.unit,o=a.value,u=a.numeric,c=Se.includes(r),y=Ee.includes(r);i&&("scale"===r&&"%"===i?o*=.01:("r"===r&&(b=!0),o=je(a.value,{unit:i,width:h,height:p,isHorizontal:c,isVertical:y,normalizedDiagonal:b,fontSize:t}),l&&u&&(o=we(o)))),s.push(o)}else{b=!0;for(let e=0;e<n.length;e++){let a=je(n[e].value,{unit:n[e].unit,width:h,height:p,normalizedDiagonal:b,fontSize:t});s.push(a)}}s.length&&(m[r]=s)}else{let e=n||[],a=e.length,l=[];for(let r=0;a&&r<a;r++){let{fn:a,values:n}=e[r],s=[],i="",o="",u=[],c=0,y=0,f={};if("scale"!==a&&"translate"!==a||(c=n[0].value,y=n[1]?n[1].value:c,i=n[0].unit,o=n[1]?n[1].unit:i,"scale"===a?(c="%"===i?.01*c:c,y="%"===o?.01*y:y):(c=je(c,{unit:i,width:h,height:p,isHorizontal:!0,fontSize:t}),y=je(y,{unit:o,width:h,height:p,isVertical:!0,fontSize:t})),s.push(c,y),f[a]=s,u.push(f)),"matrix"===a&&(s=n.map(e=>e.value),f[a]=s,u.push(f)),"skew"===a&&(c=n[0].value,i=n[0].unit,y=n[1].value,o=n[1].unit,c=je(c,{unit:i,isHorizontal:!0,fontSize:t}),y=je(y,{unit:o,isVertical:!0,fontSize:t}),c=c>360?c%360:c,y=y>360?y%360:y,s=[c,y],f[a]=s,u.push(f)),"rotate"===a){let e=n[0].value;e=je(e,{unit:n[0].unit});let t=[];if(3===n.length){let e=n[1].value,a=n[2].value;t.push({translate:[e,a]},{translate:[-e,-a]})}f[a]=[e],t.length?u.push(t[0],f,t[1]):u.push(f)}l.push(...u)}m.transformArr=l}}let M=void 0!==m.translate?{translate:m.translate}:null,A=void 0!==m.scale?{scale:m.scale}:null,w=[M,void 0!==m.rotate?{rotate:m.rotate}:null,A].filter(Boolean);w.length&&(o&&g.push("translate","scale","rotate"),m.transformArr=[...w,...m.transformArr]),v.length&&void 0!==m.transformArr&&(m.transformArr=[{translate:[v[0],v[1]]},...m.transformArr,{translate:[-v[0],-v[1]]}],o&&g.push("transform-origin"));let{transformArr:C=[]}=m,k=[],S=C.length;if(S)for(let e=0;S&&e<S;e++){let t=C[e],a=Object.values(t).flat(),l=Object.keys(t)[0];"skew"===l?(a[0]&&k.push(`skewX(${a[0]})`),a[1]&&k.push(`skewY(${a[1]})`)):k.push(`${l}(${a.join(" ")})`)}return m.remove=g,m.type=c,m}function Pt(e={},t=[]){if(void 0===e.transformArr||!t.length)return;let a=function(e=[]){const t=(e,t)=>({a:e.a*t.a+e.c*t.b,b:e.b*t.a+e.d*t.b,c:e.a*t.c+e.c*t.d,d:e.b*t.c+e.d*t.d,e:e.a*t.e+e.c*t.f+e.e,f:e.b*t.e+e.d*t.f+e.f}),a=(e,t)=>({a:1,b:0,c:0,d:1,e:e,f:t}),l=(e,t)=>({a:e,b:0,c:0,d:t,e:0,f:0}),r=(e,t)=>{let[a,l=0]=e.map(e=>e*w),r={};if("rot"===t){let e=Math.cos(a),t=Math.sin(a);r={a:e,b:t,c:-t,d:e,e:0,f:0}}else if("skew"===t){let e=Math.tan(a);r={a:1,b:Math.tan(l),c:e,d:1,e:0,f:0}}return r};let n={a:1,b:0,c:0,d:1,e:0,f:0};for(let s=0;s<e.length;s++){let i=e[s],o=Object.keys(i)[0],u=i[o],[h,p]=u;switch(o){case"matrix":let e=["a","b","c","d","e","f"],s=Object.fromEntries(e.map((e,t)=>[e,u[t]]));n=t(n,s);break;case"translate":n=t(n,a(h,p));break;case"skew":n=t(n,r([h,p],"skew"));break;case"rotate":n=t(n,r([h],"rot"));break;case"scale":n=t(n,l(h,p));break;default:throw new Error(`Unknown transformation type: ${o}`)}}return n}(t=t.length?t:e.transformArr);e.matrix=a;let l=function(e,t=4){let{a:a,b:l,c:r,d:n,e:s,f:i}=e;Array.isArray(e)&&([a,l,r,n,s,i]=e);let o=Math.atan2(l,a),u=Math.pow(a,2)+Math.pow(l,2),h=Math.sqrt(u),p=(a*n-r*l)/h,c=Math.atan2(a*r+l*n,u)/(Math.PI/180),y={translateX:s||0,translateY:i||0,rotate:o?o/(Math.PI/180):0,scaleX:h,scaleY:p,skewX:c,skewY:0},f=[],x=[];for(let e in y){y[e]=+parseFloat(y[e]).toFixed(t);let a=y[e],l="";"rotate"!=e&&"skewX"!=e||(l="deg"),-1!=e.indexOf("translate")&&(l="px");let r=["scaleX","scaleY","translateX","translateY"];0!==a&&f.push(`${e}(${a}${l})`),-1==r.indexOf(e)&&0!==a?x.push(`${e}(${a})`):"scaleX"==e?x.push(`scale(${+h.toFixed(t)} ${+p.toFixed(t)})`):"translateX"==e&&x.push(`translate(${y.translateX} ${y.translateY})`)}return y.cssTransform=f.join(" "),y.svgTransform=x.join(" "),y.matrix=[a,l,r,n,s,i].map(e=>Ae(e,t)),y.matrixAtt=`matrix(${y.matrix.join(" ")})`,y}(a,3);return e.transComponents=l,e}function Lt(e="",t={},{removeInvalid:a=!0,removeDefaults:l=!0,allowDataAtts:r=!0,cleanUpStrokes:n=!0,include:s=["id","class"],exclude:i=[]}={}){let o={},u=[],h=!!n&&void 0===t.stroke;for(let n in t){let p=t[n],c=Array.isArray(p)?p[0]:p,y=!!a&&(!!qe.atts[n]&&qe.atts[n].includes(e));"transform"===n&&"matrix(1 0 0 1 0 0)"===c&&(y=!1);let f=!!r&&n.startsWith("data-"),x=!!l&&(!!qe.defaults[n]&&(void 0!==qe.defaults[n]&&qe.defaults[n].includes(c)));(f||s.includes(n))&&(y=!0),x&&(y=!1),i.length&&i.includes(n)&&(y=!1),h&&Ie.includes(n)&&(y=!1),y?o[n]=t[n]:u.push(n)}return{propsFiltered:o,remove:u}}function $t(e=""){let t=e.split(/,| /);for(let e=0;e<t.length;e++){let a=t[e],l={value:null,unit:"",numeric:!1},r=Fe(a);if(r){if(r){let e=Ne(a),t=parseFloat(a);l.value=t,l.unit=e,l.numeric=!0}}else l.value=a;t[e]=l}return t}function Dt(e,{removeHidden:t=!0,stylesToAttributes:a=!0,removePrologue:l=!0,removeIds:r=!1,removeClassNames:n=!1,removeDimensions:s=!1,fixHref:i=!1,legacyHref:o=!1,cleanupDefs:u=!0,cleanupClip:h=!0,addViewBox:p=!1,addDimensions:c=!1,minifyRgbColors:y=!1,normalizeTransforms:f=!0,autoRoundValues:x=!0,unGroup:g=!1,mergePaths:d=!1,removeOffCanvas:m=!0,cleanupSVGAtts:v=!0,removeNameSpaced:b=!0,attributesToGroup:M=!0,shapeConvert:A=!1,convert_rects:w=!1,convert_ellipses:C=!1,convert_poly:k=!1,convert_lines:S=!1,convertTransforms:E=!1,removeDefaults:P=!0,cleanUpStrokes:L=!0,decimals:$=-1,excludedEls:D=[]}={}){i&&(e=e.replaceAll("xlink:href=","href="));let T=(new DOMParser).parseFromString(e,"text/html").querySelector("svg"),z=yt(T),{x:I,y:q,width:j,height:N}=z,F={width:j,height:N,normalizeTransforms:f,removeDefaults:!1,cleanUpStrokes:!1,autoRoundValues:x,minifyRgbColors:y},B=Et(T,F);F.fontSize=B["font-size"]?B["font-size"][0]:16;let Q=T.querySelectorAll("g"),R=[];if(Q.forEach(e=>{let t=Et(e,F);R.push(t),e.querySelectorAll(`${Te.join(", ")}`).forEach(e=>{void 0===e.parentStyleProps&&(e.parentStyleProps=[]),e.parentStyleProps.push(t)})}),v){let e=["viewBox","xmlns","width","height","id","class"];a||e.push("fill","stroke","stroke-width","stroke-linecap","stroke-linejoin","font-size","font-family","font-style","style"),function(e,t=["viewBox","xmlns","width","height","id","class"]){[...e.attributes].map(e=>e.name).forEach(a=>{t.includes(a)||e.removeAttribute(a)})}(T,e)}p&&function(e,{x:t=0,y:a=0,width:l=0,height:r=0}={}){if(e.hasAttribute("viewBox"))return;l&&r||({x:t,y:a,width:l,height:r}=yt(e));e.setAttribute("viewBox",[t,a,l,r].join(" "))}(T,{x:I,y:q,width:j,height:N}),c&&(T.setAttribute("width",j),T.setAttribute("height",N)),u&&function(e,{x:t=0,y:a=0,width:l=0,height:r=0,cleanupClip:n=!0}={}){let s=e.querySelectorAll("defs"),i=e.querySelectorAll("symbol, pattern, linearGradient, radialGradient, clipPath, mask, marker, filter");if(!s.length&&!i.length)return;s.forEach(t=>{[...t.children].length?e.insertBefore(t,e.children[0]):t.remove()});let o=new Set([]);i.forEach(e=>{o.add(e.id)}),Array.from(o).forEach(t=>{e.querySelectorAll(`[href="#${t}"], [xlink\\:href="#${t}"], [clip-path="url(#${t})"], [mask="url(#${t})"], [fill="url(#${t})"], [stroke="url(#${t})"]`).length||e.getElementById(t).remove()})}(T,{x:I,y:q,width:j,height:N,cleanupClip:h}),m&&function(e,{x:t=0,y:a=0,width:l=0,height:r=0}={}){let n=[...e.querySelectorAll("path, polygon, polyline, line, rect, circle, ellipse, text")];n=n.filter(e=>!(e.parentNode.closest("defs")||e.parentNode.closest("symbol")||e.parentNode.closest("clipPath")||e.parentNode.closest("mask")||e.parentNode.closest("pattern")));let s={x:t,y:a,width:l,height:r};s.right=t+l,s.bottom=a+r,n.forEach(e=>{let t=function(e){let t=e.nodeName.toLowerCase(),a=Be(e),l={x:0,y:0,width:0,height:0},r=[];switch(t){case"path":l=Qe(Ue(lt(a.d)));break;case"rect":l={x:a.x||0,y:a.y||0,width:a.width,height:a.height};break;case"circle":let e=2*a.r;l={x:a.cx-a.r,y:a.cy-a.r,width:e,height:e};break;case"ellipse":l={x:a.cx-a.rx,y:a.cy-a.ry,width:2*a.rx,height:2*a.ry};break;case"line":r=[{x:a.x1,y:a.y1},{x:a.x2,y:a.y2}],l=Qe(r);break;case"polyline":case"polygon":r=kt(a.points),l=Qe(r)}return l}(e);(t.right<s.x||t.bottom<s.y||t.x>s.right||t.y>t.bottom)&&e.remove()})}(T,{x:I,y:q,width:j,height:N});let O=["metadata","script",...D];!function(e,{remove:t=["metadata","script"],removeNameSpaced:a=!0}={}){let l=e.querySelectorAll("*");l.forEach(e=>{let l=e.nodeName;(a&&l.includes(":")||t.includes(l))&&e.remove()})}(T,{removeEls:O,removeNameSpaced:b});let U=T.querySelectorAll(`${Te.join(", ")}`);for(let e=0;e<U.length;e++){let l=U[e],i=l.nodeName.toLowerCase(),o=l.getAttribute("style")||"",u=!!o&&o.trim().includes("display:none"),h=l.getAttribute("display")&&"none"===l.getAttribute("display")||u;if(i.includes(":")||O.includes(i)||t&&h){l.remove();continue}let p=Et(l,F),{parentStyleProps:c=[]}=l,x={},d=[];c.forEach(e=>{let{transformArr:t=[]}=e;d.push(...t),x={...x,...e}}),d=[...d,...p.transformArr],p.transformArr=d,p={...B,...x,...p},Pt(p,d);let{remove:m,matrix:v,transComponents:b}=p;if(n&&p.remove.push("class"),r&&p.remove.push("id"),s&&(p.remove.push("width"),p.remove.push("height")),(g||E||y)&&(a=!0),a){if(f&&v){let{rotate:e,scaleX:t,scaleY:a,skewX:r,translateX:n,translateY:s}=b;if(!(E||"g"===i||(0!==e||0!==r)||t!==a)&&["circle","ellipse","rect"].includes(i)){if("circle"===i||"ellipse"===i)p.cx[0]=[p.cx[0]*t+n],p.cy[0]=[p.cy[0]*t+s],p.r&&(p.r[0]=[p.r[0]*t]),p.rx&&(p.rx[0]=[p.rx[0]*t]),p.ry&&(p.ry[0]=[p.ry[0]*t]);else if("rect"===i){let e=p.x?p.x[0]+n:n,l=p.y?p.y[0]+s:s,r=p.rx?p.rx[0]*t:0,i=p.ry?p.ry[0]*a:0;p.x=[e],p.y=[l],p.rx=[r],p.ry=[i],p.width=[p.width[0]*t],p.height=[p.height[0]*t]}m.push("transform"),p=Tt(p,{props:["stroke-width","stroke-dasharray"],scale:t})}else l.setAttribute("transform",b.matrixAtt)}let e=Lt(i,p,{removeDefaults:!0,cleanUpStrokes:L});m=[...m,...e.remove];for(let t in e.propsFiltered){let e=p[t],a=e.length?e.join(" "):e[0];l.setAttribute(t,a)}for(let e=0;e<m.length;e++){let t=m[e];(a||"style"!==t)&&l.removeAttribute(t)}g?Q.forEach((e,t)=>{[...e.children].forEach(t=>{e.parentNode.insertBefore(t,e)}),e.remove()}):Q.forEach((e,t)=>{[...Object.keys(R[t]),"style","transform"].forEach(t=>{e.removeAttribute(t)})})}if(E&&(A="toPaths",w=!0,C=!0,k=!0,S=!0),"toPaths"===A){let{matrix:e=null,transComponents:t=null}=p;if(e&&t&&["stroke-width","stroke-dasharray"].forEach(e=>{let a=l.getAttribute(e),r=a?a.split(" ").filter(Boolean).map(Number).map(e=>e*t.scaleX):[];r.length&&l.setAttribute(e,r.join(" "))}),e?De.includes(i):ke.includes(i)){let t=gt(l,{width:j,height:N,convert_rects:w,convert_ellipses:C,convert_poly:k,convert_lines:S,matrix:e});l.replaceWith(t),i="path",l=t}}else if("toShapes"===A){T.querySelectorAll("path").forEach(e=>{let t=xt(e,{convert_rects:w,convert_ellipses:C,convert_poly:k,convert_lines:S});e.replaceWith(t),e=t})}}if(h&&function(e,{x:t=0,y:a=0,width:l=0,height:r=0}={}){let n=e.querySelectorAll("clipPath");if(!n.length)return;l&&r||({x:t,y:a,width:l,height:r}=yt(e));n.forEach(n=>{let s=[...n.children];if(s.length>1)return;let i=s[0],o=i.nodeName.toLowerCase();if("path"===o||"rect"===o){let s={x:0,y:0,width:0,height:0};if("path"===o){let e=lt(i.getAttribute("d")),t=Array.from(new Set(e.map(e=>e.type.toLowerCase()))).join("");if(!!/[acqts]/gi.test(t)||e.length>5)return;s=Qe(W(e))}else"rect"===o&&(s={x:+i.getAttribute("x"),y:+i.getAttribute("y"),width:+i.getAttribute("width"),height:+i.getAttribute("height")});if(s.x===t&&s.y===a&&s.width===l&&s.height===r){n.remove(),e.querySelectorAll(`[clip-path="url(#${n.id})"]`).forEach(e=>{e.removeAttribute("clip-path")})}}})}(T,{x:I,y:q,width:j,height:N}),o){T.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),T.querySelectorAll("[href]").forEach(e=>{let t=e.getAttribute("href");e.setAttribute("xlink:href",t),e.removeAttribute("href")})}return{svg:T,svgElProps:[]}}function Tt(e={},{props:t=[],scale:a=1}={}){if(1===a||!t.length)return t;for(let l=0;l<t.length;l++){let r=t[l];void 0!==e[r]&&(e[r]=e[r].map(e=>e*a))}return e}function zt(e,{threshold:t=0,tolerance:a=1}={}){let l=e.length,r=[e[0]],n="z"===e[l-1].type.toLowerCase(),s=!!n&&(e[l-1].p.x===e[0].p0.x&&e[l-1].p.y===e[0].p0.y),i=n?2:1,o=e[l-i],u="L"===o.type,h="C"===o.type,p="L"===e[1].type,c="C"===e[1].type,y=n&&c&&(u||s);y&&(e[l-1].values=e[0].values,e[l-1].type="L",u=!0);for(let t=1;t<l;t++){let s=e[t],{type:o}=s,f=e[t+1]?e[t+1]:null;if("L"===o&&f&&"C"===f.type||"C"===o&&f&&"L"===f.type){let y="L"===o?s:null,x=null,g=[],d=0;if(1===t&&c&&u&&(g=[e[1]],y=e[l-1],x=f),!y){r.push(s);continue}n&&h&&p&&t===l-i-1&&(x=e[1],g=[e[l-i]]);for(let a=t+1;a<l;a++){let t=e[a]?e[a]:null,l=e[a-1];if("C"===l.type&&g.push(l),"L"===t.type&&"C"===l.type){x=t;break}d++}if(x){let e=pe(y.p0,y.p),l=pe(x.p0,x.p),n=pe(y.p,x.p0),i=_e([y.p0,y.p,x.p0,x.p],!1),o=_e([g[0].p0,g[0].cp1,g[0].cp2,g[0].p],!1),u=i<0&&o>0||i>0&&o<0,h=.5*n*a,p=h<e&&h<l;if(g.length&&!u&&p){let e=Math.abs(o)<.005*he(g[0].p0,g[0].p)?null:H(y.p0,y.p,x.p,x.p0,!1,!0);if(!e){r.push(s);continue}if(e){let t=_e([y.p0,y.p,x.p0,x.p],!1),a=Math.abs(t),l=_e([y.p0,y.p,e,x.p0,x.p],!1),n=Math.abs(l),i=Math.abs(a-n)/a;if(!e||(t<0&&l>0||t>0&&l<0)||i>.5){r.push(s);continue}}let a=.75*pe(Y([y.p,e,x.p0],.5),1===g.length?Y([g[0].p0,g[0].cp1,g[0].cp2,g[0].p],.5):g[0].p);if(h&&a>h&&a>.3*n){r.push(s);continue}{let a={type:"Q",values:[e.x,e.y,x.p0.x,x.p0.y]};a.p0=y.p,a.cp1=e,a.p=x.p0,r.push(y,a),t+=d;continue}}}}y&&t===l-1&&"L"===o||r.push(s)}return(y||n&&"Z"!==r[r.length-1].type)&&r.push({type:"Z",values:[]}),r}function It(e){if(e.length<3)return!1;let t=e[0],a=e[Math.floor(e.length/2)],l=e[e.length-1],r=t.x,n=t.y,s=a.x,i=a.y,o=l.x,u=l.y,h=r-s,p=n-i,c=r-o,y=n-u,f=(r*r-s*s+(n*n-i*i))/2,x=(r*r-o*o+(n*n-u*u))/2,g=h*y-p*c;if(Math.abs(g)<1e-10)return console.warn("Points are collinear or numerically unstable"),!1;let d={x:(y*f-p*x)/g,y:(-c*f+h*x)/g},m=ue(d,t),v=G(d,t,l),{deltaAngle:b,startAngle:M,endAngle:A}=v;return{centroid:d,r:m,startAngle:M,endAngle:A,deltaAngle:b}}function qt(e,{threshold:a=0,tolerance:l=1,toCubic:r=!1,debug:n=!1}={}){let s=e.length,i=[e[0]],o=[];for(let a=1;a<s;a++){let l=e[a],{type:s}=l,u=e[a-1],h=e[a+1]?e[a+1]:null,p=e[a+2]?e[a+2]:null,c=e[a+3]?e[a+3]:null,y=null;"C"===l.type||"Q"===l.type?y=l:!h||"C"!==h.type&&"Q"!==h.type||(y=h);let f,x,g,d,m,v=y?"C"===y.type?[y.p0,y.cp1,y.cp2,y.p]:[y.p0,y.cp1,y.p]:[],b=0,M=0,A=!1,w=!1,C=[];if("L"===u.type&&"L"===s&&y&&"L"===p.type&&c&&("L"===c.type||"Z"===c.type)?(f=[l.p0,l.p],x=[p.p0,p.p],g=l.p0,d=p.p,b=_e(v,!1),M=_e([...f,...x],!1),A=b<0&&M>0||b>0&&M<0,A||(m=Y(v,.5),C=[g,m,d],w=!0)):"C"!==s&&"Q"!==s||"L"!==u.type||"C"!==h.type&&"Q"!==h.type||"L"!==p.type||(w=!0,f=[u.p0,u.p],x=[p.p0,p.p],g=u.p,d=p.p0,m=y.p,C=[g,y.p,d]),w){let e=It(C);if(e){let s,{centroid:u,r:h,deltaAngle:p,startAngle:c,endAngle:y}=e,f=0,x=p>0?1:0,v=Math.abs(p)>Math.PI?1:0;if(ce(K(g,u.x,u.y,.5*p),m)<.05*ce(g,d)){if(s=ut({p0:g,p:d,centroid:u,rx:h,ry:h,xAxisRotation:f,sweep:x,largeArc:v,deltaAngle:p,startAngle:c,endAngle:y}),1===s.length){let e=nt(g,s[0].cp1,s[0].cp2,d);"Q"===e.type&&(r=!0),l=e}if(s.length>1&&(r=!1),r||(l.type="A",l.values=[h,h,f,v,x,d.x,d.y]),l.p0=g,l.p=d,l.extreme=!1,l.corner=!1,n){o=r?[{type:"M",values:[g.x,g.y]},...s]:[{type:"M",values:[g.x,g.y]},{type:"A",values:[h,h,f,v,x,d.x,d.y]}];let e=Ge(o);t(markers,e,"orange","0.5%","0.5")}i.push(l),a++;continue}}}i.push(l)}return i}function jt(e=[],{threshold:t=0}={}){let a=e.length,l="z"===e[a-1].type.toLowerCase(),r=l?a-2:a-1,n=e[r],s=n.values.slice(-2),i={x:e[0].values[0],y:e[0].values[1]},o=ce(i,{x:s[0],y:s[1]});if(o&&o<t){let a=e[r].values.length;e[r].values[a-2]=i.x,e[r].values[a-1]=i.y;let l=e[1];if("C"===l.type&&"C"===n.type){let a=Math.abs(l.values[0]-n.values[2]),s=Math.abs(l.values[1]-n.values[3]),o=Math.abs(e[1].values[0]-l.values[0]),u=Math.abs(e[1].values[1]-l.values[1]),h=Math.abs(e[1].values[0]-n.values[2]),p=Math.abs(e[1].values[1]-n.values[3]),c=u<t&&p<t&&a;a&&a<t&&(o<t&&h<t&&s)&&(e[1].values[0]=i.x,e[r].values[2]=i.x),s&&s<t&&c&&(e[1].values[1]=i.y,e[r].values[3]=i.y)}}return e}function Nt(e,t=1){let a=[];for(let l=0,r=e.length;l<r;l++){let r=e[l],{type:n,values:s}=r,i={type:n,values:[]};switch(n.toLowerCase()){case"h":case"v":i.values=[s[0]*t];break;case"a":i.values=[s[0]*t,s[1]*t,s[2],s[3],s[4],s[5]*t,s[6]*t];break;default:s.length&&(i.values=s.map((e,a)=>e*t))}a.push(i)}return a}function Ft(e,t=1){for(let a=1,l=e.length;a<l;a++){let l=e[a],{type:r,values:n,p0:s,cp1:i=null,cp2:o=null,p:u=null}=l;if("C"===r){let r=nt(s,i,o,u,t);"Q"===r.type&&(r.extreme=l.extreme,r.corner=l.corner,r.dimA=l.dimA,r.squareDist=l.squareDist,e[a]=r)}}return e}function Bt(e,{quality:t=.9,width:a=0,height:l=0}={}){let r=!1;if("string"==typeof t&&(r=!0,t=parseFloat(t)),e.length<4||(!r&&t)>=1)return e;let n=t;if(!r){if(n=1-t,t>.5&&(n/=2),!a&&!l){let t=ye(e,12);({width:a,height:l}=Qe(t))}n=(n*((a+l)/2/100))**2}const s=(e,t,a)=>{let l=t.x,r=t.y,n=a.x-l,s=a.y-r;if(0!==n||0!==s){let t=((e.x-l)*n+(e.y-r)*s)/(n*n+s*s);t>1?(l=a.x,r=a.y):t>0&&(l+=n*t,r+=s*t)}return(e.x-l)**2+(e.y-r)**2};let i=[e[0]],o=[];for(o.push([0,e.length-1]);o.length>0;){let[t,a]=o.pop(),l=n,r=-1;for(let n=t+1;n<a;n++){let i=s(e[n],e[t],e[a]);i>l&&(r=n,l=i)}l>n?(o.push([r,a]),o.push([t,r])):i.push(e[a])}return i}function Qt(e,{quality:t=.9,width:a=0,height:l=0}={}){let r=!1;if("string"==typeof t){r=!0,t=parseFloat(t)}if(e.length<4||(!r&&t)>=1)return e;let n,s=e[0],i=[s],o=t;if(!r){if(o=1-t,!a&&!l){let t=ye(e,12);({width:a,height:l}=Qe(t))}o=(o*((a+l)/2/25))**2,t>.5&&(o/=10)}for(let t=1,a=e.length;t<a;t++){n=e[t],he(s,n)>o&&(i.push(n),s=n)}return s.x!==n.x&&s.y!==n.y&&i.push(n),i}function Rt(e,t=!0){let a=[],l=[];return Array.isArray(e[0])?e.forEach(e=>{l=[{type:"M",values:[e[0].x,e[0].y]},...e.slice(1).map(e=>({type:"L",values:[e.x,e.y]}))],a.push(...l)}):a=[{type:"M",values:[e[0].x,e[0].y]},...e.slice(1).map(e=>({type:"L",values:[e.x,e.y]}))],t&&a.push({type:"Z",values:[]}),a}function Ot(e,{maxError:t=0,adjustCpts:a=!0,harmonize:l=!0,keepCorners:r=!0}={}){if(1===e.length)return[];if(2===e.length)return[{type:"L",values:[e[0].x,e[0].y]},{type:"L",values:[e[1].x,e[1].y]}];let n=e.length,s=function(e=[]){let t=[];return e.forEach(e=>{let a=4===e.length?"C":3===e.length?"Q":"L",l="C"===a||"Q"===a?e[1]:null,r="C"===a?e[2]:null,n=e[e.length-1],s={type:a,values:"C"===a?[l.x,l.y,r.x,r.y,n.x,n.y]:"Q"===a?[l.x,l.y,n.x,n.y]:[n.x,n.y]};t.push(s)}),t}(Ut(e,Ht(e[1],e[0]),Ht(e[n-2],e[n-1]),t,r));return s}function Ut(e,t,a,l,r=!1){let n,s=function(e){let t=[],a=e.length,l=e[0],r=e[1],n=0,s=0;for(let i=0;i<a;i++)r=e[i],n=s+ue(r,l,!1),t.push(n),s=n,l=r;return t=t.map(function(e){return e/s}),t}(e),i=Vt(e,s,s,t,a);n=i[0];let o=i[1],u=i[2];if(r){let t=function(e,t){let a,l=4,r=1/l,n=e.length,s=[t[0]];for(let e=1;e<l;e++){a=Y(t,r*e),s.push(a)}s.push(t[t.length-1]);let i=_e(e,!1);i||2!==e.length||(i=.01*he(e[0],e[1]));let o=_e(s,!1)/i>1.1,u=t;if(o){let a=e[Math.floor(.5*n)],l=e[n-1];u=t=[e[0],a,a,l]}return{isBulged:o,bezierNew:u}}(e,n),{isBulged:a,bezierNew:l}=t;a&&(n=l)}if(0===o||o<l)return[n];if(o<l*l){let r=s,i=o,h=u;for(let p=0;p<20;p++){r=_t(n,e,r);let p=Vt(e,s,r,t,a);if(n=p[0],o=p[1],u=p[2],o<l)return[n];if(u===h){let e=o/i;if(e>.9999&&e<1.0001)break}i=o,h=u}}let h=[],p=Xt(e[u-1],e[u+1]);if(0===p.x&&0===p.y){p=Xt(e[u-1],e[u]);let t={x:-p.y,y:p.x};p.x=t.x,p.y=t.y}let c=function(e){let t=Math.sqrt(e.x*e.x+e.y*e.y);return 0===t?{x:0,y:0}:{x:e.x/t,y:e.y/t}}(p),y=Yt(c,-1);return e.length,h.push(...Ut(e.slice(0,u+1),t,c,l,r),...Ut(e.slice(u),y,a,l,r)),h}function Vt(e,t,a,l,r){let n,s,i;n=function(e,t,a,l){let r,n,s,i,o=e[0],u=e[e.length-1],h=[o,null,null,u],p=function(e){let t=[];for(;e--;)t.push([0,0]);return t}(t.length),c=t.length;for(let e=0;e<c;e++)s=t[e],i=1-s,r=p[e],r[0]=Yt(a,3*s*(i*i)),r[1]=Yt(l,3*i*(s*s));let y=[[0,0],[0,0]],f=[0,0],x=e.length;for(let a=0;a<x;a++)s=t[a],r=p[a],y[0][0]+=Wt(r[0],r[0]),y[0][1]+=Wt(r[0],r[1]),y[1][0]+=Wt(r[0],r[1]),y[1][1]+=Wt(r[1],r[1]),n=Xt(e[a],Y([o,o,u,u],s)),f[0]+=Wt(r[0],n),f[1]+=Wt(r[1],n);let g=y[0][0]*y[1][1]-y[1][0]*y[0][1],d=y[0][0]*f[1]-y[1][0]*f[0],m=f[0]*y[1][1]-f[1]*y[0][1],v=0===g?0:m/g,b=0===g?0:d/g,M=ue(o,u,!1),A=1e-6*M;return v<A||b<A?(h[1]=Zt(o,Yt(a,.333*M)),h[2]=Zt(u,Yt(l,.333*M))):(h[1]=Zt(o,Yt(a,v)),h[2]=Zt(u,Yt(l,b))),h}(e,a,l,r);let o=function(e,t,a){let l,r,n,s,i,o;r=0,n=Math.floor(.5*e.length);let u=function(e,t){let a,l=[0],r=e[0],n=0;for(let s=1;s<=t;s++)a=Y(e,s/t),n+=ue(a,r),l.push(n),r=a;return l=l.map(e=>e/n),l}(t,10),h=e.length,p=null;for(s=0;s<h;s++)i=e[s],o=Gt(a[s],u,10),p=Y(t,o),l=he(p,i),l>r&&(r=l,n=s);return[r,n]}(e,n,t);return s=o[0],i=o[1],[n,s,i]}function _t(e,t,a){return a.map((a,l)=>function(e,t,a){let l=Y(e,a),r=l.x-t.x,n=l.y-t.y,s=Jt(e,a),i=r*s[0]+n*s[1],o=s[0]*s[0]+s[1]*s[1],u=Jt(e,a,!0),h=2*(r*u[0]+n*u[1]),p=o+h;if(Math.abs(p)<1e-10)return a;return a-i/p}(e,t[l],a))}function Gt(e,t,a){if(e<0)return 0;if(e>1)return 1;let l,r,n,s,i;for(let o=1;o<=a;o++)if(e<=t[o]){s=(o-1)/a,n=o/a,r=t[o-1],l=t[o],i=(e-r)/(l-r)*(n-s)+s;break}return i}function Ht(e,t){let a=e.x-t.x,l=e.y-t.y,r=Math.sqrt(a*a+l*l);return 0===r?{x:0,y:0}:{x:a/r,y:l/r}}function Xt(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Zt(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Yt(e,t){return{x:e.x*t,y:e.y*t}}function Wt(e,t){return e.x*t.x+e.y*t.y}function Jt(e,t,a=!1){let l,r,n=e[0],s=e[1],i=e[2],o=e[3],u=t,h=1-u,p=h*h,c=u*u;return a?(l=6*h*(i.x-2*s.x+n.x)+6*u*(o.x-2*i.x+s.x),r=6*h*(i.y-2*s.y+n.y)+6*u*(o.y-2*i.y+s.y)):(l=3*p*(s.x-n.x)+6*h*u*(i.x-s.x)+3*c*(o.x-i.x),r=3*p*(s.y-n.y)+6*h*u*(i.y-s.y)+3*c*(o.y-i.y)),[l,r]}function Kt(e,{debug:t=!1,width:a=0,height:l=0,denoise:r=.9,keepCorners:n=!0,keepExtremes:s=!0,keepInflections:i=!1,manhattan:o=!1,absolute:u=!1,closed:h=!0,tolerance:p=1,simplifyRD:c=1,simplifyRDP:y=1}={}){let f=s||n?function(e,{x:t=0,y:a=0,width:l=0,height:r=0,debug:n=!1}={}){let s=e.length,i=Qe(e);l&&r||({x:t,y:a,width:l,height:r}=i);let o=.01*(l+r);for(let t=0;t<s;t++){let a=t>0?e[t-1]:e[s-1],l=e[t],r=_e([a,l,t<s-1?e[t+1]:e[s-1]],!1);l.area=r,l.dist=pe(a,l),l.idx=t}for(let t=0;t<s;t++){t>1?e[t-2]:e[s-1];let a=t>0?e[t-1]:e[s-1],l=e[t],r=t<s-1?e[t+1]:e[s-1];he(a,r),Math.abs(a.area);let n=Math.abs(l.area);Math.abs(r.area);let u=!1,h=!l.area||n<o;pe(l,a);let p=!1;l.x!==i.left&&l.x!==i.right&&l.y!==i.top&&l.y!==i.bottom||(p=!0);let c=l.y===a.y&&l.x!==a.x,y=l.x===a.x&&l.y!==a.y;(c||y)&&(a.isExtreme=!0,p=!0);let f=Qe([a,r]),{left:x,right:g,top:d,bottom:m}=f,v=l.x<x||l.x>g||l.y<d||l.y>m;!p&&v&&(p=!0);let b=(a.area<0&&l.area>0||a.area>0&&l.area<0)&&!h&&!a.isDirChange;if(p){let e=G(l,r,a),{deltaAngleDeg:t}=e;t=Math.abs(t),t>10&&t<160&&(u=!0)}l.isCorner=u,l.isExtreme=p,l.isHorizontal=c,l.isVertical=y,l.isDirChange=b}let u=[],h=[];for(let t=0;t<e.length;t++){let a=e[t],l=e[t+1]||null,r=e[t+2]||null,n=[];if(l&&l.isExtreme&&a.isExtreme&&!a.isCorner){let e=l.dist<2*o&&!l.isCorner,s=r&&r.isExtreme&&r.dist<2*o&&!r.isCorner;if(e&&!s?n.push(a,l):s&&n.push(a,l,r),n.length){let e=n.reduce((e,t)=>e+t.x,0)/n.length,l=n.reduce((e,t)=>e+t.y,0)/n.length;a.x=e,a.y=l,t+=n.length-1}}(a.isExtreme||a.isCorner||a.isDirChange)&&h.push(u.length),u.push(a);let s=u.length,i=u[0],p=u[s-1],c=pe(i,p)<2*o;i.isExtreme&&p.isExtreme&&c&&(p.x=i.x,p.y=i.y)}return u}(e,{debug:!1}):e,x=s||n?function(e,{closed:t=!0,keepCorners:a=!0,keepExtremes:l=!0,keepInflections:r=!1}={}){let n=[[e[0]]],s=0,i=n[s],o=e.length;for(let t=1;t<o;t++){t>0?e[t]:e[o-1];let r=e[t];t<o-1?e[t+1]:e[o-1],(l&&r.isExtreme||a&&r.isCorner)&&(s++,n.push([])),i=n[s],i.push(r)}return n}(f,{keepCorners:n,keepExtremes:s,keepInflections:i}):[f],g=function(e=[],{closed:t=!0,keepCorners:a=!0,tolerance:l=1}={}){let r=e.length,n=[{type:"M",values:[e[0][0].x,e[0][0].y]}];for(let t=0;t<r;t++){let r=e[t],s=e[t+1]?e[t+1]:null,i=[],o=r.length;r[r.length-1],s&&r.push(s[0]),o<2||2===o&&r[1].isExtreme?(r[r.length-1],i=r.map(e=>({type:"L",values:[e.x,e.y]}))):i=Ot(r,{maxError:l,keepCorners:a}),n.push(...i)}t&&n.push({type:"Z",values:[]});return n}(x,{closed:h,tolerance:a&&l?(a+l)/2*.004*p:2.5,keepCorners:n});return g}function ea(e,{precisionPoly:t=1,autoAccuracy:a=!1,polyFormat:l="points",decimals:r=-1,simplifyRD:n=1,simplifyRDP:s=1}={}){let i=e.length,o=[],u=[{x:e[0].values[0],y:e[0].values[1]}],h=[];for(let t=1;t<i;t++){let a=e[t],{type:l,values:r,p0:n,p:s,dimA:i=0}=a;h.push(+i.toFixed(8)),u.push(s)}let p=[u[0]];h=h.filter(Boolean).sort();let c=h[h.length-1];t*=c>2&&c<25?1:20/c;for(let a=1;a<i;a++){let l=e[a],{type:r,values:n,p0:s,p:i,cp1:o=null,cp2:u=null,dimA:h}=l,c=h,y=o&&u?[s,o,u,i]:o?[s,o,i]:[];if(y.length){let e=u?Z(o,u,.5):o;c=.2*(pe(s,e)+pe(i,e))+h}let f=Math.ceil(.2*c*t),x=Math.ceil(f);if(x&&y.length){let e=x?1/(x+1):0;for(let t=1;t<=x;t++){let a=Y(y,e*t);p.push(a)}}p.push(i)}n>0&&(p=Qt(p,{quality:n+"px"})),s>0&&(p=Bt(p,{quality:s+"px"})),o=Rt(p),e=o,a&&(r=function(e){let t=[];for(let a=1,l=e.length;a<l;a++){let l=e[a],{p0:r=null,p:n=null,dimA:s=0}=l;n&&r&&(s=s||pe(r,n),s&&t.push(s))}let a=t.sort(),l=Math.ceil(a.length/8);a=a.slice(0,l);let r=a.reduce((e,t)=>e+t,0)/l,n=r>112.5?0:Math.floor(75/r).toString().length;return Math.min(Math.max(0,n),8)}(u));let y=r>-1?p.map(e=>({x:Ae(e.x,r),y:Ae(e.y,r)})):p.map(e=>({x:e.x,y:e.y}));return"array"===l?y=y.map(e=>[e.x,e.y]):"string"===l&&(y=y.map(e=>[e.x,e.y].join(",")).flat().join(" ")),{pathData:e,poly:y}}function ta(e){for(let t=1,a=e.length;t<a;t++){let a=e[t],{type:l,values:r,p0:n,cp1:s=null,cp2:i=null,p:o=null}=a;if("L"===l){let a=Z(n,o,.333),l=Z(o,n,.333);e[t].type="C",e[t].values=[a.x,a.y,l.x,l.y,o.x,o.y],e[t].cp1=a,e[t].cp2=l}}return e}function aa(e=[],t=!1){let a=[];e.forEach((e,t)=>{let l=function(e=[],{precision:t=1}={}){let a=[];for(let t=0;t<e.length;t++){let l=e[t],r=t>0?e[t-1]:e[t],{type:n,values:s}=l,i={x:r.values[r.values.length-2],y:r.values[r.values.length-1]},o=s.length?{x:s[s.length-2],y:s[s.length-1]}:"",u=s.length?{x:s[0],y:s[1]}:"";switch(n){case"A":ht(i,s).forEach(e=>{let t=e.values,l={x:t[0],y:t[1]},r={x:t[2],y:t[3]},n={x:t[4],y:t[5]};a.push(l,r,n)});break;case"C":let e={x:s[2],y:s[3]};a.push(u,e);break;case"Q":a.push(u)}"z"!==n.toLowerCase()&&a.push(o)}return a}(e.pathData),r=_e(l)>=0;a.push({pts:l,bb:Qe(l),cw:r,index:t,inter:0,includes:[],includedIn:[]})});let l=a.length;for(let e=0;e<l;e++){let t=a[e],r=t.bb;for(let n=0;n<l;n++){let l=a[n],s=l.bb;e===n||l.includes.includes(e)||X({x:s.left+s.width/2,y:s.top+s.height/2},t.pts,r)&&(a[n].inter+=1,l.includedIn.push(e),t.includes.push(n))}}for(let r=0;r<l;r++){let l=a[r],{cw:n,includedIn:s,includes:i}=l;(!s.length&&n&&!t||!s.length&&!n&&t)&&(e[r].pathData=wt(e[r].pathData),a[r].cw=!a[r].cw,n=a[r].cw);for(let t=0;t<i.length;t++){let l=i[t];a[l].cw===n&&(e[l].pathData=wt(e[l].pathData),a[l].cw=!a[l].cw)}}return e}function la(e="",{getObject:t=!1,toAbsolute:a=!1,toRelative:l=!0,toShorthands:r=!0,toLonghands:n=!1,quadraticToCubic:s=!0,arcToCubic:i=!1,cubicToArc:o=!1,simplifyBezier:u=!0,optimizeOrder:h=!0,autoClose:p=!1,removeZeroLength:c=!0,refineClosing:y=!0,removeColinear:f=!0,flatBezierToLinetos:x=!0,revertToQuadratics:g=!0,refineExtremes:d=!0,simplifyCorners:m=!1,removeDimensions:v=!1,removeIds:b=!1,removeClassNames:M=!1,omitNamespace:A=!1,fixDirections:w=!1,keepExtremes:C=!0,keepCorners:k=!0,extrapolateDominant:S=!0,keepInflections:E=!1,addExtremes:P=!1,addSemiExtremes:L=!1,toPolygon:$=!1,smoothPoly:D=!1,polyFormat:T="points",precisionPoly:z=1,simplifyRD:I=1,simplifyRDP:q=1,harmonizeCpts:j=!1,removeOrphanSubpaths:N=!1,simplifyRound:F=!1,scale:B=1,scaleTo:Q=0,crop:R=!1,alignToOrigin:O=!1,convertTransforms:U=!1,decimals:V=3,autoAccuracy:_=!0,minifyD:G=0,tolerance:H=1,reversePath:X=!1,minifyRgbColors:Z=!1,removePrologue:Y=!0,removeHidden:J=!0,removeUnused:K=!0,cleanupDefs:ee=!0,cleanupClip:te=!0,cleanupSVGAtts:ae=!0,stylesToAttributes:le=!1,fixHref:re=!1,legacyHref:ne=!1,removeNameSpaced:se=!0,removeOffCanvas:ie=!1,unGroup:oe=!1,mergePaths:ue=!1,shapesToPaths:he=!1,shapeConvert:pe=0,convert_rects:ce=!1,convert_ellipses:ye=!1,convert_poly:fe=!1,convert_lines:ge=!1,lineToCubic:de=!1,cleanUpStrokes:ve=!0,addViewBox:be=!1,addDimensions:Ae=!1,removeComments:we=!0}={}){H=Math.max(.1,H),B=Math.max(.001,B);let Ce=function(e){let t="string";if(Array.isArray(e)){if(Array.isArray(e[0])){if(2===e[0].length)return"polyArray";if(Array.isArray(e[0][0])&&2===e[0][0].length)return"polyComplexArray";if(void 0!==e[0][0].x&&void 0!==e[0][0].y)return"polyComplexObjectArray"}else{if(void 0!==e[0].x&&void 0!==e[0].y)return"polyObjectArray";if(e[0]?.type&&e[0]?.values)return"pathData"}return"array"}if("string"==typeof e){let a=(e=e.trim()).includes("<svg")&&e.includes("</svg"),l=e.startsWith("M")||e.startsWith("m"),r=!isNaN(e.substring(0,1))&&!isNaN(e.substring(e.length-1,e.length));if(a)t="svgMarkup";else if(l)t="pathDataString";else if(r)t="polyString";else{let a=/^(file:|https?:\/\/|\/|\.\/|\.\.\/)/.test(e),l=e.startsWith("data:image");t=a||l?"url":"string"}return t}return t=typeof e,(e.constructor.name||t).toLowerCase()}(e),ke="",Se=0,Ee=0,Pe=0,Le={},$e="",De="svgMarkup"===Ce?1:0,Te=[],ze=[],Ie=[],qe="";Se=e.length;let je={x:0,y:0,width:0,height:0},Ne={x:0,y:0,width:0,height:0},Fe=[],Be=[];i=!!$||i;let Re=[];if("svgMarkup"!==Ce){if("pathDataString"===Ce)$e=e;else if("polyString"===Ce)$e="M"+e;else if("polyArray"===Ce||"polyObjectArray"===Ce||"polyComplexArray"===Ce||"polyComplexObjectArray"===Ce){$e=Rt(kt(e)),qe=$e.map(e=>`${e.type} ${e.values.join(" ")}`).join(" "),Se=qe.length}else"pathData"===Ce&&($e=e,qe=Array.from($e).map(e=>`${e.type} ${e.values.join(" ")}`).join(" "),Se=qe.length);ze.push({d:$e,el:null})}else{he&&(pe=!0,ce=!0,ye=!0,fe=!0,ge=!0),ke=Dt(e,{removeIds:b,removeClassNames:M,removeDimensions:v,cleanupSVGAtts:ae,cleanUpStrokes:ve,removeHidden:J,removeUnused:K,removeNameSpaced:se,stylesToAttributes:le,removePrologue:Y,fixHref:re,mergePaths:ue,convertTransforms:U,legacyHref:ne,cleanupDefs:ee,cleanupClip:te,addViewBox:be,removeOffCanvas:ie,addDimensions:Ae,shapeConvert:pe,convert_rects:ce,convert_ellipses:ye,convert_poly:fe,convert_lines:ge,minifyRgbColors:Z,unGroup:oe,convertTransforms:U}).svg,ke.querySelectorAll("path").forEach((e,t)=>{ze.push({d:e.getAttribute("d"),el:e,idx:t})}),je=yt(ke,V)}let Oe={toRelative:l,toAbsolute:a,toLonghands:n,toShorthands:r,decimals:V},Ue=[];for(let e=0,t=ze.length;t&&e<t;e++){let t=[],a=ze[e],{d:l,el:r}=a,n=lt(l,{quadraticToCubic:s,arcToCubic:i}),p=D||$?Qe(W(n)):null;if(1!==B||Q){if(Q)if(je.width&&!R)B=Q/je.width;else{let e=n.map(e=>({type:e.type,values:e.values}));e=rt(e,{arcToCubic:!0}),e=me(e);let t=Qe(W(e));Fe.push(t.x,t.x+t.width),Be.push(t.y,t.y+t.height);let a=Q/t.width;B=a}n=Nt(n,B)}let v=n.length;N&&(n=mt(n));let b=xe(n),M=b.length;for(let e=0;e<M;e++){let a=b[e],l=[],r=Array.from(new Set(a.map(e=>e.type))).join(""),n=!/[acqts]/gi.test(r),s=/[z]/gi.test(r);if(n)l=W(a),I>0&&(l=Qt(l,{quality:I+"px"})),q>0&&(l=Bt(l,{quality:q+"px"})),a=Rt(l,s);else if($){u=!1,D=!1;let e=We(a),{bb:t,pathData:l}=e;a=l;let r=ea(a,{precisionPoly:z,autoAccuracy:_,polyFormat:T,decimals:V,simplifyRD:I,simplifyRDP:q});Ie.push(r.poly),a=r.pathData}if(D&&n){a=vt(a),a=Kt(W(a),{denoise:.8,tolerance:H,width:p.width,height:p.height,manhattan:!1,absolute:!1,keepCorners:k,keepExtremes:C,keepInflections:E,closed:s,simplifyRD:I,simplifyRDP:q})}(f||c)&&(a=vt(a)),h&&(a=bt(a)),f&&(a=dt(a,{tolerance:H,flatBezierToLinetos:!1})),(P||L)&&(a=me(a,{tMin:0,tMax:1,addExtremes:P,addSemiExtremes:L,angles:[30]})),X&&(a=wt(a));let v=We(a,{detectSemiExtremes:L}),{pathData:M,bb:A,dimA:w}=v;if(Fe.push(A.x,A.x+A.width),Be.push(A.y,A.y+A.height),y&&(M=jt(M,{threshold:.001*w})),M=u?Xe(M,{simplifyBezier:u,keepInflections:E,keepExtremes:C,keepCorners:k,extrapolateDominant:S,revertToQuadratics:g,tolerance:H}):M,d){M=Ct(M,{threshold:.05*(A.width+A.height),tolerance:H})}if(!i&&o&&(M=pt(M,{areaThreshold:2.5})),f&&x&&(M=dt(M,{tolerance:H,flatBezierToLinetos:x})),m){M=zt(M,{threshold:.1*(A.width+A.height),tolerance:H})}if(F&&(M=qt(M)),g&&(M=Ft(M,H)),de&&(M=ta(M)),h&&(M=Mt(M,{autoClose:false})),_){let e=Me(M);Re.push(e)}t.push({pathData:M,bb:A})}let A=Math.min(...Fe),j=Math.min(...Be);Ne={x:A,y:j,width:Math.max(...Fe)-A,height:Math.max(...Be)-j};let U=Ne.height>Ne.width;if(h&&(t=U?t.sort((e,t)=>e.bb.y-t.bb.y||e.bb.x-t.bb.x):t.sort((e,t)=>e.bb.x-t.bb.x||e.bb.y-t.bb.y)),w&&(t=aa(t)),n=[],Te.push(t),t.forEach(e=>{n.push(...e.pathData)}),_){Re=Re.sort().reverse();let e=Re[Math.floor(.5*Re.length)];V=Math.floor(.5*(Re[0]+e)),Oe.decimals=V}if(ue=!1,r&&ue)Ue.push(...n);else{n=JSON.parse(JSON.stringify(n)),n=rt(n,Oe),c&&(n=vt(n)),O&&(n[0].values[0]=(n[0].values[0]-Ne.x).toFixed(V),n[0].values[1]=(n[0].values[1]-Ne.y).toFixed(V),Ne.x=0,Ne.y=0);let e=n.length,t=Ge(n,G);Ee=t.length,Pe=+(100/Se*Ee).toFixed(2),a.d=t,a.report={original:v,new:e,saved:v-e,compression:Pe,decimals:V},r&&r.setAttribute("d",t)}}if(De){if(Ue.length){let e=rt(Ue,Oe);e=vt(e);let t=Ge(e,G);ze[0].el.setAttribute("d",t);for(let e=1;e<ze.length;e++){let t=ze[e].el;t&&t.remove()}!function(e){e.querySelectorAll("g, defs").forEach(e=>{e.children.length||e.remove()})}(ke)}if(B){let{x:e,y:t,width:a,height:l,w:r,h:n,hasViewBox:s,hasWidth:i,hasHeight:o,widthUnit:u,heightUnit:h}=je;R&&(e=Ne.x,t=Ne.y,a=Ne.width,l=Ne.height,r=a,n=l),s&&ke.setAttribute("viewBox",[e,t,a,l].map(e=>+(e*B).toFixed(V)).join(" ")),i&&ke.setAttribute("width",+(r*B).toFixed(V)+u),o&&ke.setAttribute("height",+(n*B).toFixed(V)+h)}if(w){ke.querySelectorAll("path[fill-rule], path[clip-rule]").forEach(e=>{e.removeAttribute("fill-rule"),e.removeAttribute("clip-rule")})}ke=function(e,{omitNamespace:t=!1,removeComments:a=!0}={}){let l=(new XMLSerializer).serializeToString(e);return t&&(l=l.replaceAll('xmlns="http://www.w3.org/2000/svg"',"")),a&&(l=l.replace(/(<!--.*?-->)|(<!--[\S\s]+?-->)|(<!--[\S\s]*?$)/g,"")),l=l.replace(/\t/g,"").replace(/[\n\r|]/g,"\n").replace(/\n\s*\n/g,"\n").replace(/ +/g," ").replace(/> </g,"><").trim().replaceAll("&#10;","\n"),l}(ke,{omitNamespace:A,removeComments:we}),Ee=ke.length,Pe=+(100/Se*Ee).toFixed(2),Se=+(Se/1024).toFixed(3),Ee=+(Ee/1024).toFixed(3),Le={svgSize:Se,svgSizeOpt:Ee,compression:Pe,decimals:V}}else({d:$e,report:Le}=ze[0]);return Ie.length&&1===Ie.length&&(Ie=Ie[0]),t?{svg:ke,d:$e,polys:Ie,report:Le,pathDataPlusArr:Te,inputType:Ce}:$e||ke}"undefined"!=typeof window&&(window.svgPathSimplify=la,window.getElementTransform=fe,window.getViewBox=yt);export{M as PI,a as abs,l as acos,r as asin,n as atan,s as atan2,i as ceil,o as cos,u as exp,h as floor,fe as getElementTransform,yt as getViewBox,c as hypot,p as log,y as max,f as min,x as pow,g as random,d as round,m as sin,v as sqrt,la as svgPathSimplify,b as tan};