svg-path-simplify 0.4.2 → 0.4.3
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.
- package/CHANGELOG.md +10 -0
- package/README.md +6 -4
- package/dist/svg-path-simplify.esm.js +2139 -940
- package/dist/svg-path-simplify.esm.min.js +2 -2
- package/dist/svg-path-simplify.js +2139 -940
- package/dist/svg-path-simplify.min.js +2 -2
- package/dist/svg-path-simplify.pathdata.esm.js +127 -85
- package/dist/svg-path-simplify.pathdata.esm.min.js +2 -2
- package/docs/privacy-webapp.md +24 -0
- package/index.html +290 -152
- package/package.json +1 -1
- package/src/css_parse.js +317 -0
- package/src/detect_input.js +34 -4
- package/src/pathData_simplify_harmonize_cpts.js +77 -1
- package/src/pathSimplify-main.js +242 -269
- package/src/pathSimplify-presets.js +243 -0
- package/src/poly-fit-curve-schneider.js +14 -7
- package/src/simplify_poly_RC.js +102 -0
- package/src/simplify_poly_RDP.js +109 -1
- package/src/simplify_poly_radial_distance.js +3 -3
- package/src/string_helpers.js +130 -4
- package/src/svgii/geometry.js +182 -3
- package/src/svgii/geometry_length.js +237 -0
- package/src/svgii/pathData_convert.js +5 -1
- package/src/svgii/pathData_fix_directions.js +6 -0
- package/src/svgii/pathData_fromPoly.js +3 -3
- package/src/svgii/pathData_getLength.js +86 -0
- package/src/svgii/pathData_parse.js +2 -0
- package/src/svgii/pathData_parse_els.js +66 -68
- package/src/svgii/pathData_split_to_groups.js +168 -0
- package/src/svgii/pathData_stringify.js +26 -64
- package/src/svgii/pathData_toPolygon.js +3 -4
- package/src/svgii/poly_analyze.js +61 -0
- package/src/svgii/poly_normalize.js +11 -2
- package/src/svgii/poly_to_pathdata.js +85 -24
- package/src/svgii/rounding.js +8 -7
- package/src/svgii/svg_cleanup.js +374 -620
- package/src/svgii/svg_cleanup_convertPathLength.js +32 -0
- package/src/svgii/svg_cleanup_general_svg_atts.js +97 -0
- package/src/svgii/svg_cleanup_normalize_transforms.js +83 -0
- package/src/svgii/svg_cleanup_remove_els_and_atts.js +72 -0
- package/src/svgii/svg_cleanup_ungroup.js +36 -0
- package/src/svgii/svg_el_parse_style_props.js +65 -43
- package/src/svgii/svg_getElementLength.js +67 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
!function(e){"use strict";function t(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 a(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:l,acos:r,asin:n,atan:s,atan2:i,ceil:o,cos:u,exp:h,floor:p,log:c,hypot:y,max:f,min:x,pow:g,random:d,round:m,sin:v,sqrt:b,tan:M,PI:A}=Math,w=180/Math.PI,C=Math.PI/180,k="http://www.w3.org/2000/svg",S=.39370078,{abs:E,acos:P,asin:L,atan:$,atan2:D,ceil:I,cos:T,exp:j,floor:z,log:q,max:N,min:F,pow:B,random:Q,round:R,sin:O,sqrt:_,tan:U,PI:G}=Math;function V(e,t,a=!1){let l=D(t.y-e.y,t.x-e.x);return a&&l<0&&(l+=2*Math.PI),l}function H(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 X(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 Z(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 W(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=V(e,t),r.angle<0&&(r.angle+=2*G)),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=W(n,s,t),r?(a=W(s,i,t),h=W(i,o,t),p=W(e,a,t),c=W(a,h,t),u=W(p,c,t),u.angle=V(p,c),l&&(u.cpts=[a,h,p,c])):(a=W(n,s,t),h=W(s,o,t),u=W(a,h,t),u.angle=V(a,h),l&&(u.cpts=[a,h]))):(u.x=o.x,u.y=o.y,u.angle=V(i,o)):(u.x=n.x,u.y=n.y,u.angle=V(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):W(e[0],e[1],t,a),a&&n.angle<0&&(n.angle+=2*G),r?[n.x,n.y]:n}function J(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 K(e,t,a,l,r,n,s,i,o){const u=(e,t,a,l)=>D(l-t,a-e);let h={cx:0,cy:0,rx:a=E(a),ry:l=E(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*G/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,S=C**2+k**2;if(!S)throw Error("start point can not be same as end point");let P=Math.sqrt(Math.abs((w*w-S)/S));n==s&&(P=-P);let L=P*C/l,$=-P*k/a;p=y?x*L-f*$+m:m+L,c=y?f*L+x*$+v:v+$,h.cy=c,h.cx=p;let I=u(p,c,e,t),T=u(p,c,i,o);!s&&T>I&&(T-=2*Math.PI),s&&I>T&&(T=T<=0?T+2*Math.PI:T);let j=T-I;return h.startAngle=I,h.endAngle=T,h.deltaAngle=j,h}function ee(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 te(e,t,a,l,r,n=0,s=!0,i=!1){if(r=i?r*G/180:r,n=i?n*G/180:n,n=a!==l&&n!==2*G?n:0,s&&a!==l){let e=$(U(r=n?r-n:r)*(a/l));r=T(r)<0?e+G:e}let o=e+a*T(r),u=t+l*O(r),h={x:o,y:u};return n&&(h.x=e+(o-e)*T(n)-(u-t)*O(n),h.y=t+(o-e)*O(n)+(u-t)*T(n)),h}function ae(e,t,a){if(t===a||e%G*.5==0)return e;let l=$(U(e)*(t/a));return l=T(e)<0?l+G:l,l}function le(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 re(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 ne(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=K(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 se(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(ee(a,0,0,r))}let o=l?ie(...i):oe(...i);n.push(...o)}return n=[...new Set(n)].sort(),n}function ie(e,t,a,l){if(!le(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 oe(e,t,a){if(!le(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 ue(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 he(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 _(l*l+r*r)}function pe(e,t){let a=t.x-e.x,l=t.y-e.y;return a*a+l*l}function ce(e,t){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)}function ye(e,t){return.5*(Math.abs(t.x-e.x)+Math.abs(t.y-e.y))}function fe(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 xe(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 ge(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 de(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 me(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?re(c,{addExtremes:r,addSemiExtremes:!1}):[],f=n?re(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=de(i,a[0]),t=e[0],l=e[1];r.push(t,l)}else{let e=a[0],t=de(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=de(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 ve(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=me(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 be(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 Me({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 Ae(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||ce(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 we(e=0,t=3){if(!t)return Math.round(e);let a=10**t;return Math.round(e*a)/a}function Ce(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 ke(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]=we(r[a],l)}return e}const Se=["polygon","polyline","line","rect","circle","ellipse"],Ee=["x","cx","rx","dx","width","translateX"],Pe=["y","cy","ry","dy","height","translateY"],Le=["scaleX","translateX","skewX"],$e=["scaleY","translateY","skewY"],De=["fill","stroke","stop-color"],Ie=["d","points","cx","cy","x1","x2","y1","y2","width","height","r","rx","ry","x","y"],Te=["path",...Se],je=["text","textPath","tspan",...Te],ze=["textPath","text","tspan"],qe=["stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-linecap","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","stroke-opacity"],Ne={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",...Te,...ze],"transform-origin":["svg","g","use",...Te,...ze],fill:["svg","g","use",...Te,...ze,"animate","animateMotion"],"fill-opacity":["svg","g","use",...Te,...ze],"fill-rule":["svg","g","path","polygon","text","textPath"],opacity:["svg","g","use",...Te,...ze],stroke:["svg","g","use",...Te,...ze],"stroke-width":["svg","g","use",...Te,...ze,"mask"],"stroke-opacity":["svg","g","use",...Te,...ze,"mask"],"stroke-miterlimit":["svg","g","use",...Te,...ze,"mask"],"stroke-linejoin":["svg","g","use",...Te,...ze,"mask"],"stroke-linecap":["svg","g","use",...Te,...ze,"mask"],"stroke-dashoffset":["svg","g","use",...Te,...ze,"mask"],"stroke-dasharray":["svg","g","use",...Te,...ze,"mask"],"clip-path":["svg","g","use",...Te,...ze],"clip-rule":["path","polygon"],clipPathUnits:["clipPath"],mask:["svg","g","use",...Te,...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:[...Te]},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 Fe(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||Qe(e),y="string"===p&&e.split(/,| /).length>1,f="string"===p&&e.includes("(");if(!c||y||f)return e;t=t||Be(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=w;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=S*o;break;case"mm":g=S*o*.1;break;case"Q":g=S*o*.025;break;case"em":case"rem":g=u;break;default:g=1}let m=x*g;return i?m=Ce(m):r>-1&&(m=+m.toFixed(r)),m}function Be(e){if(!e||!isNaN(e))return"";return(e=e.replace(/\+|\-/g,"")).match(/[^\d|.]+/g)[0]}function Qe(e=""){return!isNaN(e)||!isNaN(parseFloat(e))}function Re(e,{x:t=0,y:a=0,width:l=0,height:r=0}={}){let n=[...e.attributes],s={};return n.forEach(e=>{let n=Fe(e.nodeValue,{x:t,y:a,width:l,height:r});s[e.name]=n}),s}function Oe(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 _e(e){let t=[];return e.forEach(e=>{let a=function(e){let t=Ge(e),a=Oe(t);return a}(e);t.push(a)}),t}function Ue(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 Ge(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=he(i,o)/2,a=W(i,o,.5),l=te(a.x,a.y,e,e,0),r=te(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=ge(e),n=r.length>1,s=[];if(n){let e=_e(r);e.forEach(function(t,a){for(let a=0;a<e.length;a++){let l=e[a];if(t!=l){Ue(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=K(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(He([p,{x:a,y:n},c])),l.push(p,c),r+=y}else l.push(p,c)}});let u=He(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 He(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 Xe(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 Ze(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=ye(e.p0,e.p)>ye(t.p0,t.p),o=JSON.parse(JSON.stringify(e)),u=JSON.parse(JSON.stringify(t)),h=X(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],I=X($,D,P.p0,h,!1),T=X($,D,P.p,h,!1),j=W(P.p0,I,1.333),z=W(P.p,T,1.333);if(X(o.p0,j,u.p,z,!0))return s;P.cp1=j,P.cp2=z;let q=ye(o.p0,P.p0)+ye(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],q<a){let t=i?1+g:Math.abs(g),n=1+Math.abs(g);if(t=i?1+g:Math.abs(g)/n,ye(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&&Xe(p),y<.05*l&&(s=[P])}return s}function We(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=Ye(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=Ye(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 Ye(e,t,{tolerance:a=1}={}){let l=[e,t],r=function(e,t){let a=ce(e.cp2,e.p);if(0===a)return 0;let l=ce(e.p,t.cp1);if(0===l)return 0;let r=ce(e.cp2,t.cp1);return a/r}(e,t);if(!r)return l;let n=ce(e.p0,e.p),s=ce(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=ce(e.p,u),p=0,c=0,y=!1,f=h;if(h<i){let a=.5*(1+r);if(p=ce(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=ce(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=ce(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 Je(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=pe(n,s),h=u/1e3*t,p=He(e,!0);return p<h&&(l=!0),a&&(r.flat=l,r.steepness=p/u*10),a?r:l}function Ke(e=[],{detectExtremes:a=!0,detectCorners:l=!0,detectDirection:r=!0,detectSemiExtremes:n=!1,debug:s=!1,addSquareLength:i=!0,addArea:o=!0}={}){let u=[],h=Oe(J(e=et(e,{addSquareLength:i,addArea:o}))),{left:p,right:c,top:y,bottom:f,width:x,height:g}=h;e[0].corner=!1,e[0].extreme=!1,e[0].semiExtreme=!1,e[0].directionChange=!1,e[0].closePath=!1;let d=[e[0]],m=e.length;for(let t=2;m&&t<=m;t++){let a=e[t-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=e[t]||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;
|
|
1
|
+
!function(e){"use strict";function t(e,t,l="red",a="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="${a}" fill="${l}">\n <title>${n}</title></circle>`;if(!s)return u;e.insertAdjacentHTML("beforeend",u)}function l(e,t="",l="green",a="1%",r="1",n=!0){let s=`<path d="${t}" fill="none" stroke="${l}" stroke-width="${a}" stroke-opacity="${r}" /> `;if(!n)return s;e.insertAdjacentHTML("beforeend",s)}const{abs:a,acos:r,asin:n,atan:s,atan2:i,ceil:o,cos:u,exp:h,floor:p,log:c,hypot:y,max:f,min:x,pow:m,random:d,round:g,sin:v,sqrt:b,tan:A,PI:M}=Math,w=180/Math.PI,C=Math.PI/180,k="http://www.w3.org/2000/svg",S=.39370078,{abs:E,acos:P,asin:D,atan:L,atan2:$,ceil:T,cos:N,exp:q,floor:j,log:z,max:I,min:B,pow:F,random:O,round:R,sin:Q,sqrt:V,tan:G,PI:H}=Math;function U(e,t,l=!1){let a=$(t.y-e.y,t.x-e.x);return l&&a<0&&(a+=2*Math.PI),a}function Z(e,t,l,a=!1){let r=Math.atan2(t.y-e.y,t.x-e.x),n=Math.atan2(l.y-e.y,l.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),a&&(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 W(e=null,t=null,l=null,a=null,r=!0,n=!1,s=!1){let i,o,u,h,p,c={};if(!(e&&t&&l&&a))return s&&console.warn("points missing"),!1;if(e.x===t.x&&e.y===t.y||l.x===a.x&&l.y===a.y)return!1;try{if(i=(a.y-l.y)*(t.x-e.x)-(a.x-l.x)*(t.y-e.y),0===i)return!1}catch{return s&&console.warn("!catch",e,t,"p3:",l,"p4:",a),!1}o=e.y-l.y,u=e.x-l.x,h=(a.x-l.x)*o-(a.y-l.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,l,a=!1){const r=(e,t,l)=>e>=t&&e<=l||e<=t&&e>=l;let n=!1;if((!a||!l.bottom)&&(l.left>e.x||l.top>e.y||l.bottom<e.y||l.right<e.x))return!1;let s=t.length;for(let l=s-1,a=0;a<s;l=a,a++){const s=t[l],i=t[a];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 J(e,t,l,a=!1){let r={x:(t.x-e.x)*l+e.x,y:(t.y-e.y)*l+e.y};return a&&(r.angle=U(e,t),r.angle<0&&(r.angle+=2*H)),r}function Y(e,t=.5,l=!1,a=!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,l=!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(l||a){let e,l,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=J(n,s,t),r?(l=J(s,i,t),h=J(i,o,t),p=J(e,l,t),c=J(l,h,t),u=J(p,c,t),u.angle=U(p,c),a&&(u.cpts=[l,h,p,c])):(l=J(n,s,t),h=J(s,o,t),u=J(l,h,t),u.angle=U(l,h),a&&(u.cpts=[l,h]))):(u.x=o.x,u.y=o.y,u.angle=U(i,o)):(u.x=n.x,u.y=n.y,u.angle=U(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,l):J(e[0],e[1],t,l),l&&n.angle<0&&(n.angle+=2*H),r?[n.x,n.y]:n}function _(e=[],t=!1,l=-1){let a=[];return e.forEach(e=>{let{type:r,values:n}=e;if(n.length)if(l>-1&&(n=n.map(e=>+e.toFixed(l))),t)for(let e=1;e<n.length;e+=2)a.push({x:n[e-1],y:n[e]});else a.push({x:n[n.length-2],y:n[n.length-1]})}),a}function K(e,t,l,a,r,n,s,i,o,u=!0){const h=(e,t,l,a,r=!0)=>{let n=Math.atan2(a-t,l-e);return r&&n<0&&(n+=2*Math.PI),n};let p={cx:0,cy:0,rx:l=Math.abs(l),ry:a=Math.abs(a),startAngle:0,endAngle:0,deltaAngle:0,clockwise:s,xAxisRotation:r=l===a?0:r<0&&u?r+360:r,largeArc:n,sweep:s};if(0==l||0==a)throw Error("rx and ry can not be 0");let c,y,f=l===a?0:r*C,x=f?Math.sin(f):0,m=f?Math.cos(f):1,d=(e-i)/2,g=(t-o)/2,v=(e+i)/2,b=(t+o)/2,A=f?m*d+x*g:d,M=f?m*g-x*d:g,k=A*A/(l*l)+M*M/(a*a);if(k>1){let e=Math.sqrt(k);l*=e,a*=e,p.rx=l,p.ry=a}let S=l*a,E=l*M,P=a*A,D=E**2+P**2;if(!D)throw Error("start point can not be same as end point");let L=Math.sqrt(Math.abs((S*S-D)/D));n===s&&(L=-L);let $=L*E/a,T=-L*P/l;c=f?m*$-x*T+v:v+$,y=f?x*$+m*T+b:b+T,p.cy=y,p.cx=c;let N=h(c,y,e,t,u),q=h(c,y,i,o,u);s?q<N&&(q+=2*Math.PI):q>N&&(q-=2*Math.PI);let j=q-N;return p.startAngle=N,p.startAngle_deg=N*w,p.endAngle=q,p.endAngle_deg=q*w,p.deltaAngle=j,p.deltaAngle_deg=j*w,p}function ee(e,t,l,a=0,r=!1){return a?(a=r?a/180*Math.PI:a,{x:t+(e.x-t)*Math.cos(a)-(e.y-l)*Math.sin(a),y:l+(e.x-t)*Math.sin(a)+(e.y-l)*Math.cos(a)}):e}function te(e,t,l,a,r,n=0,s=!0,i=!1){if(r=i?r*H/180:r,n=i?n*H/180:n,n=l!==a&&n!==2*H?n:0,s&&l!==a){let e=L(G(r=n?r-n:r)*(l/a));r=N(r)<0?e+H:e}let o=e+l*N(r),u=t+a*Q(r),h={x:o,y:u};return n&&(h.x=e+(o-e)*N(n)-(u-t)*Q(n),h.y=t+(o-e)*Q(n)+(u-t)*N(n)),h}function le(e,t,l){if(t===l||e%H*.5==0)return e;let a=L(G(e)*(t/l));return a=N(e)<0?a+H:a,a}function ae(e=null,t=[]){e||(e=t[0],t=t.slice(1,t.length));let l=t.length,a=t[l-1],r=t[0],n=3===l?t[1]:r,s=Math.min(e.y,a.y),i=Math.min(e.x,a.x),o=Math.max(e.x,a.x),u=Math.max(e.y,a.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 re(e,{addExtremes:t=!0,addSemiExtremes:l=!1}={}){let a=4===e.length?function(e,t,l,a,{addExtremes:r=!0,addSemiExtremes:n=!1}={}){const s=e=>{const t=Math.PI/4,l=Math.cos(t),a=Math.sin(t);return{x:e.x*l-e.y*a,y:e.x*a+e.y*l}};n&&(e=s(e),t=s(t),l=s(l),a=s(a));let[i,o,u,h,p,c,y,f]=[e.x,e.y,t.x,t.y,l.x,l.y,a.x,a.y],x=Math.min(e.y,a.y),m=Math.min(e.x,a.x),d=Math.max(e.x,a.x),g=Math.max(e.y,a.y);if(t.y>=x&&t.y<=g&&l.y>=x&&l.y<=g&&t.x>=m&&t.x<=d&&l.x>=m&&l.x<=d)return[];let v,b,A,M,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,A=3*u-3*i):(b=6*o-12*h+6*c,v=-3*o+9*h-9*c+3*f,A=3*h-3*o),Math.abs(v)<1e-8){if(Math.abs(b)<1e-8)continue;M=-A/b,0<M&&M<1&&E.push(M)}else k=b*b-4*A*v,k<0?Math.abs(k)<1e-8&&(M=-b/(2*v),0<M&&M<1&&E.push(M)):(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--;)M=E[P];return E}(e[0],e[1],e[2],e[3],{addExtremes:t,addSemiExtremes:l}):function(e,t,l,{addExtremes:a=!0,addSemiExtremes:r=!1}={}){const n=e=>{const t=-Math.PI/4,l=Math.cos(t),a=Math.sin(t);return{x:e.x*l-e.y*a,y:e.x*a+e.y*l}};r&&(e=n(e),t=n(t),l=n(l));let s,i,o,u=Math.min(e.y,l.y),h=Math.min(e.x,l.x),p=Math.max(e.x,l.x),c=Math.max(e.y,l.y);if(t.y>=u&&t.y<=c&&t.x>=h&&t.x<=p)return[];let[y,f,x,m,d,g]=[e.x,e.y,t.x,t.y,l.x,l.y],v=[];for(let e=0;e<2;++e)s=0==e?y-2*x+d:f-2*m+g,i=0==e?-2*y+2*x:-2*f+2*m,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:l});return a}function ne(e,t){const l=(e,t,l,a,r,n)=>{var s=Math.cos(n),i=Math.sin(n),o=a*Math.cos(e),u=r*Math.sin(e);return{x:t+s*o-i*u,y:l+i*o+s*u}};let a,r,n,s,i,o=K(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],m={x:t[5],y:t[6]},d=[m],g=x*Math.PI/180,v=Math.tan(g);i=Math.atan2(-h*v,u);let b=i,A=i+Math.PI,M=Math.atan2(h,u*v),w=M+Math.PI,C=[e.x,m.x],k=[e.y,m.y],S=Math.min(...C),E=Math.max(...C),P=Math.min(...k),D=Math.max(...k),L=l(y-.001*f,p,c,u,h,g),$=l(y-.999*f,p,c,u,h,g);return(L.x>E||$.x>E)&&(a=l(b,p,c,u,h,g),d.push(a)),(L.x<S||$.x<S)&&(r=l(A,p,c,u,h,g),d.push(r)),(L.y<P||$.y<P)&&(s=l(w,p,c,u,h,g),d.push(s)),(L.y>D||$.y>D)&&(n=l(M,p,c,u,h,g),d.push(n)),d}function se(e=[],t=[]){let l=e.length,a=4===l;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<l;t++){let l=e[t];i.push(ee(l,0,0,r))}let o=a?ie(...i):oe(...i);n.push(...o)}return n=[...new Set(n)].sort(),n}function ie(e,t,l,a){if(!ae(e,[t,l,a]))return[];let r,n,s,i,o,u,h,p,[c,y,f,x,m,d,g,v]=[e.x,e.y,t.x,t.y,l.x,l.y,a.x,a.y],b=[],A=1e-8;for(let e=0;e<2;++e)if(0==e?(n=6*c-12*f+6*m,r=-3*c+9*f-9*m+3*g,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)<A){if(Math.abs(n)<A)continue;i=-s/n,i>0&&i<1&&b.push(i)}else h=n*n-4*s*r,h<0?Math.abs(h)<A&&(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 M=b.length;for(;M--;)i=b[M];return[...new Set(b)].sort()}function oe(e,t,l){if(!ae(e,[t,l]))return[];let a,r,n,[s,i,o,u,h,p]=[e.x,e.y,t.x,t.y,l.x,l.y],c=[];for(let e=0;e<2;++e)a=0==e?s-2*o+h:i-2*u+p,r=0==e?-2*s+2*o:-2*i+2*u,Math.abs(a)>1e-12&&(n=-r/(2*a),n>0&&n<1&&c.push(n));return[...new Set(c)].sort()}function ue(e,t=.001){let l=Math.PI/2,a=l/2;return!(Math.abs(e/l-Math.round(e/l))<t)&&Math.abs(e/a-Math.round(e/a))<t}function he(e,t,l=!1){let a=l?t[0]-e[0]:t.x-e.x,r=l?t[1]-e[1]:t.y-e.y;return Math.sqrt(a*a+r*r)}function pe(e,t){let l=t.x-e.x,a=t.y-e.y;return l*l+a*a}function ce(e,t){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)}function ye(e,t){return.5*(Math.abs(t.x-e.x)+Math.abs(t.y-e.y))}function fe(e,t=48){if(!Array.isArray(e)||e.length<=t)return e;let l=e.length,a=l/t,r=[];for(let l=0;l<t;l++)r.push(e[Math.floor(l*a)]);let n=r.length;return r[n-1]!==e[l-1]&&(r[n-1]=e[l-1]),r}function xe(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 me(e){let t=[],l=[e[0]],a=e.length;for(let r=1;r<a;r++){let a=e[r];"M"!==a.type&&"m"!==a.type||(t.push(l),l=[]),l.push(a)}return l.length&&t.push(l),t}function de(e,t){let l,a,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?(l=Y([h,p],t),a=Y([p,c],t),r=Y([c,y],t),n=Y([l,a],t),s=Y([a,r],t),i=Y([n,s],t),o.push({x:h.x,y:h.y},{x:l.x,y:l.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?(a=Y([h,p],t),r=Y([p,y],t),i=Y([a,r],t),o.push({x:h.x,y:h.y},{x:a.x,y:a.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&&(a=Y([h,y],t),o.push({x:h.x,y:h.y},{x:a.x,y:a.y}),u.push({x:a.x,y:a.y},{x:y.x,y:y.y})),[o,u]}function ge(e,t,{tMin:l=0,tMax:a=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?re(c,{addExtremes:r,addSemiExtremes:!1}):[],f=n?re(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 l=function(e,t,l,a=!0){let r=[];if(!l.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(l.length)if(1===l.length){let e=de(i,l[0]),t=e[0],a=e[1];r.push(t,a)}else{let e=l[0],t=de(i,e),a=t[0];r.push(a),i=t[1];for(let t=1;t<l.length;t++){e=l[t-1];let a=de(i,(l[t]-e)/(1-e));r.push(a[0]),t===l.length-1&&r.push(a[a.length-1]),i=a[1]}}if(a){let e,t,l=[];return r.forEach(a=>{e={type:"",values:[]},a.shift(),t=a.map(e=>Object.values(e)).flat(),e.values=t,3===a.length?e.type="C":2===a.length?e.type="Q":1===a.length&&(e.type="L"),l.push(e)}),l}return r}(e,t,x);s.push(...l),p+=l.length}else s.push({type:i,values:t});return{pathData:s,count:p}}function ve(e,{tMin:t=0,tMax:l=1,addExtremes:a=!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((a||r)&&("C"===h||"Q"===h)){let e=ge(s,p,{tMin:t,tMax:l,addExtremes:a,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 be(e){let t=e.startsWith("#")?"rgbHex":e.includes("(")?"fn":typeof e,l={},a=null,r={mode:null,values:[]};if("rgbHex"===t)l=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,l=0,a=0,r=0;if(e.length<6||e.length>8)return console.warn("Invalid hex format"),{r:t,g:l,b:a,a:r};let n=8===e.length,s=parseInt(e,16);return t=n?parseInt(e.substring(0,2),16):s>>16&255,l=n?parseInt(e.substring(2,4),16):s>>8&255,a=n?parseInt(e.substring(4,6),16):255&s,r=n?parseInt(e.substring(6,8),16):255,{r:t,g:l,b:a,a:r}}(e),a="rgba";else if("fn"===t){let t=e.split(/\(|\)/).filter(Boolean);if(t.length<2)return e;a=t[0];let r=t[1].split(/,| /).filter(Boolean).map(Number);a.split("").forEach((e,t)=>{let n=r[t];"rgba"===a&&"a"===e&&(n=Math.floor(255*n)),l[e]=n})}else if("string"===t)return r.mode="keyword",r.values=[e],r;return"rgba"!==a&&"rgb"!==a||(l.a=l.a?l.a:255),r.mode=a,r.values=Object.values(l),r}function Ae({r:e=0,g:t=0,b:l=0,a:a=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||l||!r.length||([e,t,l,a=255]=r);let s=n(e),i=n(t),o=n(l),u=a<255?n(a):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 l=1,a=e.length;l<a;l++){let a=e[l],{type:r,values:n,p0:s=null,p:i=null,dimA:o=0}=a;n.length&&i&&s&&(o=o||ce(s,i),o&&t.push(o))}let l=t.sort(),a=Math.ceil(l.length/6);l=l.slice(0,a);let r=l.reduce((e,t)=>e+t,0)/a,n=r>112.5?0:Math.floor(75/r).toString().length;return Math.min(Math.max(0,n),8)}function we(e=0,t=3){if(t<=-1)return e;if(!t)return Math.round(e);let l=10**t;return Math.round(e*l)/l}function Ce(e,t=50){let l=8;l=e>2*t?0:e>t?1:Math.ceil(500/e).toString().length;let a=10**l;return Math.round(e*a)/a}function ke(e,t=-1){if(t<0)return e;let l=e.length,a=t;for(let t=0;t<l;t++){let l=e[t],{values:r}=l,n=r.length;if(n)for(let l=0;l<n;l++)e[t].values[l]=we(r[l],a)}return e}const Se=["polygon","polyline","line","rect","circle","ellipse"],Ee=["x","cx","rx","dx","width","translateX"],Pe=["y","cy","ry","dy","height","translateY"],De=["scaleX","translateX","skewX"],Le=["scaleY","translateY","skewY"],$e=["fill","stroke","stop-color"],Te=["d","points","cx","cy","x1","x2","y1","y2","width","height","r","rx","ry","x","y"],Ne=["path",...Se],qe=["text","textPath","tspan",...Ne],je=["textPath","text","tspan"],ze=["stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-linecap","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","stroke-opacity"],Ie={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",...Ne,...je],"transform-origin":["svg","g","use",...Ne,...je],fill:["svg","g","use",...Ne,...je,"animate","animateMotion"],"fill-opacity":["svg","g","use",...Ne,...je],"fill-rule":["svg","g","path","polygon","text","textPath"],opacity:["svg","g","use",...Ne,...je],stroke:["svg","g","use",...Ne,...je],"stroke-width":["svg","g","use",...Ne,...je,"mask"],"stroke-opacity":["svg","g","use",...Ne,...je,"mask"],"stroke-miterlimit":["svg","g","use",...Ne,...je,"mask"],"stroke-linejoin":["svg","g","use",...Ne,...je,"mask"],"stroke-linecap":["svg","g","use",...Ne,...je,"mask"],"stroke-dashoffset":["svg","g","use",...Ne,...je,"mask"],"stroke-dasharray":["svg","g","use",...Ne,...je,"mask"],"clip-path":["svg","g","use",...Ne,...je],"clip-rule":["path","polygon"],clipPathUnits:["clipPath"],mask:["svg","g","use",...Ne,...je],maskContentUnits:["mask"],maskUnits:["mask"],"font-family":["svg","g",...je],"font-size":["svg","g",...je],"font-style":["svg","g",...je],"font-weight":["svg","g",...je],"font-stretch":["svg","g",...je],"dominant-baseline":[...je],lengthAdjust:[...je],"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",...je],color:["svg","g",...je],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:[...Ne]},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 Be(e=null,{unit:t=null,width:l=0,height:a=0,decimals:r=-1,isHorizontal:n=!1,isVertical:s=!1,autoRoundValues:i=!1,dpi:o=96,fontSize:u=16,normalizedDiagonal:h=!1}={}){h=l!==a&&h;let p=typeof e;if(!e)return e;let c="number"===p||Oe(e),y="string"===p&&e.split(/,| /).length>1,f="string"===p&&e.includes("(");if(!c||y||f)return e;t=t||Fe(e);let x=parseFloat(e),m=1,d=Math.sqrt(l*l+a*a)/1.4142135623730951;if(!t)return x;switch(t){case"%":m=l&&n?l/100:a&&s?a/100:h?d/100:1;break;case"rad":m=w;break;case"turn":m=360;break;case"in":m=o;break;case"pt":m=.01388889*o;break;case"pc":m=.16666667*o;break;case"cm":m=S*o;break;case"mm":m=S*o*.1;break;case"Q":m=S*o*.025;break;case"em":case"rem":m=u;break;default:m=1}let g=x*m;return i?g=Ce(g):r>-1&&(g=+g.toFixed(r)),g}function Fe(e){if(!e||!isNaN(e))return"";return(e=e.replace(/\+|\-/g,"")).match(/[^\d|.]+/g)[0]}function Oe(e=""){return!isNaN(e)||!isNaN(parseFloat(e))}function Re(e,{x:t=0,y:l=0,width:a=0,height:r=0}={}){let n=[...e.attributes],s={};return n.forEach(e=>{let n=Be(e.nodeValue,{x:t,y:l,width:a,height:r});s[e.name]=n}),s}function Qe(e,t=-1){let l=e.map(e=>e.x),a=e.map(e=>e.y),r=Math.min(...l),n=Math.max(...l),s=Math.min(...a),i=Math.max(...a),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 Ve(e){let t=[];return e.forEach(e=>{let l=function(e){let t=He(e),l=Qe(t);return l}(e);t.push(l)}),t}function Ge(e,t){let[l,a,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&&l<o&&s>c&&a<u&&i>y&&(f=!0),f}function He(e){let t=[];for(let l=0;l<e.length;l++){let a=e[l],r=l>0?e[l-1]:e[l],{type:n,values:s}=a,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=he(i,o)/2,l=J(i,o,.5),a=te(l.x,l.y,e,e,0),r=te(l.x,l.y,e,e,Math.PI);t.push(a,r,o);break}arcToBezier(i,s).forEach(e=>{let l=e.values,a={x:l[0],y:l[1]},r={x:l[2],y:l[3]},n={x:l[4],y:l[5]};t.push(a,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 Ue(e,t=9){let l=0,a=[],r=me(e),n=r.length>1,s=[];if(n){let e=Ve(r);e.forEach(function(t,l){for(let l=0;l<e.length;l++){let a=e[l];if(t!=a){Ge(t,a)&&s.push(l)}}})}return r.forEach((e,t)=>{a=[];let r=0,n=0,i=1,o=[];e.forEach(function(t,l){let[n,s]=[t.type,t.values],i=s.length;if(s.length){let u=(l>0?e[l-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 l,[a,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 l=3*(a.x*(-2*r.y-n.y+3*s.y)+r.x*(2*a.y-n.y-s.y)+n.x*(a.y+r.y-2*s.y)+s.x*(-3*a.y+r.y+2*n.y))/20,t?Math.abs(l):l}(o));r+=t,a.push(p,c)}else if("A"===n){let e=K(p.x,p.y,t.values[0],t.values[1],t.values[2],t.values[3],t.values[4],c.x,c.y),{cx:l,cy:n,rx:s,ry:i,startAngle:o,endAngle:u,deltaAngle:h}=e,y=Math.abs(function(e,t,l,a){const r=Math.PI*e*t;let n=(a-l+2*Math.PI)%(2*Math.PI);if(e===t)return r*(n/(2*Math.PI));const s=l=>Math.atan2(e*Math.sin(l),t*Math.cos(l));return l=s(l),a=s(a),n=(a-l+2*Math.PI)%(2*Math.PI),r*(n/(2*Math.PI))}(s,i,o,u));y-=Math.abs(Ze([p,{x:l,y:n},c])),a.push(p,c),r+=y}else a.push(p,c)}});let u=Ze(a);-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,l+=n}),l}function Ze(e,t=!1){let l=0,a=e.length;for(let t=0;a&&t<a;t++){l+=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&&(l=Math.abs(l)),l}function We(e,t=0){t=parseFloat(t);let l=e.length,a=e[0].values.join(" "),r=t>1?"\n":t<1?"":" ",n=t>.5?" ":"",s=`${e[0].type}${n}${a}${r}`;for(let i=1;i<l;i++){let o=e[i-1],u=e[i],{type:h,values:p}=u;if(a="",t||"A"!==h&&"a"!==h||(p=[p[0],p[1],p[2],`${p[3]}${p[4]}${p[5]}`,p[6]]),h=t<1&&o.type===u.type&&"m"!==u.type.toLowerCase()||t<1&&"M"===o.type&&"L"===u.type?" ":u.type,t)a=p.join(" ");else{let e=!1;for(let t=0,l=p.length;t<l;t++){let l=p[t],r=l.toString(),n=r.includes(".")&&Math.abs(l)<1;n&&e&&(r=r.replace(/^0\./,".")),!(t>0)||e&&n||(a+=" "),a+=r,e=n}}i===l-1&&(r=""),s+=`${h}${n}${a}${r}`}return t<1&&(s=s.replace(/[A-Za-z]0(?=\.)/g,e=>e[0]).replace(/ 0\./g," .").replace(/ -/g,"-").replace(/-0\./g,"-.").replace(/Z/g,"z")),s}function Xe(e,t,l=0,a=1,r=!1){const n=(e,t,l,a,r)=>{let n=1-r;return{x:3*n*n*(t.x-e.x)+6*n*r*(l.x-t.x)+3*r*r*(a.x-l.x),y:3*n*n*(t.y-e.y)+6*n*r*(l.y-t.y)+3*r*r*(a.y-l.y)}};let s=[e,t],i=ye(e.p0,e.p)>ye(t.p0,t.p),o=JSON.parse(JSON.stringify(e)),u=JSON.parse(JSON.stringify(t)),h=W(o.p0,o.cp1,u.p,u.cp2,!1);if(!h)return s;if(i){let l={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=l}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),m=y(p(e.p0,f),x)/y(x,x),d=Y([t.p0,t.cp1,t.cp2,t.p],m),g=n(t.p0,t.cp1,t.cp2,t.p,m);m-=y(p(d,e.p0),g)/y(g,g);let v=Y([t.p0,t.cp1,t.cp2,t.p],m),b=t.p,A=n(t.p0,t.cp1,t.cp2,t.p,m),M=n(t.p0,t.cp1,t.cp2,t.p,1),w=1-m,C=(k=v,S=c(A,w/3),{x:k.x+S.x,y:k.y+S.y});var k,S;let E=p(b,c(M,w/3)),P={p0:v,cp1:C,cp2:E,p:b,t0:m};i&&(P={p0:b,cp1:E,cp2:C,p:v,t0:m});let D=.5*(1-m),L=Y([P.p0,P.cp1,P.cp2,P.p],D,!1,!0),$=L.cpts[2],T=W(L,$,P.p0,h,!1),N=W(L,$,P.p,h,!1),q=J(P.p0,T,1.333),j=J(P.p,N,1.333);if(W(o.p0,q,u.p,j,!0))return s;P.cp1=q,P.cp2=j;let z=ye(o.p0,P.p0)+ye(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],z<l){let t=i?1+m:Math.abs(m),n=1+Math.abs(m);if(t=i?1+m:Math.abs(m)/n,ye(Y([P.p0,P.cp1,P.cp2,P.p],t),e.p)>l*a)return s;let h=Ue([{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=Ue(p),y=Math.abs(c/h-1);P.error=5*y*a,r&&We(p),y<.05*a&&(s=[P])}return s}function Je(e,{keepExtremes:t=!0,keepInflections:l=!0,keepCorners:a=!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:m=null,extreme:d=!1,directionChange:g=!1,corner:v=!1,dimA:b=0}=o;if("C"===p&&"C"===h)if(a&&v||t&&d)s.push(o);else{let h=Ye(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||l&&o.directionChange||a&&o.corner||t&&o.extreme)break;let i=Ye(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 Ye(e,t,{tolerance:l=1}={}){let a=[e,t],r=function(e,t){let l=ce(e.cp2,e.p);if(0===l)return 0;let a=ce(e.p,t.cp1);if(0===a)return 0;let r=ce(e.cp2,t.cp1);return l/r}(e,t);if(!r)return a;let n=ce(e.p0,e.p),s=ce(t.p0,t.p),i=.08*Math.max(0,Math.min(n,s))*l,o=function(e,t,l=0){let{p0:a,cp1:r}=e,{p:n,cp2:s}=t;return r={x:(r.x-(1-l)*a.x)/l,y:(r.y-(1-l)*a.y)/l},s={x:(s.x-l*n.x)/(1-l),y:(s.y-l*n.y)/(1-l)},{p0:a,cp1:r,cp2:s,p:n}}(e,t,r),u=Y([o.p0,o.cp1,o.cp2,o.p],r),h=ce(e.p,u),p=0,c=0,y=!1,f=h;if(h<i){let l=.5*(1+r);if(p=ce(Y([t.p0,t.cp1,t.cp2,t.p],.5),Y([o.p0,o.cp1,o.cp2,o.p],l)),f+=p,p<i){let t=.5*r;c=ce(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=ce(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,a=[o]),a}function _e(e,{tolerance:t=1,debug:l=!1}={}){let a=!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!l||r;let u=pe(n,s),h=u/1e3*t,p=Ze(e,!0);return p<h&&(a=!0),l&&(r.flat=a,r.steepness=p/u*10),l?r:a}function Ke(e=[],{detectExtremes:l=!0,detectCorners:a=!0,detectDirection:r=!0,detectSemiExtremes:n=!1,debug:s=!1,addSquareLength:i=!0,addArea:o=!0}={}){let u=[],h=Qe(_(e=et(e,{addSquareLength:i,addArea:o}))),{left:p,right:c,top:y,bottom:f,width:x,height:m}=h;e[0].corner=!1,e[0].extreme=!1,e[0].semiExtreme=!1,e[0].directionChange=!1,e[0].closePath=!1;let d=[e[0]],g=e.length;for(let t=2;g&&t<=g;t++){let l=e[t-1],{type:a,values:r,p0:s,p:i,cp1:o=null,cp2:u=null,squareDist:h=0,cptArea:x=0,dimA:m=0}=l,g=e[t]||null;l.corner=!1,l.extreme=!1,l.semiExtreme=!1,l.directionChange=!1,l.closePath=!1;let v="C"===a||"Q"===a?"C"===a?[s,o,u,i]:[s,o,i]:[s,i],b=.1*m,A=.01*b,M="Q"===a||"C"===a,w=g&&("Q"===g.type||"C"===g.type),C=!1;
|
|
2
2
|
//!isFlat &&
|
|
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(le(null,v)){let e=se(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=V(u,i),t=V(i,m.cp1);l=ue(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=He([e,i,t],!1),r=.01*pe(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(e=>{e.directionChange&&t(markers,e.p,"orange","1.5%","0.5"),e.corner&&t(markers,e.p,"magenta","1.5%","0.5"),e.extreme&&t(markers,e.p,"cyan","1%","0.5")}),u={pathData:d,bb:h,dimA:(x+g)/2},u}function et(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=ce(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}=K(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=pe(i,o)),a){let e=0;"C"===c&&(e=He([i,n,u,o],!1)),"Q"===c&&(e=He([i,n,o],!1)),p.cptArea=e}p.idx=r,i=o,h.push(p)}return h}const tt=new Set([77,109,65,97,67,99,76,108,81,113,83,115,84,116,72,104,86,118,90,122]),at=new Uint8Array(128);at[77]=2,at[109]=2,at[65]=7,at[97]=7,at[67]=6,at[99]=6,at[76]=2,at[108]=2,at[81]=4,at[113]=4,at[83]=4,at[115]=4,at[84]=2,at[116]=2,at[72]=1,at[104]=1,at[86]=1,at[118]=1,at[90]=0,at[122]=0;const lt=new Set([5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279]),rt=e=>32===e||44===e||10===e||13===e||8232===e||8233===e||9===e||11===e||12===e||160===e||e>=5760&<.has(e);function nt(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;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&&p++}u+=e[n],h=v,n++}else if((A<48||A>5759)&&rt(A))d(),n++;else{if(A>64){if(!tt.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=at[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}function st(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:nt(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 it(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 it(e,{toShorthands:t=!0,toLonghands:a=!1,toRelative:l=!0,toMixed:r=!1,toAbsolute:n=!1,decimals:s=3,arcToCubic:i=!1,quadraticToCubic:o=!1,hasRelatives:u=!0,hasShorthands:h=!0,hasQuadratics:p=!0,hasArcs:c=!0,optimizeArcs:y=!0,testTypes:f=!1}={}){let x=[];if(f){let t=Array.from(new Set(e.map(e=>e.type))).join("");/[lcqamts]/gi.test(t),p=/[qt]/gi.test(t),c=/[a]/gi.test(t),h=/[vhst]/gi.test(t),isPoly=/[mlz]/gi.test(t)}if(l=!n&&l,t=!a&&t,n&&(e=pt(e)),h&&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?pt(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)),y&&(e=function(e=[]){let t=[];e.forEach((a,l)=>{let{type:r,values:n}=a;if("A"===r){let[a,r,s,i,o]=[n[0],n[1],n[3],n[5],n[6]],u=e[l-1],[h,p]=[u.values[u.values.length-2],u.values[u.values.length-1]],c={x:h,y:p},y={x:i,y:o};if(0!==a&&0!==r||(e[l]=null,t.push(l)),a>=1&&(i===h||o===p)){if(Math.abs(a-r)/a<.01){let t=he(W(c,y,.5),c);Math.abs(t-a)/a<.01&&(e[l].values[0]=1,e[l].values[1]=1,e[l].values[2]=0)}}}}),t.length&&(e=e.filter(Boolean));return 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?ht(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*ce(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*ce(e,t),x=ce({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)),c&&i&&(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){yt(i,r.values,t).forEach(e=>{a.push(e)})}else a.push(r)}return a}(e)),p&&o&&(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(ut(s,l.values)):t.push(l)}return t}(e)),r&&(l=!0),s>-1&&l&&(e=ke(e,s)),r&&(x=JSON.parse(JSON.stringify(e))),l&&(e=function(e,t=-1){return ht(e,!0,t)}(e)),s>-1&&(e=ke(e,s)),r)for(let t=0;t<e.length;t++){let a=e[t],l=x[t],r=[a.type,a.values.join(" ")].join("").replaceAll(" -","-").replaceAll(" 0."," ."),n=[l.type,l.values.join(" ")].join("").replaceAll(" -","-").replaceAll(" 0."," ."),s=r.length;n.length<s&&(e[t]=x[t])}return e}function ot(e={},t={},a={},l={},r=1){let n=W(e,t,1.5),s=W(l,a,1.5),i=.01*ce(e,l)*r,o=ce(n,s),u=null,h={type:"C",values:[t.x,t.y,a.x,a.y,l.x,l.y]};return o<i&&(u=X(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 ut(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 ht(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 pt(e,t=-1){return ht(e,!1,t)}function ct({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}=H(a,e,t));let x=l!==r?ae(i,l,r):i,g=l!==r?ae(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 yt(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),I=$(S,E,P,L);0===o&&I>0?I-=2*Math.PI:1===o&&I<0&&(I+=2*Math.PI);let T=(+(Math.abs(I)/(l/4)).toFixed(0)||1)*a;I/=T;let j=[];const z=1.5707963267948966,q=.551785;let N=I===z?q:I===-z?-q:4/3*Math.tan(I/4),F=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<T;e++){let e={type:"C",values:[]};Q(D,I,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)}),j.push(e),D+=I}return j}function ft(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=xt(i,o,u,h,t),n=xt(r.p0,r.cp1,r.cp2,r.p,t);if(l.isArc&&n.isArc){let t=.01*ce(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=He([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 xt(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=V(e,t,!0),h=V(l,a,!0),p=180*Math.abs(u-h)/Math.PI,c=0,y=0;if(Math.abs(p%180-90)<3){n=X(e,ee(t,e.x,e.y,-.5*Math.PI),l,ee(a,l.x,l.y,.5*Math.PI),!1);let u=X(e,t,l,a,!1);if(u){let n=he(e,u),h=he(l,u),p=+Math.max(n,h).toFixed(8),f=+Math.min(n,h).toFixed(8);c=f,y=p;let x=He([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(He([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 gt(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:Fe(s,{isHorizontal:!0}):300,u=i?i.includes("%")?0:Fe(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=>Ce(e)),h=h.map(e=>Ce(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 dt(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=K(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 mt(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=gt(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].map(e=>e.name),o=[];i.forEach(t=>{o.push(e.getAttribute(t))});let u=t===a,h={};return i.forEach((l,r)=>{let s=Ee.includes(l),i=Pe.includes(l),p=!u&&"r"===l,c=Fe(o[r],{isHorizontal:s,isVertical:i,width:t,height:a,normalizedDiagonal:p,autoRoundValues:n});h[l]=c,e.setAttribute(l,c)}),h}(e,{width:a,height:l});switch(d){case"path":r=e.getAttribute("d"),g=st(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=dt(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(k,"path");return y.setAttribute("d",p),c.forEach(t=>{if(!h.includes(t)){let a=e.getAttribute(t);y.setAttribute(t,a)}}),y}function vt(e,{convert_rects:t=!1,convert_ellipses:a=!1,convert_poly:l=!1,convert_lines:r=!1}={}){let n=st(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=Re(e),x={};if(h)if(2===n.length&&r){y="line",c=document.createElementNS(k,y);let[e,t,a,l]=[...n[0].values,...n[1].values].map(e=>we(e,7));x={x1:e,y1:t,x2:a,y2:l}}else{let e=J(n),a=Oe(e),r=He(e,!0),s=a.width*a.height,i=Math.abs(1-s/r);if(t&&i<.01){y="rect",c=document.createElementNS(k,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(k,y),x={points:e.map(e=>[e.x,e.y]).flat().map(e=>we(e,7)).join(" ")}}}else if(!u&&a&&(!i&&o&&(n=ft(n,{areaThreshold:2.5}),i=n.filter(e=>"A"===e.type).length),i)){let e=et(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(we(e.cx,7)),l.add(we(e.cy,7)),r.add(we(e.rx,7)),s.add(we(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(k,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)(Ne.atts[e].includes(y)||t.includes(e)||e.startsWith("data-"))&&c.setAttribute(e,f[e]);e=c}return e}function bt(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?He([n,s,p],!0):1/0,g=pe(n,p),d=x<(g?g/333*t:0),m=!1;if(a||"C"!==c||(d=!1),a&&("C"===c||"Q"===c)){m=Je([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 At(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 wt(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?kt(e,a):e}function Ct(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?kt(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 kt(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 St(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 Et(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];re(i).forEach(e=>{let t=Y(i,e);n(t)})}else"A"===l&&ne(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?ce(p,c.p):1/0)<t,x=(y?ce(y.p,c.p):1/0)<1*t;if(c&&y&&"C"===n&&"C"===c.type&&i&&y.extreme&&(x||f)){let l=Ze(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=He([l.p0,l.p,c.p]),t=He([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=ce(n.p0,n.p)<t;if(s&&"C"===s.type&&p&&u&&h){let l=Ze(s,n,t,a,!1);1===l.length&&(e[r-1]=l[0],e[r]=null,e=e.filter(Boolean))}return e}function Pt(e,{toObject:t=!0,toArray:a=!1,flatten:l=!1}={}){if("string"==typeof e&&!isNaN(e[0]))return e=Lt(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=Lt(e);return e.map(e=>({x:e[0],y:e[1]}))}(e);return r}function Lt(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 $t(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,removeIds:u=!1,removeClassNames:h=!1,include:p=[],exclude:c=[],width:y=0,height:f=0}={}){let x=e.nodeName.toLowerCase(),g=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=>Be(e.trim())).filter(Boolean);n.length||e.push(`${l}(${r})`)}n=e.join(" ")}t[l]=n.trim()}return t}(e),d=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),m={...g,...d};delete m.style,c.push("style");let v=["style"];if(n||s||a){let e=It(x,m,{removeIds:u,removeClassNames:h,removeDefaults:s,removeNameSpaced:a,exclude:c,cleanUpStrokes:i,include:[...["scale","translate","rotate"],...p],cleanUpStrokes:!1});m=e.propsFiltered,v.push(...e.remove)}let b=[];for(let e in m){let t=m[e];if("d"===e||e.startsWith("data-"))continue;let a={prop:e,values:[]};if(r&&De.includes(e)){let e=be(t);if("rgba"===e.mode||"rgb"===e.mode){t=Me(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=Le.includes(l),n=$e.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=Tt(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&&b.push({prop:"transforms",values:e})}else a.values=Tt(t);a.values.length&&b.push(a)}let M={transformArr:[],matrix:null,transComponents:null},A=[],w=!1;for(let e=0;e<b.length;e++){let a=b[e],{prop:r,values:n}=a,s=[],o=0,u=0,h="",p="";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=y:"top"===a?n[t].value=0:"bottom"===a?n[t].value=f:"center"===a&&(n[t].value="50%")}),o=n[0].value,u=n[1]?n[1].value:o,h=n[0].unit,p=n[1]?n[1].unit:h,o=Fe(o,{unit:h,width:y,height:f,isHorizontal:!0,fontSize:t}),u=Fe(u,{unit:p,width:y,height:f,isVertical:!0,fontSize:t}),A.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,h=Ee.includes(r),p=Pe.includes(r);i&&("scale"===r&&"%"===i?o*=.01:("r"===r&&(w=!0),o=Fe(a.value,{unit:i,width:y,height:f,isHorizontal:h,isVertical:p,normalizedDiagonal:w,fontSize:t}),l&&u&&(o=Ce(o)))),s.push(o)}else{w=!0;for(let e=0;e<n.length;e++){let a=Fe(n[e].value,{unit:n[e].unit,width:y,height:f,normalizedDiagonal:w,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=[],h=0,p=0,c={};if("scale"!==a&&"translate"!==a||(h=n[0].value,p=n[1]?n[1].value:h,i=n[0].unit,o=n[1]?n[1].unit:i,"scale"===a?(h="%"===i?.01*h:h,p="%"===o?.01*p:p):(h=Fe(h,{unit:i,width:y,height:f,isHorizontal:!0,fontSize:t}),p=Fe(p,{unit:o,width:y,height:f,isVertical:!0,fontSize:t})),s.push(h,p),c[a]=s,u.push(c)),"matrix"===a&&(s=n.map(e=>e.value),c[a]=s,u.push(c)),"skew"===a&&(h=n[0].value,i=n[0].unit,p=n[1].value,o=n[1].unit,h=Fe(h,{unit:i,isHorizontal:!0,fontSize:t}),p=Fe(p,{unit:o,isVertical:!0,fontSize:t}),h=h>360?h%360:h,p=p>360?p%360:p,s=[h,p],c[a]=s,u.push(c)),"rotate"===a){let e=n[0].value;e=Fe(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]})}c[a]=[e],t.length?u.push(t[0],c,t[1]):u.push(c)}l.push(...u)}M.transformArr=l}}let C=void 0!==M.translate?{translate:M.translate}:null,k=void 0!==M.scale?{scale:M.scale}:null,S=[C,void 0!==M.rotate?{rotate:M.rotate}:null,k].filter(Boolean);S.length&&(o&&v.push("translate","scale","rotate"),M.transformArr=[...S,...M.transformArr]),A.length&&void 0!==M.transformArr&&(M.transformArr=[{translate:[A[0],A[1]]},...M.transformArr,{translate:[-A[0],-A[1]]}],o&&v.push("transform-origin"));let{transformArr:E=[]}=M,P=[],L=E.length;if(L)for(let e=0;L&&e<L;e++){let t=E[e],a=Object.values(t).flat(),l=Object.keys(t)[0];"skew"===l?(a[0]&&P.push(`skewX(${a[0]})`),a[1]&&P.push(`skewY(${a[1]})`)):P.push(`${l}(${a.join(" ")})`)}return M.remove=v,M.type=x,M}function Dt(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*C),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=>we(e,t)),y.matrixAtt=`matrix(${y.matrix.join(" ")})`,y}(a,3);return e.transComponents=l,e}function It(e="",t={},{removeInvalid:a=!0,removeDefaults:l=!0,allowDataAtts:r=!0,allowMeta:n=!1,allowAriaAtts:s=!1,cleanUpStrokes:i=!0,include:o=[],removeIds:u=!1,removeClassNames:h=!1,exclude:p=[]}={}){let c={},y=[];u||o.push("id"),h||o.push("class");let f=!!i&&void 0===t.stroke;for(let i in t){let u=t[i],h=Array.isArray(u)?u[0]:u,p=!!a&&(!!Ne.atts[i]&&Ne.atts[i].includes(e));"transform"===i&&"matrix(1 0 0 1 0 0)"===h&&(p=!1);let x=!!r&&i.startsWith("data-"),g=n&&"title"===i,d=s&&i.startsWith("aria-"),m=!!l&&(!!Ne.defaults[i]&&(void 0!==Ne.defaults[i]&&Ne.defaults[i].includes(h))),v=f&&qe.includes(i);(m||x||g||d||v)&&(p=!1),o.includes(i)&&(p=!0),p?c[i]=t[i]:y.push(i)}return{propsFiltered:c,remove:y}}function Tt(e=""){let t=e.split(/,| /);for(let e=0;e<t.length;e++){let a=t[e],l={value:null,unit:"",numeric:!1},r=Qe(a);if(r){if(r){let e=Be(a),t=parseFloat(a);l.value=t,l.unit=e,l.numeric=!0}}else l.value=a;t[e]=l}return t}function jt(e){if(Qe(e))return e;let t=e.split("-").map(e=>e.replace(/a|e|i|o|u/g,"")).join("-");return t=function(e){return e.split(/[-| ]/).map((e,t)=>t?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e.toLowerCase()).join("")}(t),t}function zt(e,{removeHidden:t=!0,stylesToAttributes:a=!0,attributesToGroup:l=!1,removePrologue:r=!0,removeIds:n=!1,removeClassNames:s=!1,removeDimensions:i=!1,fixHref:o=!1,legacyHref:u=!1,cleanupDefs:h=!0,cleanupClip:p=!0,addViewBox:c=!1,addDimensions:y=!1,minifyRgbColors:f=!1,normalizeTransforms:x=!0,autoRoundValues:g=!0,unGroup:d=!1,mergePaths:m=!1,removeOffCanvas:v=!0,cleanupSVGAtts:b=!0,removeNameSpaced:M=!0,allowMeta:A=!1,allowDataAtts:w=!0,allowAriaAtts:C=!0,shapeConvert:S=!1,convert_rects:E=!1,convert_ellipses:P=!1,convert_poly:L=!1,convert_lines:$=!1,convertTransforms:D=!1,removeDefaults:I=!0,cleanUpStrokes:T=!0,decimals:j=-1,excludedEls:z=[]}={}){l&&(a=!0),o&&(e=e.replaceAll("xlink:href=","href="));let q=(new DOMParser).parseFromString(e,"text/html").querySelector("svg"),N=gt(q),{x:F,y:B,width:Q,height:R}=N,O={width:Q,height:R,normalizeTransforms:x,removeDefaults:!1,cleanUpStrokes:!1,allowMeta:A,allowDataAtts:w,allowAriaAtts:C,autoRoundValues:g,removeIds:n,removeClassNames:s,minifyRgbColors:f},_=$t(q,O);O.fontSize=_["font-size"]?_["font-size"][0]:16;let U=q.querySelectorAll("g");if(U.forEach(e=>{let t=$t(e,O);e.querySelectorAll(`${je.join(", ")}`).forEach(e=>{void 0===e.parentStyleProps&&(e.parentStyleProps=[]),e.parentStyleProps.push(t)})}),b){let e=new Set(["viewBox","xmlns","width","height"]);n||e.add("id"),s||e.add("class"),i&&(e.delete("width"),e.delete("height")),e=Array.from(e),a||e.push("fill","stroke","stroke-width","stroke-linecap","stroke-linejoin","font-size","font-family","font-style","style"),function(e,{allowed:t=["viewBox","xmlns","width","height","id","class"],allowAriaAtts:a=!0,allowDataAtts:l=!0,allowMeta:r=!1}={}){[...e.attributes].map(e=>e.name).forEach(n=>{let s=r&&"title"===n,i=a&&n.startsWith("aria-"),o=l&&n.startsWith("data-");t.includes(n)||i||o||s||e.removeAttribute(n)})}(q,{allowed:e,allowMeta:A,allowAriaAtts:C,allowDataAtts:w})}if(!A){q.querySelectorAll("meta, metadata, desc, title").forEach(e=>{e.remove()})}c&&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}=gt(e));e.setAttribute("viewBox",[t,a,l,r].join(" "))}(q,{x:F,y:B,width:Q,height:R}),y&&(q.setAttribute("width",Q),q.setAttribute("height",R)),h&&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()})}(q,{x:F,y:B,width:Q,height:R,cleanupClip:p}),v&&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=Re(e),l={x:0,y:0,width:0,height:0},r=[];switch(t){case"path":l=Oe(Ge(st(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=Oe(r);break;case"polyline":case"polygon":r=Pt(a.points),l=Oe(r)}return l}(e);(t.right<s.x||t.bottom<s.y||t.x>s.right||t.y>t.bottom)&&e.remove()})}(q,{x:F,y:B,width:Q,height:R});let G=["script",...z];!function(e,{remove:t=["metadata","script"],removeNameSpaced:a=!0}={}){let l=e.querySelectorAll("*"),r=!t.includes("metadata");l.forEach(e=>{let l=e.nodeName;!(r&&e.closest("metadata"))&&(a&&l.includes(":")||t.includes(l))&&e.remove()})}(q,{remove:G,removeNameSpaced:M});let V=q.querySelectorAll(`${je.join(", ")}`);for(let e=0;e<V.length;e++){let r=V[e],i=r.nodeName.toLowerCase(),o=r.getAttribute("style")||"",u=!!o&&o.trim().includes("display:none"),h=r.getAttribute("display")&&"none"===r.getAttribute("display")||u;if(i.includes(":")||G.includes(i)||t&&h){r.remove();continue}let p=$t(r,O),c={},{parentStyleProps:y=[]}=r,g={},v=[];y.forEach(e=>{let{transformArr:t=[]}=e;v.push(...t),g={...g,...e}}),v=[...v,...p.transformArr],p.transformArr=v,p={..._,...g,...p},_.class===p.class&&delete p.class,Dt(p,v);let{remove:b,matrix:M,transComponents:k}=p;if((d||D||f)&&(a=!0),a){if(x&&M){let{rotate:e,scaleX:t,scaleY:a,skewX:l,translateX:n,translateY:s}=k;if(!(D||"g"===i||(0!==e||0!==l)||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]}delete p.matrix,delete p.transformArr,delete p.transComponents,b.push("transform"),p=qt(p,{props:["stroke-width","stroke-dasharray"],scale:t})}else r.setAttribute("transform",k.matrixAtt)}c=It(i,p,{removeDefaults:!0,cleanUpStrokes:T,allowMeta:A,allowAriaAtts:C,allowDataAtts:w,removeIds:n}),b=[...b,...c.remove];for(let e in c.propsFiltered){let t=p[e],a=t.length?t.join(" "):t[0];r.setAttribute(e,a)}for(let e=0;e<b.length;e++){let t=b[e];(a||"style"!==t)&&r.removeAttribute(t)}d?U.forEach((e,t)=>{[...e.children].forEach(t=>{e.parentNode.insertBefore(t,e)}),e.remove()}):U.forEach((e,t)=>{Object.keys(Re(e)).forEach(t=>{let a=!w&&t.startsWith("data-"),l=!C&&t.startsWith("aria-");b.push("transform","style"),(b.includes(t)||a||l)&&e.removeAttribute(t)})})}if(D&&(S="toPaths",E=!0,P=!0,L=!0,$=!0),"toPaths"===S){let{matrix:e=null,transComponents:t=null}=p;if(e&&t&&["stroke-width","stroke-dasharray"].forEach(e=>{let a=r.getAttribute(e),l=a?a.split(" ").filter(Boolean).map(Number).map(e=>e*t.scaleX):[];l.length&&r.setAttribute(e,l.join(" "))}),e?Te.includes(i):Se.includes(i)){let t=mt(r,{width:Q,height:R,convert_rects:E,convert_ellipses:P,convert_poly:L,convert_lines:$,matrix:e});r.replaceWith(t),i="path",r=t}}else if("toShapes"===S){q.querySelectorAll("path").forEach(e=>{e=vt(e,{convert_rects:E,convert_ellipses:P,convert_poly:L,convert_lines:$})})}if(m||l){let e={allowMeta:A,allowAriaAtts:C,removeIds:n,removeClassNames:s,allowDataAtts:w};m&&(e.removeIds=!0,e.removeClassNames=!0,e.allowAriaAtts=!1,e.allowMeta=!1),c=It(i,p,e).propsFiltered;for(let e in c){if(Ie.includes(e))continue;let t=c[e],a=t.length?t.join(" "):t[0],l=`${jt(e)}-${jt(a)}`;r.styleSet||(r.styleSet=new Set),r.styleSet.add(l)}}}if(m){let e=q.querySelectorAll("path"),t=e.length;if(t){let a=e[0],l=a.getAttribute("d"),r=void 0!==a.styleSet?[...a.styleSet].join("_"):"";for(let n=1;n<t;n++){let t=e[n],s=void 0!==t.styleSet?[...t.styleSet].join("_"):"",i=t.previousElementSibling===a,o=t.getAttribute("d"),u=o.startsWith("M");if(i&&s===r){l+=u?o:nt(o).pathData.map(e=>`${e.type} ${e.values.join(" ")}`).join(" "),a.setAttribute("d",l),t.remove()}else a=t,l=u?o:nt(o).pathData.map(e=>`${e.type} ${e.values.join(" ")}`).join(" ");r=s}}if(l){let e=q.querySelectorAll(Te.join(", ")),t=e.length,a=e[0]||null,l=void 0!==a.styleSet?[...a.styleSet].join("_"):"",r={},n=[];if(t){let s=[[a]],i=0,o=a;for(let a=0;a<t;a++){let l=e[a],s=Re(l);for(let e in s){let a=`${e}_${s[e]}`;r[a]||(r[a]=[]),r[a].push(l),r[a].length===t&&n.push(e)}}if(n.length){let e=Re(a);for(let t in e)n.includes(t)&&"transform"!==t&&q.setAttribute(t,e[t])}for(let a=1;a<t;a++){let t=e[a],r=void 0!==t.styleSet?[...t.styleSet]:[],n=r.length?r.join("_"):"";n===l&&o.nextElementSibling===t?s[i].push(t):(s.push([t]),i++),l=n,o=t}for(let e=0;e<s.length;e++){let t=s[e],a=t[0],l=Re(a),r=a.parentNode.closest("g");if(1!==t.length){r||(r=document.createElementNS(k,"g"),a.parentNode.insertBefore(r,a),r.append(...t));for(let e in l){let a=l[e];Ie.includes(e)||(n.includes(e)&&"transform"!==e||r.setAttribute(e,a),t.forEach(t=>{t.removeAttribute(e)}))}}else if(n.length){n.includes("transform")&&r.setAttribute("transform",l.transform);for(let e in l)n.includes(e)&&a.removeAttribute(e)}}}}}if(p&&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}=gt(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=st(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=Oe(J(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")})}}})}(q,{x:F,y:B,width:Q,height:R}),u){q.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),q.querySelectorAll("[href]").forEach(e=>{let t=e.getAttribute("href");e.setAttribute("xlink:href",t),e.removeAttribute("href")})}return{svg:q,svgElProps:[]}}function qt(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 Nt(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=ce(y.p0,y.p),l=ce(x.p0,x.p),n=ce(y.p,x.p0),i=He([y.p0,y.p,x.p0,x.p],!1),o=He([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*pe(g[0].p0,g[0].p)?null:X(y.p0,y.p,x.p,x.p0,!1,!0);if(!e){r.push(s);continue}if(e){let t=He([y.p0,y.p,x.p0,x.p],!1),a=Math.abs(t),l=He([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*ce(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 Ft(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=he(d,t),v=H(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:t=0,tolerance:l=1,toCubic:r=!1,debug:n=!1}={}){let s=e.length,i=[e[0]],o=[];for(let t=1;t<s;t++){let l=e[t],{type:s}=l,u=e[t-1],h=e[t+1]?e[t+1]:null,p=e[t+2]?e[t+2]:null,c=e[t+3]?e[t+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=He(v,!1),M=He([...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=Ft(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(ye(ee(g,u.x,u.y,.5*p),m)<.05*ye(g,d)){if(s=ct({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=ot(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=Xe(o);a(markers,e,"orange","0.5%","0.5")}i.push(l),t++;continue}}}i.push(l)}return i}function Qt(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=ye(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 Rt(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 Ot(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=ot(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 _t(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=fe(e,12);({width:a,height:l}=Oe(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 Ut(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=fe(e,12);({width:a,height:l}=Oe(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],pe(s,n)>o&&(i.push(n),s=n)}return s.x!==n.x&&s.y!==n.y&&i.push(n),i}function Gt(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 Vt(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}(Ht(e,Yt(e[1],e[0]),Yt(e[n-2],e[n-1]),t,r));return s}function Ht(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+he(r,l,!1),t.push(n),s=n,l=r;return t=t.map(function(e){return e/s}),t}(e),i=Xt(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=He(e,!1);i||2!==e.length||(i=.01*pe(e[0],e[1]));let o=He(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=Zt(n,e,r);let p=Xt(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=Jt(e[u-1],e[u+1]);if(0===p.x&&0===p.y){p=Jt(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=ea(c,-1);return e.length,h.push(...Ht(e.slice(0,u+1),t,c,l,r),...Ht(e.slice(u),y,a,l,r)),h}function Xt(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]=ea(a,3*s*(i*i)),r[1]=ea(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]+=ta(r[0],r[0]),y[0][1]+=ta(r[0],r[1]),y[1][0]+=ta(r[0],r[1]),y[1][1]+=ta(r[1],r[1]),n=Jt(e[a],Y([o,o,u,u],s)),f[0]+=ta(r[0],n),f[1]+=ta(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=he(o,u,!1),A=1e-6*M;return v<A||b<A?(h[1]=Kt(o,ea(a,.333*M)),h[2]=Kt(u,ea(l,.333*M))):(h[1]=Kt(o,ea(a,v)),h[2]=Kt(u,ea(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+=he(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=Wt(a[s],u,10),p=Y(t,o),l=pe(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 Zt(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=aa(e,a),i=r*s[0]+n*s[1],o=s[0]*s[0]+s[1]*s[1],u=aa(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 Wt(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 Yt(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 Jt(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Kt(e,t){return{x:e.x+t.x,y:e.y+t.y}}function ea(e,t){return{x:e.x*t,y:e.y*t}}function ta(e,t){return e.x*t.x+e.y*t.y}function aa(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 la(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=Oe(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=He([a,l,t<s-1?e[t+1]:e[s-1]],!1);l.area=r,l.dist=ce(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];pe(a,r),Math.abs(a.area);let n=Math.abs(l.area);Math.abs(r.area);let u=!1,h=!l.area||n<o;ce(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=Oe([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=H(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=ce(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=Vt(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 ra(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?W(o,u,.5):o;c=.2*(ce(s,e)+ce(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=Ut(p,{quality:n+"px"})),s>0&&(p=_t(p,{quality:s+"px"})),o=Gt(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||ce(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:we(e.x,r),y:we(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 na(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=W(n,o,.333),l=W(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 sa(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":yt(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=He(l)>=0;a.push({pts:l,bb:Oe(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)||Z({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=St(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=St(e[l].pathData),a[l].cw=!a[l].cw)}}return e}function ia(e="",{getObject:t=!1,toAbsolute:a=!1,toRelative:l=!0,toMixed:r=!1,toShorthands:n=!0,toLonghands:s=!1,quadraticToCubic:i=!0,arcToCubic:o=!1,cubicToArc:u=!1,simplifyBezier:h=!0,optimizeOrder:p=!0,autoClose:c=!1,removeZeroLength:y=!0,refineClosing:f=!0,removeColinear:x=!0,flatBezierToLinetos:g=!0,revertToQuadratics:d=!0,refineExtremes:m=!0,simplifyCorners:v=!1,removeDimensions:b=!1,removeIds:M=!1,removeClassNames:A=!1,omitNamespace:w=!1,fixDirections:C=!1,keepExtremes:k=!0,keepCorners:S=!0,extrapolateDominant:E=!0,keepInflections:P=!1,addExtremes:L=!1,addSemiExtremes:$=!1,toPolygon:D=!1,smoothPoly:I=!1,polyFormat:T="points",precisionPoly:j=1,simplifyRD:z=1,simplifyRDP:q=1,harmonizeCpts:N=!1,removeOrphanSubpaths:F=!1,simplifyRound:B=!1,scale:Q=1,scaleTo:R=0,crop:O=!1,alignToOrigin:_=!1,convertTransforms:U=!1,decimals:G=3,autoAccuracy:V=!0,minifyD:H=0,tolerance:X=1,reversePath:Z=!1,minifyRgbColors:W=!0,removePrologue:Y=!0,removeHidden:K=!0,removeUnused:ee=!0,cleanupDefs:te=!0,cleanupClip:ae=!0,cleanupSVGAtts:le=!0,stylesToAttributes:re=!1,fixHref:ne=!1,legacyHref:se=!1,removeNameSpaced:ie=!0,allowMeta:oe=!1,allowDataAtts:ue=!0,allowAriaAtts:he=!0,attributesToGroup:pe=!1,removeOffCanvas:ce=!1,unGroup:ye=!1,mergePaths:fe=!1,shapesToPaths:xe=!1,shapeConvert:de=0,convert_rects:me=!1,convert_ellipses:be=!1,convert_poly:Me=!1,convert_lines:we=!1,lineToCubic:Ce=!1,cleanUpStrokes:ke=!0,addViewBox:Se=!1,addDimensions:Ee=!1,removeComments:Pe=!0}={}){X=Math.max(.1,X),Q=Math.max(.001,Q);let Le=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),$e="",De=0,Ie=0,Te=0,je={},ze="",qe="svgMarkup"===Le?1:0,Ne=[],Fe=[],Be=[],Qe="";De=e.length;let Re={x:0,y:0,width:0,height:0},_e={x:0,y:0,width:0,height:0},Ue=[],Ge=[];o=!!D||o;let Ve=[];if("svgMarkup"!==Le){if("pathDataString"===Le)ze=e;else if("polyString"===Le)ze="M"+e;else if("polyArray"===Le||"polyObjectArray"===Le||"polyComplexArray"===Le||"polyComplexObjectArray"===Le){ze=Gt(Pt(e)),Qe=ze.map(e=>`${e.type} ${e.values.join(" ")}`).join(" "),De=Qe.length}else"pathData"===Le&&(ze=e,Qe=Array.from(ze).map(e=>`${e.type} ${e.values.join(" ")}`).join(" "),De=Qe.length);Fe.push({d:ze,el:null})}else{xe&&(de="toPaths",me=!0,be=!0,Me=!0,we=!0),$e=zt(e,{removeIds:M,removeClassNames:A,removeDimensions:b,cleanupSVGAtts:le,cleanUpStrokes:ke,removeHidden:K,removeUnused:ee,removeNameSpaced:ie,stylesToAttributes:re,removePrologue:Y,fixHref:ne,mergePaths:fe,convertTransforms:U,legacyHref:se,cleanupDefs:te,cleanupClip:ae,addViewBox:Se,removeOffCanvas:ce,addDimensions:Ee,shapeConvert:de,convert_rects:me,convert_ellipses:be,convert_poly:Me,convert_lines:we,minifyRgbColors:W,unGroup:ye,convertTransforms:U,allowMeta:oe,allowDataAtts:ue,allowAriaAtts:he,allowMeta:oe,attributesToGroup:pe}).svg,$e.querySelectorAll("path").forEach((e,t)=>{Fe.push({d:e.getAttribute("d"),el:e,idx:t})}),Re=gt($e,G)}let He={toRelative:l,toMixed:r,toAbsolute:a,toLonghands:s,toShorthands:n,decimals:G},Ze=[];for(let e=0,t=Fe.length;t&&e<t;e++){let t=[],a=Fe[e],{d:l,el:r}=a,n=st(l,{quadraticToCubic:i,arcToCubic:o}),s=I||D?Oe(J(n)):null;if(1!==Q||R){if(R)if(Re.width&&!O)Q=R/Re.width;else{let e=n.map(e=>({type:e.type,values:e.values}));e=it(e,{arcToCubic:!0}),e=ve(e);let t=Oe(J(e));Ue.push(t.x,t.x+t.width),Ge.push(t.y,t.y+t.height);let a=R/t.width;Q=a}n=Rt(n,Q)}let c=n.length;F&&(n=Mt(n));let b=ge(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),i=/[z]/gi.test(r);if(n)l=J(a),z>0&&(l=Ut(l,{quality:z+"px"})),q>0&&(l=_t(l,{quality:q+"px"})),a=Gt(l,i);else if(D){h=!1,I=!1;let e=Ke(a),{bb:t,pathData:l}=e;a=l;let r=ra(a,{precisionPoly:j,autoAccuracy:V,polyFormat:T,decimals:G,simplifyRD:z,simplifyRDP:q});Be.push(r.poly),a=r.pathData}if(I&&n){a=At(a),a=la(J(a),{denoise:.8,tolerance:X,width:s.width,height:s.height,manhattan:!1,absolute:!1,keepCorners:S,keepExtremes:k,keepInflections:P,closed:i,simplifyRD:z,simplifyRDP:q})}(x||y)&&(a=At(a)),p&&(a=wt(a)),x&&(a=bt(a,{tolerance:X,flatBezierToLinetos:!1})),(L||$)&&(a=ve(a,{tMin:0,tMax:1,addExtremes:L,addSemiExtremes:$,angles:[30]})),Z&&(a=St(a));let c=Ke(a,{detectSemiExtremes:$}),{pathData:M,bb:A,dimA:w}=c;if(Ue.push(A.x,A.x+A.width),Ge.push(A.y,A.y+A.height),f&&(M=Qt(M,{threshold:.001*w})),M=h?We(M,{simplifyBezier:h,keepInflections:P,keepExtremes:k,keepCorners:S,extrapolateDominant:E,revertToQuadratics:d,tolerance:X}):M,m){M=Et(M,{threshold:.05*(A.width+A.height),tolerance:X})}if(!o&&u&&(M=ft(M,{areaThreshold:2.5})),x&&g&&(M=bt(M,{tolerance:X,flatBezierToLinetos:g})),v){M=Nt(M,{threshold:.1*(A.width+A.height),tolerance:X})}if(B&&(M=Bt(M)),d&&(M=Ot(M,X)),Ce&&(M=na(M)),p&&(M=Ct(M,{autoClose:false})),V){let e=Ae(M);Ve.push(e)}t.push({pathData:M,bb:A})}let A=Math.min(...Ue),w=Math.min(...Ge);_e={x:A,y:w,width:Math.max(...Ue)-A,height:Math.max(...Ge)-w};let N=_e.height>_e.width;if(p&&(t=N?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)),C&&(t=sa(t)),n=[],Ne.push(t),t.forEach(e=>{n.push(...e.pathData)}),V){Ve=Ve.sort().reverse();let e=Ve[Math.floor(.5*Ve.length)];G=Math.floor(.5*(Ve[0]+e)),He.decimals=G}if(fe=!1,r&&fe)Ze.push(...n);else{n=JSON.parse(JSON.stringify(n)),n=it(n,He),y&&(n=At(n)),_&&(n[0].values[0]=(n[0].values[0]-_e.x).toFixed(G),n[0].values[1]=(n[0].values[1]-_e.y).toFixed(G),_e.x=0,_e.y=0);let e=n.length,t=Xe(n,H);Ie=t.length,Te=+(100/De*Ie).toFixed(2),a.d=t,a.report={original:c,new:e,saved:c-e,compression:Te,decimals:G},r&&r.setAttribute("d",t)}}if(qe){if(Ze.length){let e=it(Ze,He);e=At(e);let t=Xe(e,H);Fe[0].el.setAttribute("d",t);for(let e=1;e<Fe.length;e++){let t=Fe[e].el;t&&t.remove()}!function(e){e.querySelectorAll("g, defs").forEach(e=>{e.children.length||e.remove()})}($e)}if(Q){let{x:e,y:t,width:a,height:l,w:r,h:n,hasViewBox:s,hasWidth:i,hasHeight:o,widthUnit:u,heightUnit:h}=Re;O&&(e=_e.x,t=_e.y,a=_e.width,l=_e.height,r=a,n=l),s&&$e.setAttribute("viewBox",[e,t,a,l].map(e=>+(e*Q).toFixed(G)).join(" ")),i&&$e.setAttribute("width",+(r*Q).toFixed(G)+u),o&&$e.setAttribute("height",+(n*Q).toFixed(G)+h)}if(C){$e.querySelectorAll("path[fill-rule], path[clip-rule]").forEach(e=>{e.removeAttribute("fill-rule"),e.removeAttribute("clip-rule")})}$e=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(" ","\n"),l}($e,{omitNamespace:w,removeComments:Pe}),Ie=$e.length,Te=+(100/De*Ie).toFixed(2),De=+(De/1024).toFixed(3),Ie=+(Ie/1024).toFixed(3),je={svgSize:De,svgSizeOpt:Ie,compression:Te,decimals:G}}else({d:ze,report:je}=Fe[0]);return Be.length&&1===Be.length&&(Be=Be[0]),t?{svg:$e,d:ze,polys:Be,report:je,pathDataPlusArr:Ne,inputType:Le}:ze||$e}"undefined"!=typeof window&&(window.svgPathSimplify=ia,window.getElementTransform=xe,window.getViewBox=gt),e.PI=A,e.abs=l,e.acos=r,e.asin=n,e.atan=s,e.atan2=i,e.ceil=o,e.cos=u,e.exp=h,e.floor=p,e.getElementTransform=xe,e.getViewBox=gt,e.hypot=y,e.log=c,e.max=f,e.min=x,e.pow=g,e.random=d,e.round=m,e.sin=v,e.sqrt=b,e.svgPathSimplify=ia,e.tan=M}(this["svg-path-simplify"]=this["svg-path-simplify"]||{});
|
|
3
|
+
if(M){let e="C"===a?Math.abs(l.cp2.x-l.p.x):Math.abs(l.cp1.x-l.p.x),t="C"===a?Math.abs(l.cp2.y-l.p.y):Math.abs(l.cp1.y-l.p.y);if(((0===t||t<=A)&&e>0||(0===e||e<=A)&&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=se(v);e.length&&e[0]>.2&&(C=!0)}}}if(C&&(l.extreme=!0),M&&w){if(n&&!l.extreme){let e=Math.abs(i.x-u.x),t=Math.abs(i.y-u.y),a=!1;if(e&&t&&e>b||t>b){let e=U(u,i),t=U(i,g.cp1);a=ue(Math.abs(e+t)/2)}a&&(l.semiExtreme=!0)}if((l.cptArea<0&&g.cptArea>0||l.cptArea>0&&g.cptArea<0)&&(l.directionChange=!0),!l.extreme){let e=u||o,t=g.cp1,a=Ze([e,i,t],!1),r=.01*pe(e,t),n=Math.abs(a)<r,s=a<0&&l.cptArea>0||a>0&&l.cptArea<0;!n&&s&&(l.corner=!0)}}d.push(l)}return s&&d.forEach(e=>{e.directionChange&&t(markers,e.p,"orange","1.5%","0.5"),e.corner&&t(markers,e.p,"magenta","1.5%","0.5"),e.extreme&&t(markers,e.p,"cyan","1%","0.5")}),u={pathData:d,bb:h,dimA:(x+m)/2},u}function et(e,{addSquareLength:t=!0,addArea:l=!1,addArcParams:a=!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=ce(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&&a){let{rx:e,ry:t,cx:l,cy:a,startAngle:r,endAngle:n,deltaAngle:s}=K(i.x,i.y,...y);p.cx=l,p.cy=a,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=pe(i,o)),l){let e=0;"C"===c&&(e=Ze([i,n,u,o],!1)),"Q"===c&&(e=Ze([i,n,o],!1)),p.cptArea=e}p.idx=r,i=o,h.push(p)}return h}const tt=new Set([77,109,65,97,67,99,76,108,81,113,83,115,84,116,72,104,86,118,90,122]),lt=new Uint8Array(128);lt[77]=2,lt[109]=2,lt[65]=7,lt[97]=7,lt[67]=6,lt[99]=6,lt[76]=2,lt[108]=2,lt[81]=4,lt[113]=4,lt[83]=4,lt[115]=4,lt[84]=2,lt[116]=2,lt[72]=1,lt[104]=1,lt[86]=1,lt[118]=1,lt[90]=0,lt[122]=0;const at=new Set([5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279]),rt=e=>32===e||44===e||10===e||13===e||8232===e||8233===e||9===e||11===e||12===e||160===e||e>=5760&&at.has(e);function nt(e,t=!0,l=0){if(!e)return[];e=e.trim(),l&&console.log("!!!limit",l);let a={pathData:[],hasRelatives:!1,hasShorthands:!1,hasArcs:!1,hasQuadratics:!1,isPolygon:!1,log:[]};if(""===e)return a;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 m=()=>{f&&("M"===i?i="L":"m"===i&&(i="l"),a.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",a.log.push(r),i="M",a.pathData.push({type:i,values:[]}),y=2,c=0,o++),"A"===i||"a"===i?(({val:u,valueIndex:c}=((e="",t=0)=>{let l=e.length;return 3===t&&2===l?(e=[+e[0],+e[1]],t++):4===t&&l>1?(e=[+e[0],+e.substring(1)],t++):3===t&&l>=3?(e=[+e[0],+e[1],+e.substring(2)],t+=2):e=[+e],{val:e,valueIndex:t}})(u,c)),a.pathData[o].values.push(...u)):(t&&u[1]&&"."!==u[1]&&"0"===u[0]&&(r=`${o}. command: Leading zeros not valid: ${u}`,a.log.push(r)),a.pathData[o].values.push(+u)),c++,u="",p=0,f=c>=y)},g=()=>{if(o>0){let e=a.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`,a.log[a.log.length-1]!==r&&a.log.push(r)}}};let v=!1,b=!1,A=!1,M="";for(;n<s;){M=e.charCodeAt(n);let l=M>47&&M<58;if(l||(v=101===M||69===M,b=45===M||43===M,A=46===M),l||b||A||v){if(h||45!==M&&46!==M)m();else{let e=46===M;d(e),m(),e&&p++}u+=e[n],h=v,n++}else if((M<48||M>5759)&&rt(M))d(),n++;else{if(M>64){if(!tt.has(M)){r=`${o}. command "${e[n]}" is not a valid type`,a.log.push(r),n++;continue}""!==u&&(a.pathData[o].values.push(+u),c++,u=""),t&&g(),i=e[n],y=lt[M];let l="M"===i||"m"===i,s=o>0&&("z"===a.pathData[o].type||"Z"===a.pathData[o].type);x.add(i),s&&!l&&(a.pathData.push({type:"m",values:[0,0]}),o++),a.pathData.push({type:i,values:[]}),o++,p=0,c=0,f=!1,n++;continue}l||(r=`${o}. ${e[n]} is not a valid separarator or token`,a.log.push(r),u=""),n++}}d(),t&&g(),t&&a.log.length&&(r="Invalid path data:\n"+a.log.join("\n"),"log"===t||console.warn(r)),a.pathData[0].type="M";let w=Array.from(x).join("");return a.hasRelatives=/[lcqamtsvh]/g.test(w),a.hasShorthands=/[vhst]/gi.test(w),a.hasArcs=/[a]/gi.test(w),a.hasQuadratics=/[qt]/gi.test(w),a.isPolygon=!/[cqats]/gi.test(w),a}function st(e,{toAbsolute:t=!0,toLonghands:l=!0,quadraticToCubic:a=!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:nt(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:l=!0,quadraticToCubic:a=!1,arcToCubic:r=!1,arcAccuracy:n=2,hasRelatives:s=!0,hasShorthands:i=!0,hasQuadratics:o=!0,hasArcs:u=!0,testTypes:h=!1}={}){return it(e,{toAbsolute:t,toLonghands:l,quadraticToCubic:a,arcToCubic:r,arcAccuracy:n,hasRelatives:s,hasShorthands:i,hasQuadratics:o,hasArcs:u,testTypes:h,decimals:-1})}(y,{toAbsolute:t,toLonghands:l,quadraticToCubic:a,arcToCubic:r,arcAccuracy:n,hasRelatives:u,hasShorthands:h,hasQuadratics:p,hasArcs:c}),y}function it(e,{toShorthands:t=!0,toLonghands:l=!1,toRelative:a=!0,toMixed:r=!1,toAbsolute:n=!1,decimals:s=3,arcToCubic:i=!1,quadraticToCubic:o=!1,hasRelatives:u=!0,hasShorthands:h=!0,hasQuadratics:p=!0,hasArcs:c=!0,isPoly:y=!1,optimizeArcs:f=!0,testTypes:x=!1}={}){let m=[];if(x){let t=Array.from(new Set(e.map(e=>e.type))).join("");/[lcqamts]/gi.test(t),p=/[qt]/gi.test(t),c=/[a]/gi.test(t),h=/[vhst]/gi.test(t),/[mlz]/gi.test(t)}if(a=!n&&a,t=!l&&t,n&&(e=pt(e)),h&&l&&(e=function(e,t=-1,l=!0){let a=!1;if(l){let t=e.map(e=>e.type).join(""),l=/[hstv]/gi.test(t);if(a=/[astvqmhlc]/g.test(t),!l)return e}e=l&&a?pt(e,t):e;let r=[],n={type:"M",values:e[0].values};r.push(n);for(let l=1,a=e.length;l<a;l++){let a,s,i,o,u,h,p,c,y=e[l],{type:f,values:x}=y,m=x.length,d=n.values,g=d.length,[v,b]=[x[m-2],x[m-1]],[A,M]=[d[g-2],d[g-1]];switch(f){case"H":n={type:"L",values:[x[0],M]};break;case"V":n={type:"L",values:[A,x[0]]};break;case"T":[a,s]=[d[0],d[1]],[A,M]=[d[g-2],d[g-1]],i=A+(A-a),o=M+(M-s),n={type:"Q",values:[i,o,v,b]};break;case"S":[a,s]=[d[0],d[1]],[A,M]=[d[g-2],d[g-1]],[p,c]=g>2&&"A"!==n.type?[d[2],d[3]]:[A,M],i=2*A-p,o=2*M-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)),f&&(e=function(e=[]){let t=[];e.forEach((l,a)=>{let{type:r,values:n}=l;if("A"===r){let[l,r,s,i,o]=[n[0],n[1],n[3],n[5],n[6]],u=e[a-1],[h,p]=[u.values[u.values.length-2],u.values[u.values.length-1]],c={x:h,y:p},y={x:i,y:o};if(0!==l&&0!==r||(e[a]=null,t.push(a)),l>=1&&(i===h||o===p)){if(Math.abs(l-r)/l<.01){let t=he(J(c,y,.5),c);Math.abs(t-l)/l<.01&&(e[a].values[0]=1,e[a].values[1]=1,e[a].values[2]=0)}}}}),t.length&&(e=e.filter(Boolean));return e}(e)),t&&(e=function(e,t=-1,l=!1){let a;if(l){let t=e.map(e=>e.type).join("");a=/[astvqmhlc]/g.test(t)}e=l&&a?ht(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 l=e[t];s=l;let{type:a,values:r}=l,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*ce(i,o),x=!1,m=!1,d=!1;if("C"===a&&"C"===p.type||"Q"===a&&"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]},l=i.x-e.x,a=i.y-e.y;f=.01*ce(e,t),x=ce({x:e.x+2*l,y:e.y+2*a},t)<f}else"L"===a&&(m=0===y||y<f,d=0===c||c<f,x=d||m);switch(a){case"L":m&&(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:a,values:r}}i=o,n[t]=s}return n}(e)),c&&i&&(e=function(e,{arcAccuracy:t=1}={}){let l=[e[0]];for(let a=1,r=e.length;a<r;a++){let r=e[a],n=e[a-1].values,s=n.length,i={x:n[s-2],y:n[s-1]};if("A"===r.type){yt(i,r.values,t).forEach(e=>{l.push(e)})}else l.push(r)}return l}(e)),p&&o&&(e=function(e){let t=[e[0]];for(let l=1,a=e.length;l<a;l++){let a=e[l],r=e[l-1].values,n=r.length,s={x:r[n-2],y:r[n-1]};"Q"===a.type?t.push(ut(s,a.values)):t.push(a)}return t}(e)),r&&(a=!0),s>-1&&a&&(e=ke(e,s)),r&&(m=JSON.parse(JSON.stringify(e))),a&&(e=function(e,t=-1){return ht(e,!0,t)}(e)),s>-1&&(e=ke(e,s)),r)for(let t=0;t<e.length;t++){let l=e[t],a=m[t],r=[l.type,l.values.join(" ")].join("").replaceAll(" -","-").replaceAll(" 0."," ."),n=[a.type,a.values.join(" ")].join("").replaceAll(" -","-").replaceAll(" 0."," ."),s=r.length;n.length<s&&(e[t]=m[t])}return e}function ot(e={},t={},l={},a={},r=1){let n=J(e,t,1.5),s=J(a,l,1.5),i=.01*ce(e,a)*r,o=ce(n,s),u=null,h={type:"C",values:[t.x,t.y,l.x,l.y,a.x,a.y]};return o<i&&(u=W(e,t,a,l,!1,!0),u&&(h.type="Q",h.values=[u.x,u.y,a.x,a.y],h.p0=e,h.cp1=u,h.cp2=null,h.p=a)),h}function ut(e,t){Array.isArray(e)&&(e={x:e[0],y:e[1]});let l={x:e.x+2/3*(t[0]-e.x),y:e.y+2/3*(t[1]-e.y)},a={x:t[2]+2/3*(t[0]-t[2]),y:t[3]+2/3*(t[1]-t[3])};return{type:"C",values:[l.x,l.y,a.x,a.y,t[2],t[3]]}}function ht(e,t=!1,l=-1){l>=0&&(e[0].values=e[0].values.map(e=>+e.toFixed(l)));let a=e.length,r=e[0].values,n=r[0],s=r[1],i=n,o=s;for(let r=1;r<a;r++){let a=e[r],{type:u,values:h}=a,p=h.length,c=u.toLowerCase(),y=u.toUpperCase(),f=t?c:y;if(u!==f)switch(a.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)}l>=0&&(a.values=a.values.map(e=>+e.toFixed(l)))}return e}function pt(e,t=-1){return ht(e,!1,t)}function ct({p0:e={x:0,y:0},p:t={x:0,y:0},centroid:l={x:0,y:0},rx:a=0,ry:r=0,xAxisRotation:n=0,radToDegree:s=!1,startAngle:i=null,endAngle:o=null,deltaAngle:u=null}={}){if(!a||!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}=Z(l,e,t));let x=a!==r?le(i,a,r):i,m=a!==r?le(u,a,r):u,d=Math.max(1,Math.ceil(Math.abs(m)/p)),g=m/d;for(let e=0;e<d;e++){const e=Math.abs(g)===p?.551785*Math.sign(g):4/3*Math.tan(g/4);let t=Math.cos(x),n=Math.sin(x),s=Math.cos(x+g),i=Math.sin(x+g),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*a,n=e.y*r;o.push(y*t-f*n+l.x,f*t+y*n+l.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+=g}return h}function yt(e,t,l=1){const a=2*Math.PI;let[r,n,s,i,o,u,h]=t;if(0===r||0===n)return[];let p=s?s*a/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 m=f*f/(r*r)+x*x/(n*n);if(m>1){let e=Math.sqrt(m);r*=e,n*=e}let d=r*r,g=r===n?d:n*n,v=f*f,b=x*x,A=d*g-d*b-g*v;A<=0?A=0:(A/=d*b+g*v,A=Math.sqrt(A)*(i===o?-1:1));let M=A?A*r/n*x:0,w=A?A*-n/r*f:0,C=y*M-c*w+(e.x+u)/2,k=c*M+y*w+(e.y+h)/2,S=(f-M)/r,E=(x-w)/n,P=(-f-M)/r,D=(-x-w)/n;const L=(e,t,l,a)=>{let r=+(e*l+t*a).toFixed(9);return 1===r||-1===r?1===r?0:Math.PI:(r=r>1?1:r<-1?-1:r,(e*a-t*l<0?-1:1)*Math.acos(r))};let $=L(1,0,S,E),T=L(S,E,P,D);0===o&&T>0?T-=2*Math.PI:1===o&&T<0&&(T+=2*Math.PI);let N=(+(Math.abs(T)/(a/4)).toFixed(0)||1)*l;T/=N;let q=[];const j=1.5707963267948966,z=.551785;let I=T===j?z:T===-j?-z:4/3*Math.tan(T/4),B=T?Math.cos(T):1,F=T?Math.sin(T):0;const O=(e,t,l,a,r)=>{let n=e!=t?Math.cos(e):a,s=e!=t?Math.sin(e):r,i=Math.cos(e+t),o=Math.sin(e+t);return[{x:n-s*l,y:s+n*l},{x:i+o*l,y:o-i*l},{x:i,y:o}]};for(let e=0;e<N;e++){let e={type:"C",values:[]};O($,T,I,B,F).forEach(t=>{let l=t.x*r,a=t.y*n;e.values.push(y*l-c*a+C,c*l+y*a+k)}),q.push(e),$+=T}return q}function ft(e,{areaThreshold:t=2.5}={}){for(let l=0,a=e.length;l<a;l++){let a=e[l],r=e[l+1]||null,{type:n,values:s,p0:i,cp1:o=null,cp2:u=null,p:h=null}=a;if("C"===n&&r&&"C"===r.type){let a=xt(i,o,u,h,t),n=xt(r.p0,r.cp1,r.cp2,r.p,t);if(a.isArc&&n.isArc){let t=.01*ce(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}=a,f=Ze([i,h,r.p])<0?0:1;if(p||u){c=Math.min(c,n.rx),y=Math.min(y,n.ry),e[l]=null,e[l+1].type="A",e[l+1].values=[c,y,0,0,f,r.p.x,r.p.y];continue}}}}return e=e.filter(Boolean)}function xt(e,t,l,a,r=7.5){let n,s={type:"C",values:[t.x,t.y,l.x,l.y,a.x,a.y]},i=0,o=!1,u=U(e,t,!0),h=U(a,l,!0),p=180*Math.abs(u-h)/Math.PI,c=0,y=0;if(Math.abs(p%180-90)<3){n=W(e,ee(t,e.x,e.y,-.5*Math.PI),a,ee(l,a.x,a.y,.5*Math.PI),!1);let u=W(e,t,a,l,!1);if(u){let n=he(e,u),h=he(a,u),p=+Math.max(n,h).toFixed(8),f=+Math.min(n,h).toFixed(8);c=f,y=p;let x=Ze([e,t,l,a])<0?0:1,m=Math.abs(a.x-e.x)>Math.abs(a.y-e.y);100/c*Math.abs(c-y)<5&&(c=p,y=c),m&&(c=p,y=f);let d=Ue([{type:"M",values:[e.x,e.y]},{type:"C",values:[t.x,t.y,l.x,l.y,a.x,a.y]}]),g={type:"A",values:[c,y,0,0,x,a.x,a.y]};i=Math.PI*(c*y)/4,i-=Math.abs(Ze([e,a,u])),function(e,t){let l=Math.abs(e-t);return Math.abs(100-100/e*(e+l))}(d,i)<r&&(o=!0,s=g)}}return{com:s,isArc:o,area:i,rx:c,ry:y,centroid:n}}function mt(e=null,{autoRoundValues:t=!0,decimals:l=-1}={}){if(!e)return!1;let a=e.hasAttribute("width"),r=e.hasAttribute("height"),n=e.hasAttribute("viewBox"),s=a?e.getAttribute("width"):0,i=r?e.getAttribute("height"):0,o=s?s.includes("%")?0:Be(s,{isHorizontal:!0}):300,u=i?i.includes("%")?0:Be(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=>Ce(e)),h=h.map(e=>Ce(e))):!t&&l>-1&&([o,u]=[o,u].map(e=>+e.toFixed(l)),h=h.map(e=>+e.toFixed(l)));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:a,hasHeight:r,widthUnit:"",heightUnit:""}}function dt(e,t){let l=[];const a=(e,t)=>{let{a:l,b:a,c:r,d:n,e:s,f:i}=t,{x:o,y:u}=e;return{x:l*o+r*u+s,y:a*o+n*u+i}},r=(e,t,l)=>{let[r,n,s,i,o,u,h]=t,p=K(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:m,f:d}=l,g=function(e,t,l,a){const r=Math.PI/180,n=1e-7;a=Array.isArray(a)?{a:a[0],b:a[1],c:a[2],d:a[3],e:a[4],f:a[5]}:a;let s=Math.cos(l*r),i=Math.sin(l*r),o=[e*(a.a*s+a.c*i),e*(a.b*s+a.d*i),t*(-a.a*i+a.c*s),t*(-a.b*i+a.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:l=0};if(Math.abs(p-Math.abs(u-h))<=n)return{rx:e=Math.sqrt(u),ry:t=Math.sqrt(h),ax:l=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 l=0,{rx:e=Math.sqrt(x),ry:t=Math.sqrt(f),ax:l};(l=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)):(l+=90,e=Math.sqrt(x),t=Math.sqrt(f));return{rx:e,ry:t,ax:l}}(r,n,s,l),v=a({x:u,y:h},l),b=c*c+y*y,A=Math.sqrt(b);return(A<0||(c*x-f*y)/A<0)&&(o=0===o?1:0),{type:"A",values:[g.rx,g.ry,g.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 l=a({x:n.values[e],y:n.values[e+1]},t);y.values[e]=l.x,y.values[e+1]=l.y}l.push(y)}),l)}function gt(e,{width:t=0,height:l=0,convertShapes:a=[],matrix:r=null}={}){let n=e.nodeName.toLowerCase();if(!a.includes(n))return e;let s=function(e,{stringify:t=!1,width:l=0,height:a=0}={}){let r,n,s,i,o,u,h,p,c,y,f,x,m=[],d=e.nodeName.toLowerCase();if(!l||!a){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=mt(t);l=r.width,a=r.height}let g=function(e,{width:t=0,height:l=0,fontSize:a=16,dpi:r=96,autoRoundValues:n=!1,decimals:s=-1}={}){let i=[...e.attributes].map(e=>e.name),o=[];i.forEach(t=>{o.push(e.getAttribute(t))});let u=t===l,h={};return i.forEach((a,r)=>{let s=Ee.includes(a),i=Pe.includes(a),p=!u&&"r"===a,c=Be(o[r],{isHorizontal:s,isVertical:i,width:t,height:l,normalizedDiagonal:p,autoRoundValues:n});h[a]=c,e.setAttribute(a,c)}),h}(e,{width:l,height:a});switch(d){case"path":r=e.getAttribute("d"),m=st(r);break;case"rect":({x:n=0,y:s=0,width:l=0,height:a=0,rx:o=0,ry:u=0}=g),m=function(e=0,t=0,l=0,a=0,r=0,n=0){let s=[];r||n?(r=r||n,n=n||r,r>l/2&&(r=l/2),n>a/2&&(n=a/2),s=[{type:"M",values:[e+r,t]},{type:"L",values:[e+l-r,t]},{type:"A",values:[r,n,0,0,1,e+l,t+n]},{type:"L",values:[e+l,t+a-n]},{type:"A",values:[r,n,0,0,1,e+l-r,t+a]},{type:"L",values:[e+r,t+a]},{type:"A",values:[r,n,0,0,1,e,t+a-n]},{type:"L",values:[e,t+n]},{type:"A",values:[r,n,0,0,1,e+r,t]},{type:"Z",values:[]}]):s=[{type:"M",values:[e,t]},{type:"L",values:[e+l,t]},{type:"L",values:[e+l,t+a]},{type:"L",values:[e,t+a]},{type:"Z",values:[]}];return s}(n,s,l,a,o,u);break;case"circle":case"ellipse":({cx:h=0,cy:p=0,r:i,rx:o,ry:u}=g);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;m=[{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}=g),m=[{type:"M",values:[c,f]},{type:"L",values:[y,x]}];break;case"polygon":case"polyline":let A=e.getAttribute("points").split(/,| /).filter(Boolean).map(Number);for(let e=0;e<A.length;e+=2)m.push({type:0===e?"M":"L",values:[A[e],A[e+1]]});"polygon"===d&&m.push({type:"Z",values:[]})}return t?function(e){return e.map(e=>`${e.type} ${e.values.join(" ")}`).join(" ")}(m):m}(e,{width:t,height:l}),i=["d","x","y","x1","y1","x2","y2","cx","cy","dx","dy","r","rx","ry","width","height","points"];r&&"100100"!==Object.values(r).join("")&&(s=dt(s,r),i.push("transform","transform-origin"));let o=s.map(e=>`${e.type} ${e.values} `).join(" "),u=[...e.attributes].map(e=>e.name),h=document.createElementNS(k,"path");return h.setAttribute("d",o),u.forEach(t=>{if(!i.includes(t)){let l=e.getAttribute(t);h.setAttribute(t,l)}}),h}function vt(e,{convertShapes:t=[]}={}){let l=st(e.getAttribute("d")),a=Array.from(new Set(l.map(e=>e.type))).join(""),r=/[a]/gi.test(a),n=/[csqt]/gi.test(a),s=/[l]/gi.test(a),i=!/[acqts]/gi.test(a),o=/[z]/gi.test(a),u=null,h=null,p=Re(e),c={};if(i)if(2===l.length&&t.includes("line")){h="line",u=document.createElementNS(k,h);let[e,t,a,r]=[...l[0].values,...l[1].values].map(e=>we(e,7));c={x1:e,y1:t,x2:a,y2:r}}else{let e=_(l),a=Qe(e),r=Ze(e,!0),n=a.width*a.height,s=Math.abs(1-n/r);if(t.includes("rect")&&s<.01){h="rect",u=document.createElementNS(k,h);let{x:e,y:t,width:l,height:r}=a;c={x:e,y:t,width:l,height:r}}else if(t.includes("polygon")||t.includes("polyline")){h=o?"polygon":"polyline",u=document.createElementNS(k,h),c={points:e.map(e=>[e.x,e.y]).flat().map(e=>we(e,7)).join(" ")}}}else if(!s&&(t.includes("circle")||t.includes("ellipse"))&&(!r&&n&&(l=ft(l,{areaThreshold:2.5}),r=l.filter(e=>"A"===e.type).length),r)){let e=et(l,{addArcParams:!0}),t=e.filter(e=>"A"===e.type),a=new Set,r=new Set,n=new Set,s=new Set;if(t.length>1&&e.forEach(e=>{"A"===e.type&&(a.add(we(e.cx,7)),r.add(we(e.cy,7)),n.add(we(e.rx,7)),s.add(we(e.ry,7)))}),a=Array.from(a),r=Array.from(r),n=Array.from(n),s=Array.from(s),1===a.length&&1===r.length&&1===n.length&&1===s.length){let[e,t,l,i]=[n[0],s[0],a[0],r[0]];h=e===t?"circle":"ellipse",u=document.createElementNS(k,h),c="circle"===h?{r:e,cx:l,cy:i}:{rx:e,ry:t,cx:l,cy:i}}}if(u){let t=["id","class"];for(let e in c)u.setAttribute(e,c[e]);for(let e in p)(Ie.atts[e].includes(h)||t.includes(e)||e.startsWith("data-"))&&u.setAttribute(e,p[e]);e=u}return e}function bt(e,{tolerance:t=1,flatBezierToLinetos:l=!0}={}){let a=[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?Ze([n,s,p],!0):1/0,m=pe(n,p),d=x<(m?m/333*t:0),g=!1;if(l||"C"!==c||(d=!1),l&&("C"===c||"Q"===c)){g=_e([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}),g&&i<o-1&&(c="L",u.type="L",u.values=f)}d&&i<o-1&&"A"!==h.type&&("L"===c||l&&g)||(n=s,"M"===c&&(r=s),a.push(u))}return a}function At(e){let t=[];for(let l=0,a=e.length;l<a;l++){let a=e[l];if(!a)continue;let{type:r=null,values:n=[]}=a,s=e[l+1]?e[l+1]:null;"M"!==r&&"m"!==r||s&&(!s||"Z"!==s.type&&"z"!==s.type)?t.push(a):s&&l++}return t}function Mt(e){let t={x:e[0].values[0],y:e[0].values[1]},l=t,a=[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(l={x:u[p-2],y:u[p-1]},h||"L"!==o||l.x!==t.x||l.y!==t.y){if(!h&&("l"===o||"v"===o||"h"===o)){if("l"===o?"00"===u.join(""):0===u[0])continue}a.push(n),t=l}}return a}function wt(e){let t=e.length;if(!("z"===e[t-1].type.toLowerCase()))return e;let l=0,a=[];for(let l=0;l<t;l++){let t=e[l],{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=l,a.push(e)}}return a=a.sort((e,t)=>+e.y.toFixed(8)-+t.y.toFixed(8)||e.x-t.x),l=a[0].index,l?kt(e,l):e}function Ct(e,{removeFinalLineto:t=!0,autoClose:l=!0}={}){let a=[],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&&l&&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 l=0;l<r;l++){let a=e[l],{type:r,values:n}=a;if(n.length){let a=n.slice(-2),s=e[l-1]&&"L"===e[l-1].type,i=e[l+1]&&"L"===e[l+1].type,o=e[l-1]?e[l-1].type.toUpperCase():null,u=e[l+1]?e[l+1].type.toUpperCase():null,h={type:r,x:a[0],y:a[1],dist:0,index:0,prevL:s,nextL:i,prevCom:o,nextCom:u};h.index=l,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?kt(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),a.push(...e),a}function kt(e,t){let l=0,a="z"===e[e.length-1].type.toLowerCase();if(!a||t<1||e.length<3)return e;let r=a?1:0;!function(e){let t=e.length,l="z"===e[t-1].type.toLowerCase(),a=e[0],[r,n]=[a.values[0],a.values[1]].map(e=>+e.toFixed(8)),s=l?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));!l||r==o&&n==u||(e.pop(),e.push({type:"L",values:[r,n]},{type:"Z",values:[]}))}(e),l=t+1<e.length-1?t+1:e.length-1-r;let n,s,i=e.slice(l),o=e.slice(0,l);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 St(e,{arcToCubic:t=!1,quadraticToCubic:l=!1,toClockwise:a=!1,returnD:r=!1}={}){const n=(e,t)=>{let l=[],a=[];if("A"!==e){for(let e=0;e<t.length;e+=2)l.push([t[e],t[e+1]]);a=l.pop(),l.reverse()}else{let e=0==t[4]?1:0;l=[t[0],t[1],t[2],t[3],e],a=[t[5],t[6]]}return{controlPoints:l,endPoints:a}};let s=[],i="z"===e[e.length-1].type.toLowerCase();i&&(e=(e=>{let t="z"===e[e.length-1].type.toLowerCase(),l=e[0],[a,r]=[l.values[0],l.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||a==s&&r==i||(e.pop(),e.push({type:"L",values:[a,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 l=e[t],a=l.type,r=l.values,i=e[t-1],o=i.type,u=[];u=[n(o,i.values).controlPoints,n(a,r).endPoints].flat(),s.push({type:o,values:u.flat()})}return i&&s.push({type:"z",values:[]}),s}function Et(e,{threshold:t=null,tolerance:l=1}={}){if(!t){let l=function(e){let t=1/0,l=-1/0,a=1/0,r=-1/0;const n=e=>{e.x<t&&(t=e.x),e.x>l&&(l=e.x),e.y<a&&(a=e.y),e.y>r&&(r=e.y)};for(let t=0;t<e.length;t++){let l=e[t],{type:a,values:r}=l,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"===a||"Q"===a){let l={x:r[0],y:r[1]},s="C"===a?{x:r[2],y:r[3]}:l,i="C"===a?[e,l,s,t]:[e,l,t];re(i).forEach(e=>{let t=Y(i,e);n(t)})}else"A"===a&&ne(e,r).forEach(e=>{n(e)})}}return{x:t,y:a,width:l-t,height:r-a}}(e);t=.05*(l.width+l.height)}let a=e.length;for(let r=0;r<a;r++){let a=e[r],{type:n,values:s,extreme:i,corner:o=!1,dimA:u,p0:h,p:p}=a,c=e[r+1]?e[r+1]:null,y=e[r+2]?e[r+2]:null,f=(c?ce(p,c.p):1/0)<t,x=(y?ce(y.p,c.p):1/0)<1*t;if(c&&y&&"C"===n&&"C"===c.type&&i&&y.extreme&&(x||f)){let a=Xe(c,y,t,l,!1);if(1===a.length){a=a[0],e[r+1]=null,e[r+2].values=[a.cp1.x,a.cp1.y,a.cp2.x,a.cp2.y,a.p.x,a.p.y],e[r+2].cp1=a.cp1,e[r+2].cp2=a.cp2,e[r+2].p0=a.p0,e[r+2].p=a.p,e[r+2].extreme=a.extreme,r++;continue}}if(c&&"C"===n&&"C"===c.type&&i&&f){let e=Ze([a.p0,a.p,c.p]),t=Ze([a.p0,a.cp1,a.cp2,a.p]);if(e<0&&t>0||e>0&&t<0)continue}}a=(e=e.filter(Boolean)).length;let r="z"===e[a-1].type.toLowerCase()?a-2:a-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=ce(n.p0,n.p)<t;if(s&&"C"===s.type&&p&&u&&h){let a=Xe(s,n,t,l,!1);1===a.length&&(e[r-1]=a[0],e[r]=null,e=e.filter(Boolean))}return e}function Pt(e,{toObject:t=!0,toArray:l=!1,flatten:a=!1}={}){if("string"==typeof e&&!isNaN(e[0]))return e=Lt(e.split(/,| /).filter(Boolean).map(Number));a&&(e=e.flat(2));let r=l?Dt(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=Lt(e);return e.map(e=>({x:e[0],y:e[1]}))}(e);return r}function Dt(e){if(!Array.isArray(e[0][0])&&2===e[0].length)return e;let t=[];return Array.isArray(e[0][0])&&2===e[0][0].length?(e.forEach(e=>{t.push(e.map(e=>[e.x,e.y]))}),t):(t=Array.from(e).map(e=>[e.x,e.y]),t)}function Lt(e){let t=[];if(2===e[0].length)for(let l=0,a=e.length;l<a;l++){let a=e[l];t.push({x:a[0],y:a[1]})}else for(let l=1,a=e.length;l<a;l+=2)t.push({x:e[l-1],y:e[l]});return t}function $t(e,{fontSize:t=16,removeNameSpaced:l=!0,autoRoundValues:a=!1,minifyRgbColors:r=!1,removeInvalid:n=!0,allowDataAtts:s=!0,allowAriaAtts:i=!0,removeDefaults:o=!0,cleanUpStrokes:u=!0,normalizeTransforms:h=!0,removeIds:p=!1,removeClassNames:c=!1,include:y=[],exclude:f=[],width:x=0,height:m=0,stylesheetProps:d={}}={}){let g=e.nodeName.toLowerCase(),v=function(e){let t={},l=[...e.attributes].map(e=>e.name),a=l.length;if(!a)return t;for(let r=0;r<a;r++){let a=l[r],n=e.getAttribute(a);if("transform"===a){let e=[],t=n.split(/(\w+)\(([^)]+)\)/).map(e=>e.trim()).filter(Boolean);for(let l=1;l<t.length;l+=2){let a=t[l-1],r=t[l],n=r.split(/,| /).map(e=>Fe(e.trim())).filter(Boolean);n.length||e.push(`${a}(${r})`)}n=e.join(" ")}t[a]=n.trim()}return t}(e),b=function(e){let t=e.getAttribute("style"),l=t?function(e=""){let t={};if(!e)return t;let l=e.split(";").filter(Boolean).map(e=>e.trim()),a=l.length;if(!a)return t;for(let e=0;a&&e<a;e++){let a=l[e],[r,n]=a.split(":").filter(Boolean);t[r]=n}return t}(t):{};return l}(e),A=e.cssRules||[],M={};A.forEach(e=>{for(let t in d[e]){let l=d[e][t];if(l.startsWith("var(")){let e=l.replace(/[var\(|\)]/g,"").trim();d[":root"]&&(l=`var(${e}, ${d[":root"][e]})`)}M[t]=l}});let w={...v,...M,...b};delete w.style,delete w.class,delete w.id,f.push("style","class","id");let C=["style"];if(n||o||l){let e=Nt(g,w,{allowDataAtts:s,allowAriaAtts:i,removeIds:p,removeClassNames:c,removeDefaults:o,removeNameSpaced:l,exclude:f,cleanUpStrokes:u,include:[...["scale","translate","rotate"],...y],cleanUpStrokes:!1});w=e.propsFiltered,C.push(...e.remove)}let k=[];for(let e in w){let t=w[e];if("d"===e||e.startsWith("data-"))continue;let l={prop:e,values:[]};if(r&&$e.includes(e)){let e=be(t);if("rgba"===e.mode||"rgb"===e.mode){t=Ae(e)}}if("transform"===e){let e=[],l=t.split(/(\w+)\(([^)]+)\)/).map(e=>e.trim()).filter(Boolean);for(let t=1;t<l.length;t+=2){let a=l[t-1],r=De.includes(a),n=Le.includes(a);r&&(a=a.replace("X","")),n&&(a=a.replace("Y",""));let s=l[t].split(/,| /).filter(Boolean),i={fn:a,values:[]};for(let e=0;e<s.length;e++){let t=qt(s[e]);i.values.push(...t)}let o=a.startsWith("scale")?1:0,u=a.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&&k.push({prop:"transforms",values:e})}else l.values=qt(t);l.values.length&&k.push(l)}let S={transformArr:[],matrix:null,transComponents:null},E=[],P=!1;for(let e=0;e<k.length;e++){let l=k[e],{prop:r,values:n}=l,s=[],i=0,o=0,h="",p="";if("transforms"!==r){if(!u||"stroke-dasharray"!==r&&"stroke-dashoffset"!==r)if("transform-origin"===r)n.forEach((e,t)=>{let l=e.value;"left"===l?n[t].value=0:"right"===l?n[t].value=x:"top"===l?n[t].value=0:"bottom"===l?n[t].value=m:"center"===l&&(n[t].value="50%")}),i=n[0].value,o=n[1]?n[1].value:i,h=n[0].unit,p=n[1]?n[1].unit:h,i=Be(i,{unit:h,width:x,height:m,isHorizontal:!0,fontSize:t}),o=Be(o,{unit:p,width:x,height:m,isVertical:!0,fontSize:t}),E.push(i,o);else for(let e=0;e<n.length;e++){let l=n[e],i=l.unit,o=l.value,u=l.numeric,h=Ee.includes(r),p=Pe.includes(r);i&&("scale"===r&&"%"===i?o*=.01:("r"===r&&(P=!0),o=Be(l.value,{unit:i,width:x,height:m,isHorizontal:h,isVertical:p,normalizedDiagonal:P,fontSize:t}),a&&u&&(o=Ce(o)))),s.push(o)}else{P=!0;for(let e=0;e<n.length;e++){let l=Be(n[e].value,{unit:n[e].unit,width:x,height:m,normalizedDiagonal:P,fontSize:t});s.push(l)}}s.length&&(S[r]=s)}else{let e=n||[],l=e.length,a=[];for(let r=0;l&&r<l;r++){let{fn:l,values:n}=e[r],s=[],i="",o="",u=[],h=0,p=0,c={};if("scale"!==l&&"translate"!==l||(h=n[0].value,p=n[1]?n[1].value:h,i=n[0].unit,o=n[1]?n[1].unit:i,"scale"===l?(h="%"===i?.01*h:h,p="%"===o?.01*p:p):(h=Be(h,{unit:i,width:x,height:m,isHorizontal:!0,fontSize:t}),p=Be(p,{unit:o,width:x,height:m,isVertical:!0,fontSize:t})),s.push(h,p),c[l]=s,u.push(c)),"matrix"===l&&(s=n.map(e=>e.value),c[l]=s,u.push(c)),"skew"===l&&(h=n[0].value,i=n[0].unit,p=n[1].value,o=n[1].unit,h=Be(h,{unit:i,isHorizontal:!0,fontSize:t}),p=Be(p,{unit:o,isVertical:!0,fontSize:t}),h=h>360?h%360:h,p=p>360?p%360:p,s=[h,p],c[l]=s,u.push(c)),"rotate"===l){let e=n[0].value;e=Be(e,{unit:n[0].unit});let t=[];if(3===n.length){let e=n[1].value,l=n[2].value;t.push({translate:[e,l]},{translate:[-e,-l]})}c[l]=[e],t.length?u.push(t[0],c,t[1]):u.push(c)}a.push(...u)}S.transformArr=a}}let D=void 0!==S.translate?{translate:S.translate}:null,L=void 0!==S.scale?{scale:S.scale}:null,$=[D,void 0!==S.rotate?{rotate:S.rotate}:null,L].filter(Boolean);$.length&&(h&&C.push("translate","scale","rotate"),S.transformArr=[...$,...S.transformArr]),E.length&&void 0!==S.transformArr&&(S.transformArr=[{translate:[E[0],E[1]]},...S.transformArr,{translate:[-E[0],-E[1]]}],h&&C.push("transform-origin"));let{transformArr:T=[]}=S,N=[],q=T.length;if(q)for(let e=0;q&&e<q;e++){let t=T[e],l=Object.values(t).flat(),a=Object.keys(t)[0];"skew"===a?(l[0]&&N.push(`skewX(${l[0]})`),l[1]&&N.push(`skewY(${l[1]})`)):N.push(`${a}(${l.join(" ")})`)}return S.remove=C,S.type=g,S}function Tt(e={},t=[]){if(void 0===e.transformArr||!t.length)return;let l=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}),l=(e,t)=>({a:1,b:0,c:0,d:1,e:e,f:t}),a=(e,t)=>({a:e,b:0,c:0,d:t,e:0,f:0}),r=(e,t)=>{let[l,a=0]=e.map(e=>e*C),r={};if("rot"===t){let e=Math.cos(l),t=Math.sin(l);r={a:e,b:t,c:-t,d:e,e:0,f:0}}else if("skew"===t){let e=Math.tan(l);r={a:1,b:Math.tan(a),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,l(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,a(h,p));break;default:throw new Error(`Unknown transformation type: ${o}`)}}return n}(t=t.length?t:e.transformArr);e.matrix=l;let a=function(e,t=4){let{a:l,b:a,c:r,d:n,e:s,f:i}=e;Array.isArray(e)&&([l,a,r,n,s,i]=e);let o=Math.atan2(a,l),u=Math.pow(l,2)+Math.pow(a,2),h=Math.sqrt(u),p=(l*n-r*a)/h,c=Math.atan2(l*r+a*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 l=y[e],a="";"rotate"!=e&&"skewX"!=e||(a="deg"),-1!=e.indexOf("translate")&&(a="px");let r=["scaleX","scaleY","translateX","translateY"];0!==l&&f.push(`${e}(${l}${a})`),-1==r.indexOf(e)&&0!==l?x.push(`${e}(${l})`):"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=[l,a,r,n,s,i].map(e=>we(e,t)),y.matrixAtt=`matrix(${y.matrix.join(" ")})`,y}(l,3);return e.transComponents=a,e}function Nt(e="",t={},{removeInvalid:l=!0,removeDefaults:a=!0,allowDataAtts:r=!0,allowMeta:n=!1,allowAriaAtts:s=!1,cleanUpStrokes:i=!0,include:o=[],removeIds:u=!1,removeClassNames:h=!1,exclude:p=[]}={}){let c={},y=[];u||o.push("id"),h||o.push("class");let f=!!i&&(void 0===t.stroke||"none"===t.stroke[0]);for(let i in t){let u=t[i],h=Array.isArray(u)?u[0]:u,p=!!l&&(!!Ie.atts[i]&&Ie.atts[i].includes(e));"transform"===i&&"matrix(1 0 0 1 0 0)"===h&&(p=!1);let x=!!i.startsWith("data-"),m="title"===i,d=i.startsWith("aria-");if(r&&x||s&&d||n&&m)continue;let g=!!a&&(!!Ie.defaults[i]&&(void 0!==Ie.defaults[i]&&Ie.defaults[i].includes(h))),v=f&&ze.includes(i);(g||x||m||d||v)&&(p=!1),o.includes(i)&&(p=!0),p?c[i]=t[i]:y.push(i)}return{propsFiltered:c,remove:y}}function qt(e=""){let t=(e=e.replace("!important","")).includes("'")||e.includes("(")||e.includes(")")?[e]:e.split(/,| /).filter(Boolean);for(let e=0;e<t.length;e++){let l=t[e],a={value:null,unit:"",numeric:!1},r=Oe(l);if(r){if(r){let e=Fe(l),t=parseFloat(l);a.value=t,a.unit=e,a.numeric=!0}}else a.value=l;t[e]=a}return t}function jt(e){if(Oe(e))return e;let t=e.split("-").map(e=>e.replace(/a|e|i|o|u/g,"")).join("-");return t=function(e){return e.split(/[-| ]/).map((e,t)=>t?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e.toLowerCase()).join("")}(t),t}function zt(e,{omitNamespace:t=!1,removeComments:l=!0,format:a=0}={}){let r="";return a<2?(r=(new XMLSerializer).serializeToString(e),r=function(e,{removeComments:t=!0}={}){t&&(e=e.replace(/<!--[\s\S]*?-->/g,""));return e=e.replace(/>\s+</g,"><").trim().replace(/\s+([=])\s+/g,"$1").replace(/\s+(?=[^<]*>)/g," ").replace(/\s{2,}/g," ").replace(/\s*=\s*/g,"="),e}(r,{removeComments:l})):r=function(e,{indentSize:t=2}={}){"string"==typeof e&&(e=(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("svg"));return It(e,0,t)}(e),t&&(r=r.replaceAll('xmlns="http://www.w3.org/2000/svg"',"")),l&&(r=r.replace(/(<!--.*?-->)|(<!--[\S\s]+?-->)|(<!--[\S\s]*?$)/g,"")),r}function It(e,t,l){let a=" ".repeat(t*l);if(e.nodeType===Node.TEXT_NODE){let t=e.textContent.trim();return t||""}if(e.nodeType===Node.ELEMENT_NODE){let r=e.children.length>0,n=e.textContent.trim().length>0&&0===e.children.length,s=`${a}<${e.nodeName}`;for(let t=0;t<e.attributes.length;t++){let l=e.attributes[t];s+=` ${l.name}="${l.value}"`}if(!r&&!n)return s+" />\n";if(s+=">",r){s+="\n";for(let a of e.children)s+=It(a,t+1,l);s+=`${a}</${e.nodeName}>\n`}else n?(s+=e.textContent.trim(),s+=`</${e.nodeName}>\n`):s+=`</${e.nodeName}>\n`;return s}return""}function Bt(e){e.querySelectorAll("*").forEach(e=>{e.nodeName.toLowerCase();let t=e.getAttribute("style")||"",l=!!t&&t.trim().includes("display:none");(e.getAttribute("display")&&"none"===e.getAttribute("display")||l)&&e.remove()})}function Ft(e,{removeElements:t=[],removeNameSpaced:l=!0}={}){t.push("script");let a=e.querySelectorAll("*"),r=!t.includes("metadata");a.forEach(e=>{let a=e.nodeName;!(r&&e.closest("metadata"))&&(l&&a.includes(":")||t.includes(a))&&e.remove()})}function Ot(e,t=[]){t.forEach(t=>{e.removeAttribute(t)})}function Rt(e,t=[]){if(t.length){let l=t.map(e=>`[${e}]`).join(", ").replaceAll(":","\\:");e.querySelectorAll(l).forEach(e=>{t.forEach(t=>{e.removeAttribute(t)})})}}function Qt(e,{removeIds:t=!1,removeClassNames:l=!1,removeDimensions:a=!1,stylesToAttributes:r=!1,allowMeta:n=!1,allowAriaAtts:s=!1,allowDataAtts:i=!1}={}){let o=new Set(["viewBox","xmlns","width","height"]);t||o.add("id"),l||o.add("class"),a&&(o.delete("width"),o.delete("height")),o=Array.from(o),r||o.push("fill","stroke","stroke-width","stroke-linecap","stroke-linejoin","font-size","font-family","font-style","style"),function(e,{allowed:t=["viewBox","xmlns","width","height","id","class"],allowAriaAtts:l=!0,allowDataAtts:a=!0,allowMeta:r=!1}={}){[...e.attributes].map(e=>e.name).forEach(n=>{let s=r&&"title"===n,i=l&&n.startsWith("aria-"),o=a&&n.startsWith("data-");t.includes(n)||i||o||s||e.removeAttribute(n)})}(e,{allowed:o,allowMeta:n,allowAriaAtts:s,allowDataAtts:i})}function Vt(e,{styleProps:t={}}={}){let l=e.getAttribute("pathLength")?+e.getAttribute("pathLength"):0;if(l&&(t["stroke-dasharray"]||t["stroke-dashoffset"])){let a=getElementLength(e,{pathLength:l,props:t});(t=scaleProps(t,{props:["stroke-dasharray","stroke-dashoffset"],scale:a/l}))["stroke-dasharray"],t["stroke-dashoffset"],delete t.pathLength,t.remove.push("pathLength"),e.removeAttribute("pathLength")}return t}function Gt(e,{parent:t=null,removeUnused:l=!0,flatten:a=!0}={}){let r=typeof e;if("string"===r&&(l=!1),"string"!==r)if("style"===e.nodeName)e=e.innerHTML;else{if("svg"!==e.nodeName)return console.warn("invalid CSS input"),{};{let l=e.querySelector("style");if(!l)return{};t=e,e=l.innerHTML}}if(!(e=e.trim()))return{};function n(e){let t={},l=0,a=e.length,r=!1;for(;l<a;){for(;l<a&&/\s/.test(e[l]);)l++;if(l>=a)break;let n=l,s=!1;for(;n<a;){if("{"===e[n]){s=!0;break}if(":"===e[n])break;if(";"===e[n])break;n++}if(s){r=!0;let t=0;for(;l<a&&("{"===e[l]&&t++,"}"===e[l]&&t--,l++,0!==t););}else{let r="",n=!1,s=!1,i="";for(;l<a;){let t=e[l],a=e[l+1];if("u"===t&&"r"===a&&"url("===e.slice(l,l+4)&&(n=!0),'"'!==t&&"'"!==t||0!==l&&"\\"===e[l-1]||(s?t===i&&(s=!1,i=""):(s=!0,i=t)),n&&")"===t&&!s&&(n=!1),";"===t&&!n&&!s){l++;break}r+=t,l++}if(r=r.trim(),r){let e=r.indexOf(":");if(e>-1){let l=r.substring(0,e).trim(),a=r.substring(e+1).trim();l&&a&&(t[l]=a)}}}}return{declarations:t,hasNested:r}}let s=function e(t,l=""){let a=0,r={},s=t.length;for(;a<s;){for(;/\s/.test(t[a]);)a++;if(a>=s)break;let i=a,o=!1;for(;i<s&&";"!==t[i];){if("{"===t[i]){o=!0;break}i++}if(!o){a=i+1;continue}let u="";for(;a<s&&"{"!==t[a];)u+=t[a],a++;if(u=u.trim(),!u||"{"!==t[a])continue;a++;let h="",p=1;for(;a<s&&p>0;)"{"===t[a]?p++:"}"===t[a]&&p--,p>0&&(h+=t[a]),a++;let c=u;l&&(c=u.includes("&")?u.replace(/&/g,l):l+" "+u),c=c.replace(/\s+/g," ").trim();let{declarations:y,hasNested:f}=n(h);if(Object.keys(y).length)if(r[c])for(let e in y){let t=r[c][e],l=y[e],a=t&&t.includes("!important"),n=l.includes("!important");a&&!n||(r[c][e]=l)}else r[c]=y;f&&e(h,c)}return r}(e=e.replace(/\/\*[\s\S]*?\*\//g,""));t&&l&&(s=function(e=null,t={}){return Object.keys(t).forEach(l=>{e.querySelector(l)||":root"===l||delete t[l]}),t}(t,s)),a&&(s=function(e){for(let t in e){let l=t.split(/,/).map(e=>e.trim());e[t],l.length>1&&(l.forEach(t=>{let l=e[t];for(let a in l){let r=l[a];r.includes("!important")||(e[t][a]=r)}}),delete e[t])}return e}(s));let i={},o={};for(let e in s){e.startsWith("#")&&(i[e]=s[e],delete s[e]);for(let t in s[e]){let l=s[e][t];l.includes("!important")&&(o[e]||(o[e]={}),o[e][t]=l)}}return s={...s,...i,...o},s}function Ht(e,{styleProps:t={}}={}){let{remove:l,matrix:a,transComponents:r}=t;e.nodeName.toLowerCase();if(!a)return t;let{rotate:n,scaleX:s,scaleY:i,skewX:o,translateX:u,translateY:h}=r,p=0!==n||0!==o||s!==i;return p=!0,e.setAttribute("transform",r.matrixAtt),t}function Ut(e,{removeHidden:t=!0,stylesToAttributes:l=!0,attributesToGroup:a=!1,removePrologue:r=!0,removeIds:n=!1,removeClassNames:s=!1,removeDimensions:i=!1,fixHref:o=!1,legacyHref:u=!1,cleanupDefs:h=!0,cleanupClip:p=!0,addViewBox:c=!1,addDimensions:y=!1,minifyRgbColors:f=!1,normalizeTransforms:x=!0,autoRoundValues:m=!0,unGroup:d=!1,mergePaths:g=!1,removeOffCanvas:v=!0,cleanupSVGAtts:b=!0,removeNameSpaced:A=!0,removeNameSpacedAtts:M=!0,convertPathLength:w=!1,allowMeta:C=!1,allowDataAtts:S=!0,allowAriaAtts:E=!0,shapeConvert:P=!1,convertShapes:D=[],removeElements:L=[],removeSVGAttributes:$=[],removeElAttributes:T=[],convertTransforms:N=!1,removeDefaults:q=!0,cleanUpStrokes:j=!0,decimals:z=-1,excludedEls:I=[]}={}){(d||N||f||a)&&(l=!0),l&&(j=!0),o&&(e=e.replaceAll("xlink:href=","href="));let B=(new DOMParser).parseFromString(e,"text/html").querySelector("svg"),F=mt(B),{x:O,y:R,width:Q,height:V}=F,G=[];c&&function(e,{x:t=0,y:l=0,width:a=0,height:r=0}={}){if(e.hasAttribute("viewBox"))return;a&&r||({x:t,y:l,width:a,height:r}=mt(e));e.setAttribute("viewBox",[t,l,a,r].join(" "))}(B,{x:O,y:R,width:Q,height:V}),y&&(B.setAttribute("width",Q),B.setAttribute("height",V)),h&&function(e,{x:t=0,y:l=0,width:a=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()})}(B,{x:O,y:R,width:Q,height:V,cleanupClip:p}),v&&function(e,{x:t=0,y:l=0,width:a=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:l,width:a,height:r};s.right=t+a,s.bottom=l+r,n.forEach(e=>{let t=function(e){let t=e.nodeName.toLowerCase(),l=Re(e),a={x:0,y:0,width:0,height:0},r=[];switch(t){case"path":a=Qe(He(st(l.d)));break;case"rect":a={x:l.x||0,y:l.y||0,width:l.width,height:l.height};break;case"circle":let e=2*l.r;a={x:l.cx-l.r,y:l.cy-l.r,width:e,height:e};break;case"ellipse":a={x:l.cx-l.rx,y:l.cy-l.ry,width:2*l.rx,height:2*l.ry};break;case"line":r=[{x:l.x1,y:l.y1},{x:l.x2,y:l.y2}],a=Qe(r);break;case"polyline":case"polygon":r=Pt(l.points),a=Qe(r)}return a}(e);(t.right<s.x||t.bottom<s.y||t.x>s.right||t.y>t.bottom)&&e.remove()})}(B,{x:O,y:R,width:Q,height:V});let H={width:Q,height:V,normalizeTransforms:x,removeDefaults:!1,cleanUpStrokes:!1,allowMeta:C,allowDataAtts:S,allowAriaAtts:E,autoRoundValues:m,removeIds:n,removeClassNames:s,minifyRgbColors:f,stylesheetProps:{},exclude:[]},U=$t(B,H),Z=B.querySelector("style"),W={};if(Z){W=Gt(Z,{parent:B});for(let e in W){B.querySelectorAll(`${e}`).forEach(t=>{if(t.cssRules||(t.cssRules=[]),t.cssRules.push(e),l){let l=e.substring(1);t.classList.remove(l)}})}l&&Z.remove()}l&&B.removeAttribute("style"),H.stylesheetProps=W,H.fontSize=U["font-size"]?U["font-size"][0]:16;let X=B.querySelectorAll("g");X.forEach(e=>{let t=$t(e,H);e.querySelectorAll(`${qe.join(", ")}`).forEach(e=>{void 0===e.parentStyleProps&&(e.parentStyleProps=[]),e.parentStyleProps.push(t)})});let J=B.querySelectorAll(`${qe.join(", ")}`);for(let e=0;e<J.length;e++){let t=J[e],r=t.nodeName.toLowerCase(),o=$t(t,H),u={};w&&(o=Vt(t,{styleProps:o}),G=[...new Set([...G,...o.remove])]);let{parentStyleProps:h=[]}=t,p={},c=[];if(h.forEach(e=>{let{transformArr:t=[]}=e;c.push(...t),p={...p,...e}}),c=[...c,...o.transformArr],o.transformArr=c,U.class&&delete U.class,U.id&&delete U.id,o={...U,...p,...o},Tt(o,c),G=[...new Set([...G,...o.remove])],C||L.push("meta","metadata","desc","title"),s&&($.push("class"),T.push("class")),n&&($.push("id"),T.push("id")),Bt(B),Ft(B,{removeElements:L,removeNameSpaced:A}),Ot(B,$),Rt(B,T),b&&Qt(B,{removeIds:n,removeClassNames:s,removeDimensions:i,stylesToAttributes:l,allowMeta:C,allowAriaAtts:E,allowDataAtts:S}),l){x&&(o=Ht(t,{styleProps:o}),G=[...new Set([...G,...o.remove])]),u=Nt(r,o,{removeDefaults:!0,cleanUpStrokes:j,allowMeta:C,allowAriaAtts:E,allowDataAtts:S,removeIds:n}),G=[...new Set([...G,...u.remove])];for(let e in u.propsFiltered){let l=o[e],a=l.length?l.join(" "):l[0];t.setAttribute(e,a)}for(let e=0;e<G.length;e++){let l=G[e];t.removeAttribute(l)}}if(N&&(P="toPaths",D=["path","rect","ellipse","circle","line","polygon","polyline"]),"toPaths"===P){let{matrix:e=null,transComponents:l=null}=o;if(e&&l&&["stroke-width","stroke-dasharray"].forEach(e=>{let a=t.getAttribute(e),r=a?a.split(" ").filter(Boolean).map(Number).map(e=>e*l.scaleX):[];r.length&&t.setAttribute(e,r.join(" "))}),e?Ne.includes(r):Se.includes(r)){let l=gt(t,{width:Q,height:V,convertShapes:D,matrix:e});t.replaceWith(l),r="path",t=l}}else if("toShapes"===P){B.querySelectorAll("path").forEach(e=>{let t=vt(e,{convertShapes:D});e.replaceWith(t),e=t})}if(g||a){let e={allowMeta:C,allowAriaAtts:E,removeIds:n,removeClassNames:s,allowDataAtts:S};g&&(e.removeIds=!0,e.removeClassNames=!0,e.allowAriaAtts=!1,e.allowMeta=!1),u=Nt(r,o,e).propsFiltered;for(let e in u){if(Te.includes(e))continue;let l=u[e],a=l.length?l.join(" "):l[0];if("class"!==e&&"id"!==e){let l=`${jt(e)}-${jt(a)}`;t.styleSet||(t.styleSet=new Set),l&&t.styleSet.add(l)}}}}return d?function(e){e.forEach((e,t)=>{[...e.children].forEach(t=>{e.parentNode.insertBefore(t,e)}),e.remove()})}(X):l&&X.forEach(e=>{!function(e,t=[],l=[]){[...e.attributes].map(e=>e.name).forEach(a=>{t.includes(a)&&!l.includes(a)&&e.removeAttribute(a)})}(e,["style","transform"])}),a&&function(e){let t=e.querySelectorAll(qe.join(", ")),l=t.length;if(1===l)return;let a=t[0]||null,r=void 0!==a.styleSet?[...a.styleSet].join("_"):"",n={},s=[];if(l){let i=[[a]],o=0,u=a;for(let e=0;e<l;e++){let a=t[e],r=Re(a);for(let e in r){let t=`${e}_${r[e]}`;n[t]||(n[t]=[]),n[t].push(a),n[t].length===l&&s.push(e)}}if(s.length){let t=Re(a);for(let l in t)s.includes(l)&&"transform"!==l&&e.setAttribute(l,t[l])}for(let e=1;e<l;e++){let l=t[e],a=void 0!==l.styleSet?[...l.styleSet]:[],n=a.length?a.join("_"):"";n===r&&u.nextElementSibling===l?i[o].push(l):(i.push([l]),o++),r=n,u=l}for(let e=0;e<i.length;e++){let t=i[e],l=t[0],a=Re(l),r=l.parentNode.closest("g");if(1!==t.length){(!r||i.length>1)&&(r=document.createElementNS(k,"g"),l.parentNode.insertBefore(r,l),r.append(...t));for(let e in a){let l=a[e],n=["id","class"];Te.includes(e)||n.includes(e)||(s.includes(e)&&"transform"!==e||r.setAttribute(e,l),t.forEach(t=>{t.removeAttribute(e)}))}}}}}(B),g&&function(e){let t=e.querySelectorAll("path"),l=t.length;if(l){let e=t[0],a=e.getAttribute("d"),r=void 0!==e.styleSet?[...e.styleSet].join(" "):"",n=[];for(let s=1;s<l;s++){let l=t[s],i=void 0!==l.styleSet?[...l.styleSet].join(" "):"",o=l.previousElementSibling===e,u=l.getAttribute("d"),h=u.startsWith("M");if(o&&i===r){a+=h?u:nt(u).pathData.map(e=>`${e.type} ${e.values.join(" ")}`).join(" "),e.setAttribute("d",a),n.push(l)}else e=l,a=h?u:nt(u).pathData.map(e=>`${e.type} ${e.values.join(" ")}`).join(" ");r=i}n.forEach(e=>{e.remove()})}}(B),p&&function(e,{x:t=0,y:l=0,width:a=0,height:r=0}={}){let n=e.querySelectorAll("clipPath");if(!n.length)return;a&&r||({x:t,y:l,width:a,height:r}=mt(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=st(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(_(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===l&&s.width===a&&s.height===r){n.remove(),e.querySelectorAll(`[clip-path="url(#${n.id})"]`).forEach(e=>{e.removeAttribute("clip-path")})}}})}(B,{x:O,y:R,width:Q,height:V}),u&&function(e){e.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink");let t=e.querySelectorAll("[href]");t.forEach(e=>{let t=e.getAttribute("href");e.setAttribute("xlink:href",t)})}(B),function(e){let t=e.querySelectorAll('[class=""');t.forEach(e=>{e.removeAttribute("class")})}(B),{svg:B,svgElProps:[]}}function Zt(e,{threshold:t=0,tolerance:l=1}={}){let a=e.length,r=[e[0]],n="z"===e[a-1].type.toLowerCase(),s=!!n&&(e[a-1].p.x===e[0].p0.x&&e[a-1].p.y===e[0].p0.y),i=n?2:1,o=e[a-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[a-1].values=e[0].values,e[a-1].type="L",u=!0);for(let t=1;t<a;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,m=[],d=0;if(1===t&&c&&u&&(m=[e[1]],y=e[a-1],x=f),!y){r.push(s);continue}n&&h&&p&&t===a-i-1&&(x=e[1],m=[e[a-i]]);for(let l=t+1;l<a;l++){let t=e[l]?e[l]:null,a=e[l-1];if("C"===a.type&&m.push(a),"L"===t.type&&"C"===a.type){x=t;break}d++}if(x){let e=ce(y.p0,y.p),a=ce(x.p0,x.p),n=ce(y.p,x.p0),i=Ze([y.p0,y.p,x.p0,x.p],!1),o=Ze([m[0].p0,m[0].cp1,m[0].cp2,m[0].p],!1),u=i<0&&o>0||i>0&&o<0,h=.5*n*l,p=h<e&&h<a;if(m.length&&!u&&p){let e=Math.abs(o)<.005*pe(m[0].p0,m[0].p)?null:W(y.p0,y.p,x.p,x.p0,!1,!0);if(!e){r.push(s);continue}if(e){let t=Ze([y.p0,y.p,x.p0,x.p],!1),l=Math.abs(t),a=Ze([y.p0,y.p,e,x.p0,x.p],!1),n=Math.abs(a),i=Math.abs(l-n)/l;if(!e||(t<0&&a>0||t>0&&a<0)||i>.5){r.push(s);continue}}let l=.75*ce(Y([y.p,e,x.p0],.5),1===m.length?Y([m[0].p0,m[0].cp1,m[0].cp2,m[0].p],.5):m[0].p);if(h&&l>h&&l>.3*n){r.push(s);continue}{let l={type:"Q",values:[e.x,e.y,x.p0.x,x.p0.y]};l.p0=y.p,l.cp1=e,l.p=x.p0,r.push(y,l),t+=d;continue}}}}y&&t===a-1&&"L"===o||r.push(s)}return(y||n&&"Z"!==r[r.length-1].type)&&r.push({type:"Z",values:[]}),r}function Wt(e){if(e.length<3)return!1;let t=e[0],l=e[Math.floor(e.length/2)],a=e[e.length-1],r=t.x,n=t.y,s=l.x,i=l.y,o=a.x,u=a.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,m=h*y-p*c;if(Math.abs(m)<1e-10)return console.warn("Points are collinear or numerically unstable"),!1;let d={x:(y*f-p*x)/m,y:(-c*f+h*x)/m},g=he(d,t),v=Z(d,t,a),{deltaAngle:b,startAngle:A,endAngle:M}=v;return{centroid:d,r:g,startAngle:A,endAngle:M,deltaAngle:b}}function Xt(e,{threshold:t=0,tolerance:a=1,toCubic:r=!1,debug:n=!1}={}){let s=e.length,i=[e[0]],o=[];for(let t=1;t<s;t++){let a=e[t],{type:s}=a,u=e[t-1],h=e[t+1]?e[t+1]:null,p=e[t+2]?e[t+2]:null,c=e[t+3]?e[t+3]:null,y=null;"C"===a.type||"Q"===a.type?y=a:!h||"C"!==h.type&&"Q"!==h.type||(y=h);let f,x,m,d,g,v=y?"C"===y.type?[y.p0,y.cp1,y.cp2,y.p]:[y.p0,y.cp1,y.p]:[],b=0,A=0,M=!1,w=!1,C=[];if("L"===u.type&&"L"===s&&y&&"L"===p.type&&c&&("L"===c.type||"Z"===c.type)?(f=[a.p0,a.p],x=[p.p0,p.p],m=a.p0,d=p.p,b=Ze(v,!1),A=Ze([...f,...x],!1),M=b<0&&A>0||b>0&&A<0,M||(g=Y(v,.5),C=[m,g,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],m=u.p,d=p.p0,g=y.p,C=[m,y.p,d]),w){let e=Wt(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(ye(ee(m,u.x,u.y,.5*p),g)<.05*ye(m,d)){if(s=ct({p0:m,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=ot(m,s[0].cp1,s[0].cp2,d);"Q"===e.type&&(r=!0),a=e}if(s.length>1&&(r=!1),r||(a.type="A",a.values=[h,h,f,v,x,d.x,d.y]),a.p0=m,a.p=d,a.extreme=!1,a.corner=!1,n){o=r?[{type:"M",values:[m.x,m.y]},...s]:[{type:"M",values:[m.x,m.y]},{type:"A",values:[h,h,f,v,x,d.x,d.y]}];let e=We(o);l(markers,e,"orange","0.5%","0.5")}i.push(a),t++;continue}}}i.push(a)}return i}function Jt(e=[],{threshold:t=0}={}){let l=e.length,a="z"===e[l-1].type.toLowerCase(),r=a?l-2:l-1,n=e[r],s=n.values.slice(-2),i={x:e[0].values[0],y:e[0].values[1]},o=ye(i,{x:s[0],y:s[1]});if(o&&o<t){let l=e[r].values.length;e[r].values[l-2]=i.x,e[r].values[l-1]=i.y;let a=e[1];if("C"===a.type&&"C"===n.type){let l=Math.abs(a.values[0]-n.values[2]),s=Math.abs(a.values[1]-n.values[3]),o=Math.abs(e[1].values[0]-a.values[0]),u=Math.abs(e[1].values[1]-a.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&&l;l&&l<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 Yt(e,t=1){let l=[];for(let a=0,r=e.length;a<r;a++){let r=e[a],{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,l)=>e*t))}l.push(i)}return l}function _t(e,t=1){for(let l=1,a=e.length;l<a;l++){let a=e[l],{type:r,values:n,p0:s,cp1:i=null,cp2:o=null,p:u=null}=a;if("C"===r){let r=ot(s,i,o,u,t);"Q"===r.type&&(r.extreme=a.extreme,r.corner=a.corner,r.dimA=a.dimA,r.squareDist=a.squareDist,e[l]=r)}}return e}function Kt(e,{quality:t=.9,width:l=0,height:a=0}={}){let r=!1;if("string"==typeof t&&(r=!0,t=parseFloat(t)),e.length<4)return e;let n=t;if(!r){if(n=1-t,t>.5&&(n/=2),!l&&!a){let t=fe(e,12);({width:l,height:a}=Qe(t))}n=(n*((l+a)/2/100))**2}const s=(e,t,l)=>{let a=t.x,r=t.y,n=l.x-a,s=l.y-r;if(0!==n||0!==s){let t=((e.x-a)*n+(e.y-r)*s)/(n*n+s*s);t>1?(a=l.x,r=l.y):t>0&&(a+=n*t,r+=s*t)}return(e.x-a)**2+(e.y-r)**2};let i=[e[0]],o=[];for(o.push([0,e.length-1]);o.length>0;){let[t,l]=o.pop(),a=n,r=-1;for(let n=t+1;n<l;n++){let i=s(e[n],e[t],e[l]);i>a&&(r=n,a=i)}a>n?(o.push([r,l]),o.push([t,r])):i.push(e[l])}return i}function el(e,{quality:t=.9,width:l=0,height:a=0}={}){let r=!1;if("string"==typeof t){r=!0,t=parseFloat(t)}if(e.length<4)return e;let n,s=e[0],i=[s],o=t;if(!r){if(o=t,!l&&!a){let t=fe(e,12);({width:l,height:a}=Qe(t))}o=(o*((l+a)/2/25))**2,t>.5&&(o/=10)}for(let t=1,l=e.length;t<l;t++){n=e[t],pe(s,n)>o&&(i.push(n),s=n)}return s.x!==n.x&&s.y!==n.y&&i.push(n),i}function tl(e,t=!0){let l=[],a=[];return Array.isArray(e[0])?e.forEach(e=>{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:[]}),l.push(...a)}):l=[{type:"M",values:[e[0].x,e[0].y]},...e.slice(1).map(e=>({type:"L",values:[e.x,e.y]}))],t&&l.push({type:"Z",values:[]}),l}function ll(e,{maxError:t=0,adjustCpts:l=!0,harmonize:a=!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,s,i=e.length,o=function(e=[]){let t=[];return e.forEach(e=>{let l=4===e.length?"C":3===e.length?"Q":"L",a="C"===l||"Q"===l?e[1]:null,r="C"===l?e[2]:null,n=e[e.length-1],s={type:l,values:"C"===l?[a.x,a.y,r.x,r.y,n.x,n.y]:"Q"===l?[a.x,a.y,n.x,n.y]:[n.x,n.y]};t.push(s)}),t}(al(e,il(e[1],e[0]),il(e[i-2],e[i-1]),t,r));{let t=o.length,l=o[0],a=o[t-1],r={x:e[0].x,y:e[0].y},u={x:e[1].x,y:e[1].y},h=e[2]?{x:e[2].x,y:e[2].y}:null;h&&(n={x:l.values[0],y:l.values[1]},n=yl(n,r,u,h),l.values[0]=n.x,l.values[1]=n.y);let p={x:e[i-1].x,y:e[i-1].y},c={x:e[i-2].x,y:e[i-2].y},y=e[i-3]?{x:e[i-3][0],y:e[i-3][1]}:null;y&&(s={x:a.values[2],y:a.values[3]},s=yl(s,p,c,y),a.values[2]=s.x,a.values[3]=s.y)}return o}function al(e,t,l,a,r=!1){let n,s=function(e){let t=[],l=e.length,a=e[0],r=e[1],n=0,s=0;for(let i=0;i<l;i++)r=e[i],n=s+he(r,a,!1),t.push(n),s=n,a=r;return t=t.map(function(e){return e/s}),t}(e),i=rl(e,s,s,t,l);n=i[0];let o=i[1],u=i[2];if(r){let t=function(e,t){let l,a=4,r=1/a,n=e.length,s=[t[0]];for(let e=1;e<a;e++){l=Y(t,r*e),s.push(l)}s.push(t[t.length-1]);let i=Ze(e,!1);i||2!==e.length||(i=.01*pe(e[0],e[1]));let o=Ze(s,!1)/i>1.1,u=t;if(o){let l=e[Math.floor(.5*n)],a=e[n-1];u=t=[e[0],l,l,a]}return{isBulged:o,bezierNew:u}}(e,n),{isBulged:l,bezierNew:a}=t;l&&(n=a)}if(0===o||o<a)return[n];if(o<a*a){let r=s,i=o,h=u;for(let p=0;p<20;p++){r=nl(n,e,r);let p=rl(e,s,r,t,l);if(n=p[0],o=p[1],u=p[2],o<a)return[n];if(u===h){let e=o/i;if(e>.9999&&e<1.0001)break}i=o,h=u}}let h=[],p=ol(e[u-1],e[u+1]);if(0===p.x&&0===p.y){p=ol(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=hl(c,-1);return e.length,h.push(...al(e.slice(0,u+1),t,c,a,r),...al(e.slice(u),y,l,a,r)),h}function rl(e,t,l,a,r){let n,s,i;n=function(e,t,l,a){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]=hl(l,3*s*(i*i)),r[1]=hl(a,3*i*(s*s));let y=[[0,0],[0,0]],f=[0,0],x=e.length;for(let l=0;l<x;l++)s=t[l],r=p[l],y[0][0]+=pl(r[0],r[0]),y[0][1]+=pl(r[0],r[1]),y[1][0]+=pl(r[0],r[1]),y[1][1]+=pl(r[1],r[1]),n=ol(e[l],Y([o,o,u,u],s)),f[0]+=pl(r[0],n),f[1]+=pl(r[1],n);let m=y[0][0]*y[1][1]-y[1][0]*y[0][1],d=y[0][0]*f[1]-y[1][0]*f[0],g=f[0]*y[1][1]-f[1]*y[0][1],v=0===m?0:g/m,b=0===m?0:d/m,A=he(o,u,!1),M=1e-6*A;return v<M||b<M?(h[1]=ul(o,hl(l,.333*A)),h[2]=ul(u,hl(a,.333*A))):(h[1]=ul(o,hl(l,v)),h[2]=ul(u,hl(a,b))),h}(e,l,a,r);let o=function(e,t,l){let a,r,n,s,i,o;r=0,n=Math.floor(.5*e.length);let u=function(e,t){let l,a=[0],r=e[0],n=0;for(let s=1;s<=t;s++)l=Y(e,s/t),n+=he(l,r),a.push(n),r=l;return a=a.map(e=>e/n),a}(t,10),h=e.length,p=null;for(s=0;s<h;s++)i=e[s],o=sl(l[s],u,10),p=Y(t,o),a=pe(p,i),a>r&&(r=a,n=s);return[r,n]}(e,n,t);return s=o[0],i=o[1],[n,s,i]}function nl(e,t,l){return l.map((l,a)=>function(e,t,l){let a=Y(e,l),r=a.x-t.x,n=a.y-t.y,s=cl(e,l),i=r*s[0]+n*s[1],o=s[0]*s[0]+s[1]*s[1],u=cl(e,l,!0),h=2*(r*u[0]+n*u[1]),p=o+h;if(Math.abs(p)<1e-10)return l;return l-i/p}(e,t[a],l))}function sl(e,t,l){if(e<0)return 0;if(e>1)return 1;let a,r,n,s,i;for(let o=1;o<=l;o++)if(e<=t[o]){s=(o-1)/l,n=o/l,r=t[o-1],a=t[o],i=(e-r)/(a-r)*(n-s)+s;break}return i}function il(e,t){let l=e.x-t.x,a=e.y-t.y,r=Math.sqrt(l*l+a*a);return 0===r?{x:0,y:0}:{x:l/r,y:a/r}}function ol(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ul(e,t){return{x:e.x+t.x,y:e.y+t.y}}function hl(e,t){return{x:e.x*t,y:e.y*t}}function pl(e,t){return e.x*t.x+e.y*t.y}function cl(e,t,l=!1){let a,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 l?(a=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)):(a=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)),[a,r]}function yl(e,t,l,a){let r=U(t,l),n=U(t,a)-r;return e=ee(e,t.x,t.y,-n)}function fl(e,{debug:t=!1,width:l=0,height:a=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=[],x=e.length,m=e[0],d=e[x-1];if(3===e.length){let t=J(m,e[1],.5),l=J(e[1],d,.5),a=J(d,e[0],.5);if(h){let r=.6666,n=J(t,e[1],r),s=J(l,e[1],r),i=J(l,d,r),o=J(a,d,r),u=J(a,m,r),h=J(t,m,r);f=[{type:"M",values:[t.x,t.y]},{type:"C",values:[n.x,n.y,s.x,s.y,l.x,l.y]},{type:"C",values:[i.x,i.y,o.x,o.y,a.x,a.y]},{type:"C",values:[u.x,u.y,h.x,h.y,t.x,t.y]},{type:"Z",values:[]}]}else f=[{type:"M",values:[m.x,m.y]},{type:"C",values:[e[1].x,e[1].y,e[1].x,e[1].y,d.x,d.y]}];return f}let g=function(e){let t=e.length,l=0,a=0;for(let r=0;t&&r<t;r++){let t=e[r];l+=t.x,a+=t.y}return{x:l/t,y:a/t}}(function(e){if(e.length<4)return e;let t=e.length,l=e[0],a=e[t-1];l.x===a.x&&l.y===a.y&&(e.pop(),t--,a=e[t-1]);let r,n,s=[l],i=l;for(let a=2;a<t;a++){r=e[a-1],n=e[a];let o=a===t-1;if(r.x===i.x&&r.y===i.y||r.x===n.x&&r.y===n.y)continue;let u=i.x===r.x,h=i.y===r.y;if(u||h){let e=r.x===n.x,t=r.y===n.y;if(u&&e||h&&t){if(!o)continue;if(o&&l.x!==n.x&&l.y!==n.y){s.push(n);continue}}}Ze([i,r,n],!0)<=.005*pe(i,n)&&a<t-1||(s.push(r),o&&l.x!==n.x&&l.y!==n.y&&s.push(n)),i=r}return Ze([s[1],l,s[s.length-1]],!0)<.005*pe(s[1],s[s.length-1])&&s.shift(),s}(e)),v=function(e,t={x:0,y:0}){let l=pe(e[0],t);for(let a=1,r=e.length;a<r;a++){let r=pe(e[a],t);if(Math.abs(l-r)/l>.05)return!1}return!0}(e,g);if(v){let t=ee(e[0],g.x,g.y,Math.PI),l=Ze(e)>0?1:0;return f=[{type:"M",values:[e[0].x,e[0].y]},{type:"A",values:[1,1,0,0,l,t.x,t.y]},{type:"A",values:[1,1,0,0,l,e[0].x,e[0].y]}],h&&f.push({type:"Z",values:[]}),f}let b=s||n?function(e,{x:t=0,y:l=0,width:a=0,height:r=0,debug:n=!1}={}){let s=e.length,i=Qe(e);a&&r||({x:t,y:l,width:a,height:r}=i);let o=.01*(a+r);for(let t=0;t<s;t++){let l=t>0?e[t-1]:e[s-1],a=e[t],r=Ze([l,a,t<s-1?e[t+1]:e[s-1]],!1);a.area=r,a.dist=ce(l,a),a.idx=t}for(let t=0;t<s;t++){t>1?e[t-2]:e[s-1];let l=t>0?e[t-1]:e[s-1],a=e[t],r=t<s-1?e[t+1]:e[s-1];pe(l,r),Math.abs(l.area);let n=Math.abs(a.area);Math.abs(r.area);let u=!1,h=!a.area||n<o;ce(a,l);let p=!1;a.x!==i.left&&a.x!==i.right&&a.y!==i.top&&a.y!==i.bottom||(p=!0);let c=a.y===l.y&&a.x!==l.x,y=a.x===l.x&&a.y!==l.y;(c||y)&&(l.isExtreme=!0,p=!0);let f=Qe([l,r]),{left:x,right:m,top:d,bottom:g}=f,v=a.x<x||a.x>m||a.y<d||a.y>g;!p&&v&&(p=!0);let b=(l.area<0&&a.area>0||l.area>0&&a.area<0)&&!h&&!l.isDirChange;if(p){let e=Z(a,r,l),{deltaAngleDeg:t}=e;t=Math.abs(t),t>10&&t<160&&(u=!0)}a.isCorner=u,a.isExtreme=p,a.isHorizontal=c,a.isVertical=y,a.isDirChange=b}let u=[],h=[];for(let t=0;t<e.length;t++){let l=e[t],a=e[t+1]||null,r=e[t+2]||null,n=[];if(a&&a.isExtreme&&l.isExtreme&&!l.isCorner){let e=a.dist<2*o&&!a.isCorner,s=r&&r.isExtreme&&r.dist<2*o&&!r.isCorner;if(e&&!s?n.push(l,a):s&&n.push(l,a,r),n.length){let e=n.reduce((e,t)=>e+t.x,0)/n.length,a=n.reduce((e,t)=>e+t.y,0)/n.length;l.x=e,l.y=a,t+=n.length-1}}(l.isExtreme||l.isCorner||l.isDirChange)&&h.push(u.length),u.push(l);let s=u.length,i=u[0],p=u[s-1],c=ce(i,p)<2*o;i.isExtreme&&p.isExtreme&&c&&(p.x=i.x,p.y=i.y)}return u}(e,{debug:!1}):e,A=s||n?function(e,{closed:t=!0,keepCorners:l=!0,keepExtremes:a=!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],(a&&r.isExtreme||l&&r.isCorner)&&(s++,n.push([])),i=n[s],i.push(r)}return n}(b,{keepCorners:n,keepExtremes:s,keepInflections:i}):[b];return f=function(e=[],{closed:t=!0,keepCorners:l=!0,tolerance:a=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=ll(r,{maxError:a,keepCorners:l}),n.push(...i)}t&&n.push({type:"Z",values:[]});return n}(A,{closed:h,tolerance:l&&a?(l+a)/2*.004*p:2.5,keepCorners:n,keepExtremes:!0}),f=function(e=[]){let t=e.length,l={x:e[0].values[0],y:e[0].values[1]},a=l;for(let r=1;r<t;r++){let t=e[r],n=e[r-1]||null,{type:s,values:i}=t;if(e[r+1]&&e[r+1],"C"===s){let e=1.2,r={x:i[0],y:i[1]};a={x:i[4],y:i[5]};let s={x:i[2],y:i[3]};J(l,r,e);let o=J(a,s,e);n.values.slice(-2);let u=W(l,r,a,o,!0,!0);if(u){let e=.666;r=J(l,u,e),s=J(a,u,e),t.values=[r.x,r.y,s.x,s.y,a.x,a.y]}}i.length&&(l=a)}return e}(f),f}function xl(e,{precisionPoly:t=1,autoAccuracy:l=!1,polyFormat:a="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 l=e[t],{type:a,values:r,p0:n,p:s,dimA:i=0}=l;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 l=1;l<i;l++){let a=e[l],{type:r,values:n,p0:s,p:i,cp1:o=null,cp2:u=null,dimA:h}=a,c=h,y=o&&u?[s,o,u,i]:o?[s,o,i]:[];if(y.length){let e=u?J(o,u,.5):o;c=.2*(ce(s,e)+ce(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 l=Y(y,e*t);p.push(l)}}p.push(i)}n>0&&(p=el(p,{quality:n})),s>0&&(p=Kt(p,{quality:s})),o=tl(p),e=o,l&&(r=function(e){let t=[];for(let l=1,a=e.length;l<a;l++){let a=e[l],{p0:r=null,p:n=null,dimA:s=0}=a;n&&r&&(s=s||ce(r,n),s&&t.push(s))}let l=t.sort(),a=Math.ceil(l.length/8);l=l.slice(0,a);let r=l.reduce((e,t)=>e+t,0)/a,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:we(e.x,r),y:we(e.y,r)})):p.map(e=>({x:e.x,y:e.y}));return"array"===a?y=y.map(e=>[e.x,e.y]):"string"===a&&(y=y.map(e=>[e.x,e.y].join(",")).flat().join(" ")),{pathData:e,poly:y}}function ml(e){for(let t=1,l=e.length;t<l;t++){let l=e[t],{type:a,values:r,p0:n,cp1:s=null,cp2:i=null,p:o=null}=l;if("L"===a){let l=J(n,o,.333),a=J(o,n,.333);e[t].type="C",e[t].values=[l.x,l.y,a.x,a.y,o.x,o.y],e[t].cp1=l,e[t].cp2=a}}return e}function dl(e=[],t=!1){let l=[];e.forEach((e,t)=>{let a=function(e=[],{precision:t=1}={}){let l=[];for(let t=0;t<e.length;t++){let a=e[t],r=t>0?e[t-1]:e[t],{type:n,values:s}=a,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":yt(i,s).forEach(e=>{let t=e.values,a={x:t[0],y:t[1]},r={x:t[2],y:t[3]},n={x:t[4],y:t[5]};l.push(a,r,n)});break;case"C":let e={x:s[2],y:s[3]};l.push(u,e);break;case"Q":l.push(u)}"z"!==n.toLowerCase()&&l.push(o)}return l}(e.pathData),r=Ze(a)>=0;l.push({pts:a,bb:Qe(a),cw:r,index:t,inter:0,includes:[],includedIn:[]})});let a=l.length;for(let e=0;e<a;e++){let t=l[e],r=t.bb;for(let n=0;n<a;n++){let a=l[n],s=a.bb;e===n||a.includes.includes(e)||X({x:s.left+s.width/2,y:s.top+s.height/2},t.pts,r)&&(l[n].inter+=1,a.includedIn.push(e),t.includes.push(n))}}for(let r=0;r<a;r++){let a=l[r],{cw:n,includedIn:s,includes:i}=a;(!s.length&&n&&!t||!s.length&&!n&&t)&&(e[r].pathData=St(e[r].pathData),l[r].cw=!l[r].cw,n=l[r].cw);for(let t=0;t<i.length;t++){let a=i[t];l[a].cw===n&&(e[a].pathData=St(e[a].pathData),l[a].cw=!l[a].cw)}}return e}let gl={removeComments:!0,removeOffCanvas:!1,removeDimensions:!1,removeIds:!1,removeClassNames:!1,omitNamespace:!1,cleanUpStrokes:!0,addViewBox:!0,addDimensions:!1,removePrologue:!0,removeHidden:!0,removeUnused:!0,cleanupDefs:!0,cleanupClip:!0,cleanupSVGAtts:!0,removeNameSpaced:!0,removeNameSpacedAtts:!0,attributesToGroup:!1,minifyRgbColors:!0,stylesToAttributes:!1,fixHref:!1,legacyHref:!1,allowMeta:!1,allowDataAtts:!0,allowAriaAtts:!0,convertPathLength:!1,removeElements:[],removeSVGAttributes:[],removeElAttributes:[],unGroup:!1,mergePaths:!1,splitCompound:!1,shapesToPaths:!1,shapeConvert:0,convertShapes:["rect","ellipse","circle","line","polygon","polyline"],keepSmaller:!0,simplifyBezier:!0,optimizeOrder:!0,autoClose:!1,removeZeroLength:!0,refineClosing:!0,removeColinear:!0,flatBezierToLinetos:!0,revertToQuadratics:!0,refineExtremes:!1,simplifyCorners:!1,keepExtremes:!0,keepCorners:!0,keepInflections:!1,addExtremes:!1,fixDirections:!1,reversePath:!1,toAbsolute:!1,toRelative:!0,toMixed:!1,toShorthands:!0,toLonghands:!1,quadraticToCubic:!0,arcToCubic:!1,cubicToArc:!1,lineToCubic:!1,decimals:3,autoAccuracy:!0,minifyD:0,tolerance:1,toPolygon:!1,smoothPoly:!1,polyFormat:"object",precisionPoly:1,simplifyRD:0,simplifyRDP:0,harmonizeCpts:!1,removeOrphanSubpaths:!1,simplifyRound:!1,scale:1,scaleTo:0,crop:!1,alignToOrigin:!1,convertTransforms:!1};const vl={};for(let e in gl){let t=gl[e],l=!1===t||!0===t,a=!isNaN(t),r=Array.isArray(t);l?t=!1:!r&&a?t=1===t?1:"decimals"===e?-1:0:r&&(t=[]),vl[e]=t}const bl={default:gl,education:{...gl,keepSmaller:!1,toRelative:!1,toMixed:!1,toShorthands:!1,fixHref:!0,legacyHref:!1,addViewBox:!0,addDimensions:!0,removeComments:!1,decimals:3,minifyD:2},null:vl,editor:{...gl,keepSmaller:!1,toRelative:!0,toMixed:!0,toShorthands:!0,legacyHref:!0,addViewBox:!0,addDimensions:!0,removeComments:!0,autoAccuracy:!0,minifyD:.5},noSimplification:{...gl,simplifyBezier:!1,quadraticToCubic:!1,toRelative:!0,toShorthands:!0,fixHref:!0,optimizeOrder:!1,removeZeroLength:!1,refineExtremes:!1,refineClosing:!1,removeColinear:!1,flatBezierToLinetos:!1,addDimensions:!1,removeComments:!0,minifyD:0},path:{...gl,shapeConvert:"toPaths",convertShapes:["rect","ellipse","circle","line","polygon","polyline"],addViewBox:!0,minifyD:.5},poly:{...gl,toPolygon:!0},curvefit:{...gl,smoothPoly:!0},detransform:{...gl,convertTransforms:!0,addViewBox:!0,minifyD:.5},high:{...gl,tolerance:1.2,toMixed:!0,refineExtremes:!0,simplifyCorners:!0,simplifyRound:!0,removeClassNames:!0,cubicToArc:!0,removeComments:!0,removeHidden:!0,removeOffCanvas:!0,addViewBox:!0,removeDimensions:!0,minifyD:0}};function Al(e=[],{toRelative:t=!0,toShorthands:l=!0,minifyD:a=0,decimals:r=3,addDimensions:n=!1}={}){let s=(e=JSON.parse(JSON.stringify(e))).length,i=[],o=[];for(let t=0;t<s;t++){let l=e[t],{pathData:a,bb:r}=l;if(r.width&&r.height);else{r=Qe(_(a,!0)),e[t].bb=r}i.push(r.left,r.right),o.push(r.top,r.bottom),l.includes=[]}for(let t=0,l=e.length;t<l;t++){let a=e[t],{bb:r,poly:n}=a;for(let a=0;a<l;a++){let l=e[a];if(t===a)continue;let n=l.bb,s={x:n.x+.5*n.width,y:n.y+.5*n.height};s.x>=r.x&&s.y>=r.y&&s.x<=r.right&&s.y<=r.bottom&&e[t].includes.push(a)}}for(let t=0,l=e.length;t<l;t++){let l=e[t],{includes:a}=l;a.forEach(l=>{let a=e[l].pathData;a.length&&(e[t].pathData.push(...a),e[l].pathData=[])})}e=(e=e.filter(e=>e.pathData.length)).sort((e,t)=>e.bb.x-t.bb.x);let u=Math.min(...i),h=Math.min(...o),p=Math.max(...i)-u,c=Math.max(...o)-h;[u,h,p,c]=[u,h,p,c].map(e=>we(e,r));let y=`<svg ${n?`width="${p}" height="${c}"`:""} viewBox="${u} ${h} ${p} ${c}" xmlns="${k}">`;return e.forEach(e=>{let{pathData:n}=e;n=it(n,{toRelative:t,toShorthands:l,decimals:r});let s=We(n,a);y+=`<path d="${s}"/>`}),y+="</svg>",{pathData:e,svg:y}}function Ml(e="",t={}){let l=void 0!==t.preset&&t.preset?t.preset:null;t={...l&&void 0!==bl[l]?bl[l]:bl.default,...t};let{getObject:a=!1,removeComments:r,removeOffCanvas:n,unGroup:s,mergePaths:i,removeElements:o,removeDimensions:u,removeIds:h,removeClassNames:p,omitNamespace:c,cleanUpStrokes:y,addViewBox:f,addDimensions:x,removePrologue:m,removeHidden:d,removeUnused:g,cleanupDefs:v,cleanupClip:b,cleanupSVGAtts:A,removeNameSpaced:M,removeNameSpacedAtts:w,attributesToGroup:C,minifyRgbColors:k,stylesToAttributes:S,fixHref:E,legacyHref:P,allowMeta:D,allowDataAtts:L,allowAriaAtts:$,convertPathLength:T,removeSVGAttributes:N,removeElAttributes:q,shapesToPaths:j,shapeConvert:z,convertShapes:I,simplifyBezier:B,optimizeOrder:F,autoClose:O,removeZeroLength:R,refineClosing:Q,removeColinear:V,flatBezierToLinetos:G,revertToQuadratics:H,refineExtremes:U,simplifyCorners:Z,fixDirections:W,keepExtremes:X,keepCorners:J,keepInflections:Y,addExtremes:K,reversePath:ee,toAbsolute:te,toRelative:le,toMixed:ae,toShorthands:re,toLonghands:ne,quadraticToCubic:se,arcToCubic:ie,cubicToArc:oe,lineToCubic:ue,decimals:he,autoAccuracy:pe,minifyD:ce,tolerance:ye,toPolygon:xe,smoothPoly:de,polyFormat:ge,precisionPoly:be,simplifyRD:Ae,simplifyRDP:Ce,harmonizeCpts:ke,removeOrphanSubpaths:Se,simplifyRound:Ee,scale:Pe,scaleTo:De,crop:Le,alignToOrigin:$e,convertTransforms:Te,keepSmaller:Ne,splitCompound:qe}=t;ye=Math.max(.1,ye),Pe=Math.max(.001,Pe),W&&(Ne=!1),(1!==Pe||De||Le||$e)&&(Te=!0,t.convertTransforms=!0);let je=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 l=(e=e.trim()).includes("<svg")&&e.includes("</svg"),a=e.startsWith("<symbol")&&e.includes("</symbol"),r=e.startsWith("M")||e.startsWith("m"),n=!isNaN(e.substring(0,1))&&!isNaN(e.substring(e.length-1,e.length)),s=function(e){e=e.trim();let t=/\d/.test(e),l=/[abcdfghijklmnopqrstuvwz]/gi.test(e);return!(!t||l)&&(e.startsWith("[")&&e.endsWith("]"))}(e);if(l)t="svgMarkup";else if(s)t="json";else if(a)t="symbol";else if(r)t="pathDataString";else if(n)t="polyString";else{let l=/^(file:|https?:\/\/|\/|\.\/|\.\.\/)/.test(e),a=e.startsWith("data:image");t=l||a?"url":"string"}return t}return t=typeof e,(e.constructor.name||t).toLowerCase()}(e),ze="",Ie=0,Be=0,Fe=0,Oe={},Re="",Ve="svgMarkup"===je?1:0,Ge=[],He=[],Ue=[],Ze=[],Xe="",Ye="";Ie=e.length;let _e={x:0,y:0,width:0,height:0},tt={x:0,y:0,width:0,height:0},lt=[],at=[];ie=!!xe||ie,O=!1;let rt=[];if("json"===je){let t=[];/([{,]\s*)(x|y)(\s*:)/.test(e)&&(e=e.replaceAll("x:",'"x":').replaceAll("y:",'"y":'));try{t=JSON.parse(e)}catch{console.warn("No valid JSON")}t.length&&(je="polyArray",e=Pt(t))}if("svgMarkup"!==je&&"symbol"!==je){if("pathDataString"===je)Re=e;else if("polyString"===je)qe=!1,Ze=Pt(e),Re=tl(Ze,closed);else if("polyArray"===je||"polyObjectArray"===je||"polyComplexArray"===je||"polyComplexObjectArray"===je){qe=!1,Ze=Pt(e),Re=tl(Ze,!0),Xe=Re.map(e=>`${e.type} ${e.values.join(" ")}`).join(" "),Ye=Xe,Ie=Xe.length}else"pathData"===je?(Re=e,Xe=Array.from(Re).map(e=>`${e.type} ${e.values.join(" ")}`).join(" "),Ie=Xe.length):Re="M0 0 h0";He.push({d:Re,el:null})}else{"symbol"===je&&(e=e.replaceAll("<symbol","<svg").replaceAll("</symbol","</svg"),h=!1,u=!0),j&&(z="toPaths",convert_rects=!0,convert_ellipses=!0,convert_poly=!0,convert_lines=!0),ze=Ut(e,JSON.parse(JSON.stringify(t))).svg,ze.querySelectorAll("path").forEach((e,t)=>{let l=e.getAttribute("d");He.push({d:l,el:e,idx:t})}),_e=mt(ze,he)}let nt={toRelative:le,toMixed:ae,toShorthands:re,decimals:he};for(let e=0,t=He.length;t&&e<t;e++){let t=[],l=He[e],{d:a,el:r}=l,n=!1,s=st(a,{quadraticToCubic:se,arcToCubic:ie}),i=de||xe?Qe(_(s)):null;if(1!==Pe||De){if(De)if(_e.width&&!Le)Pe=De/_e.width;else{let e=s.map(e=>({type:e.type,values:e.values}));e=it(e,{arcToCubic:!0}),e=ve(e);let t=Qe(_(e));lt.push(t.x,t.x+t.width),at.push(t.y,t.y+t.height);let l=De/t.width;Pe=l}s=Yt(s,Pe)}let o=s.length;!n&&Se&&(s=At(s));let u=me(s),h=u.length;for(let e=0;e<h;e++){let l=u[e],a=[],r=Array.from(new Set(l.map(e=>e.type))).join("");n=!/[acqts]/gi.test(r);let s=!!n;if(n&&!Ve){a=_(l);let e=Qe(fe(a,64));Ae>0&&(a=el(a,{quality:Ae,width:e.width,height:e.height})),Ce>0&&(a=Kt(a,{quality:Ce,width:e.width,height:e.height})),xe=!1,l=tl(a,s)}else if(xe){B=!1,de=!1,ke=!1,l=et(l),l=xl(l,{precisionPoly:be,autoAccuracy:pe,simplifyRD:Ae,simplifyRDP:Ce}).pathData,n=!0}if(de&&n){l=Mt(l),l=fl(_(l),{denoise:.8,tolerance:ye,width:i.width,height:i.height,manhattan:!1,absolute:!1,keepCorners:J,keepExtremes:X,keepInflections:Y,closed:s,simplifyRD:Ae,simplifyRDP:Ce})}(V||R)&&(l=Mt(l)),F&&(l=wt(l)),V&&(l=bt(l,{tolerance:ye,flatBezierToLinetos:!1})),K&&(l=ve(l,{tMin:0,tMax:1,addExtremes:K,angles:[30]})),ee&&(l=St(l));let o={bb:{},dimA:0,pathData:[]};if(n){if(!a.length){let e=it(JSON.parse(JSON.stringify(l)),{toLonghands:!0,toAbsolute:!0,arcToCubic:!0,testTypes:!0});o.bb=Qe(_(e))}o.dimA=o.bb.width+o.bb.height,o.pathData=et(l,{addSquareLength:!1,addArea:!1,addAverageDim:!1})}else o=Ke(l);let{pathData:h,bb:p,dimA:c}=o;if(lt.push(p.x,p.x+p.width),at.push(p.y,p.y+p.height),Q&&(h=Jt(h,{threshold:.001*c})),h=B?Je(h,{simplifyBezier:B,keepInflections:Y,keepExtremes:X,keepCorners:J,revertToQuadratics:H,tolerance:ye}):h,U){h=Et(h,{threshold:.05*(p.width+p.height),tolerance:ye})}if(!ie&&oe&&(h=ft(h,{areaThreshold:2.5})),V&&G&&(h=bt(h,{tolerance:ye,flatBezierToLinetos:G})),Z){h=Zt(h,{threshold:.1*(p.width+p.height),tolerance:ye})}if(Ee&&(h=Xt(h)),H&&(h=_t(h,ye)),ue&&(h=ml(h)),F&&(h=Ct(h,{autoClose:O})),pe){let e=Me(h);rt.push(e)}t.push({pathData:h,bb:p})}let p=Math.min(...lt),c=Math.min(...at);tt={x:p,y:c,width:Math.max(...lt)-p,height:Math.max(...at)-c};let y=tt.height>tt.width;if(W&&(t=dl(t)),F&&(t=y?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)),s=[],Ge.push(t),t.forEach(e=>{s.push(...e.pathData)}),pe){rt=rt.sort().reverse();let e=rt[Math.floor(.5*rt.length)];he=Math.floor(.5*(rt[0]+e)),nt.decimals=he}if(n&&t.forEach(e=>{let t=_(e.pathData,!1,he);"array"===ge&&(t=Dt(t)),Ue.push(t)}),qe&&!Ve&&t.length>1){let e=Al(t,{toRelative:le,toShorthands:re,decimals:he,addDimensions:x});ze=(new DOMParser).parseFromString(e.svg,"image/svg+xml").querySelector("svg"),Ve=1,je="splitPath"}s=JSON.parse(JSON.stringify(s)),s=it(s,nt),R&&(s=Mt(s)),$e&&(s[0].values[0]=we(s[0].values[0]-tt.x,he),s[0].values[1]=we(s[0].values[1]-tt.y,he),tt.x=0,tt.y=0);let f=s.length,m=We(s,ce);Be=m.length,Fe=+(100/Ie*Be).toFixed(2),l.d=m,l.report={original:o,new:f,saved:o-f,compression:Fe,decimals:he},r&&r.setAttribute("d",m)}if(Ve||"symbol"===je){if(Pe){let{x:e,y:t,width:l,height:a,w:r,h:n,hasViewBox:s,hasWidth:i,hasHeight:o,widthUnit:u,heightUnit:h}=_e;Le&&(e=tt.x,t=tt.y,l=tt.width,a=tt.height,r=l,n=a),s&&ze.setAttribute("viewBox",[e,t,l,a].map(e=>we(e*Pe,he)).join(" ")),i&&ze.setAttribute("width",we(r*Pe,he)+u),o&&ze.setAttribute("height",we(n*Pe,he)+h)}if(W){ze.querySelectorAll("path[fill-rule], path[clip-rule]").forEach(e=>{e.removeAttribute("fill-rule"),e.removeAttribute("clip-rule")})}N.includes("xmlns")&&(c=!0),ze=zt(ze,{omitNamespace:c,removeComments:r,format:ce}),Be=ze.length,Fe=+(100/Ie*Be).toFixed(2),Ie=+(Ie/1024).toFixed(3),Be=+(Be/1024).toFixed(3),Oe={svgSize:Ie,svgSizeOpt:Be,compression:Fe,decimals:he},Ne&&Ie<Be&&!qe&&(ze=e,Oe.node="Original is smaller!")}else({d:Re,report:Oe}=He[0]);return Ue.length&&1===Ue.length&&(Ue=Ue[0]),"string"===ge&&Ue.length&&(Ue=Ue.flat().map(e=>`${e.x},${e.y}`).join(" ")),a?{svg:ze,d:Re,polys:Ue,report:Oe,pathDataPlusArr:Ge,inputType:je,dOriginal:Ye}:Re||ze}"undefined"!=typeof window&&(window.svgPathSimplify=Ml,window.getElementTransform=xe,window.getViewBox=mt),e.PI=M,e.abs=a,e.acos=r,e.asin=n,e.atan=s,e.atan2=i,e.ceil=o,e.cos=u,e.exp=h,e.floor=p,e.getElementTransform=xe,e.getViewBox=mt,e.hypot=y,e.log=c,e.max=f,e.min=x,e.pow=m,e.random=d,e.round=g,e.sin=v,e.sqrt=b,e.svgPathSimplify=Ml,e.tan=A}(this["svg-path-simplify"]=this["svg-path-simplify"]||{});
|