Socket
Socket
Sign inDemoInstall

svg-path-properties

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svg-path-properties - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

4

dist/svg-path-properties.cjs.js

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

// http://geoexamples.com/path-properties/ v1.1.0 Copyright 2023 Roger Veciana i Rovira
"use strict";function t(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function n(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(!t)return;if("string"==typeof t)return e(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return e(t,n)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}Object.defineProperty(exports,"__esModule",{value:!0});var i={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},h=/([astvzqmhlc])([^astvzqmhlc]*)/gi,r=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi,s=function(t){var n=t.match(r);return n?n.map(Number):[]},a=function(n,e,i,h){var r=this;t(this,"x0",void 0),t(this,"x1",void 0),t(this,"y0",void 0),t(this,"y1",void 0),t(this,"getTotalLength",(function(){return Math.sqrt(Math.pow(r.x0-r.x1,2)+Math.pow(r.y0-r.y1,2))})),t(this,"getPointAtLength",(function(t){var n=t/Math.sqrt(Math.pow(r.x0-r.x1,2)+Math.pow(r.y0-r.y1,2));n=Number.isNaN(n)?1:n;var e=(r.x1-r.x0)*n,i=(r.y1-r.y0)*n;return{x:r.x0+e,y:r.y0+i}})),t(this,"getTangentAtLength",(function(t){var n=Math.sqrt((r.x1-r.x0)*(r.x1-r.x0)+(r.y1-r.y0)*(r.y1-r.y0));return{x:-(r.x1-r.x0)/n,y:-(r.y1-r.y0)/n}})),t(this,"getPropertiesAtLength",(function(t){var n=r.getPointAtLength(t),e=r.getTangentAtLength(t);return{x:n.x,y:n.y,tangentX:e.x,tangentY:e.y}})),this.x0=n,this.x1=e,this.y0=i,this.y1=h},o=function(n,e,i,h,r,s,a,o,l){var c=this;t(this,"x0",void 0),t(this,"y0",void 0),t(this,"rx",void 0),t(this,"ry",void 0),t(this,"xAxisRotate",void 0),t(this,"LargeArcFlag",void 0),t(this,"SweepFlag",void 0),t(this,"x1",void 0),t(this,"y1",void 0),t(this,"length",void 0),t(this,"getTotalLength",(function(){return c.length})),t(this,"getPointAtLength",(function(t){t<0?t=0:t>c.length&&(t=c.length);var n=g({x:c.x0,y:c.y0},c.rx,c.ry,c.xAxisRotate,c.LargeArcFlag,c.SweepFlag,{x:c.x1,y:c.y1},t/c.length);return{x:n.x,y:n.y}})),t(this,"getTangentAtLength",(function(t){t<0?t=0:t>c.length&&(t=c.length);var n,e=.05,i=c.getPointAtLength(t);t<0?t=0:t>c.length&&(t=c.length);var h=(n=t<c.length-e?c.getPointAtLength(t+e):c.getPointAtLength(t-e)).x-i.x,r=n.y-i.y,s=Math.sqrt(h*h+r*r);return t<c.length-e?{x:-h/s,y:-r/s}:{x:h/s,y:r/s}})),t(this,"getPropertiesAtLength",(function(t){var n=c.getTangentAtLength(t),e=c.getPointAtLength(t);return{x:e.x,y:e.y,tangentX:n.x,tangentY:n.y}})),this.x0=n,this.y0=e,this.rx=i,this.ry=h,this.xAxisRotate=r,this.LargeArcFlag=s,this.SweepFlag=a,this.x1=o,this.y1=l;var f=u(300,(function(t){return g({x:n,y:e},i,h,r,s,a,{x:o,y:l},t)}));this.length=f.arcLength},g=function(t,n,e,i,h,r,s,a){n=Math.abs(n),e=Math.abs(e),i=l(i,360);var o=c(i);if(t.x===s.x&&t.y===s.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===n||0===e)return{x:0,y:0,ellipticalArcAngle:0};var g=(t.x-s.x)/2,u=(t.y-s.y)/2,f={x:Math.cos(o)*g+Math.sin(o)*u,y:-Math.sin(o)*g+Math.cos(o)*u},y=Math.pow(f.x,2)/Math.pow(n,2)+Math.pow(f.y,2)/Math.pow(e,2);y>1&&(n=Math.sqrt(y)*n,e=Math.sqrt(y)*e);var p=(Math.pow(n,2)*Math.pow(e,2)-Math.pow(n,2)*Math.pow(f.y,2)-Math.pow(e,2)*Math.pow(f.x,2))/(Math.pow(n,2)*Math.pow(f.y,2)+Math.pow(e,2)*Math.pow(f.x,2));p=p<0?0:p;var v=(h!==r?1:-1)*Math.sqrt(p),M=v*(n*f.y/e),L=v*(-e*f.x/n),w={x:Math.cos(o)*M-Math.sin(o)*L+(t.x+s.x)/2,y:Math.sin(o)*M+Math.cos(o)*L+(t.y+s.y)/2},A={x:(f.x-M)/n,y:(f.y-L)/e},d=x({x:1,y:0},A),P=x(A,{x:(-f.x-M)/n,y:(-f.y-L)/e});!r&&P>0?P-=2*Math.PI:r&&P<0&&(P+=2*Math.PI);var b=d+(P%=2*Math.PI)*a,T=n*Math.cos(b),m=e*Math.sin(b);return{x:Math.cos(o)*T-Math.sin(o)*m+w.x,y:Math.sin(o)*T+Math.cos(o)*m+w.y,ellipticalArcStartAngle:d,ellipticalArcEndAngle:d+P,ellipticalArcAngle:b,ellipticalArcCenter:w,resultantRx:n,resultantRy:e}},u=function(t,n){t=t||500;for(var e,i=0,h=[],r=[],s=n(0),a=0;a<t;a++){var o=y(a*(1/t),0,1);e=n(o),i+=f(s,e),r.push([s,e]),h.push({t:o,arcLength:i}),s=e}return e=n(1),r.push([s,e]),i+=f(s,e),h.push({t:1,arcLength:i}),{arcLength:i,arcLengthMap:h,approximationLines:r}},l=function(t,n){return(t%n+n)%n},c=function(t){return t*(Math.PI/180)},f=function(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))},y=function(t,n,e){return Math.min(Math.max(t,n),e)},x=function(t,n){var e=t.x*n.x+t.y*n.y,i=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(n.x,2)+Math.pow(n.y,2)));return(t.x*n.y-t.y*n.x<0?-1:1)*Math.acos(e/i)},p=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],v=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],M=[[1],[1,1],[1,2,1],[1,3,3,1]],L=function(t,n,e){return{x:(1-e)*(1-e)*(1-e)*t[0]+3*(1-e)*(1-e)*e*t[1]+3*(1-e)*e*e*t[2]+e*e*e*t[3],y:(1-e)*(1-e)*(1-e)*n[0]+3*(1-e)*(1-e)*e*n[1]+3*(1-e)*e*e*n[2]+e*e*e*n[3]}},w=function(t,n,e){return d([3*(t[1]-t[0]),3*(t[2]-t[1]),3*(t[3]-t[2])],[3*(n[1]-n[0]),3*(n[2]-n[1]),3*(n[3]-n[2])],e)},A=function(t,n,e){var i,h,r;i=e/2,h=0;for(var s=0;s<20;s++)r=i*p[20][s]+i,h+=v[20][s]*T(t,n,r);return i*h},d=function(t,n,e){return{x:(1-e)*(1-e)*t[0]+2*(1-e)*e*t[1]+e*e*t[2],y:(1-e)*(1-e)*n[0]+2*(1-e)*e*n[1]+e*e*n[2]}},P=function(t,n,e){void 0===e&&(e=1);var i=t[0]-2*t[1]+t[2],h=n[0]-2*n[1]+n[2],r=2*t[1]-2*t[0],s=2*n[1]-2*n[0],a=4*(i*i+h*h),o=4*(i*r+h*s),g=r*r+s*s;if(0===a)return e*Math.sqrt(Math.pow(t[2]-t[0],2)+Math.pow(n[2]-n[0],2));var u=o/(2*a),l=e+u,c=g/a-u*u,f=l*l+c>0?Math.sqrt(l*l+c):0,y=u*u+c>0?Math.sqrt(u*u+c):0,x=u+Math.sqrt(u*u+c)!==0&&(l+f)/(u+y)!=0?c*Math.log(Math.abs((l+f)/(u+y))):0;return Math.sqrt(a)/2*(l*f-u*y+x)},b=function(t,n,e){return{x:2*(1-e)*(t[1]-t[0])+2*e*(t[2]-t[1]),y:2*(1-e)*(n[1]-n[0])+2*e*(n[2]-n[1])}};function T(t,n,e){var i=m(1,e,t),h=m(1,e,n),r=i*i+h*h;return Math.sqrt(r)}var m=function t(n,e,i){var h,r,s=i.length-1;if(0===s)return 0;if(0===n){r=0;for(var a=0;a<=s;a++)r+=M[s][a]*Math.pow(1-e,s-a)*Math.pow(e,a)*i[a];return r}h=new Array(s);for(var o=0;o<s;o++)h[o]=s*(i[o+1]-i[o]);return t(n-1,e,h)},q=function(t,n,e){for(var i=1,h=t/n,r=(t-e(h))/n,s=0;i>.001;){var a=e(h+r),o=Math.abs(t-a)/n;if(o<i)i=o,h+=r;else{var g=e(h-r),u=Math.abs(t-g)/n;u<i?(i=u,h-=r):r/=2}if(++s>500)break}return h},_=function(n,e,i,h,r,s,a,o){var g=this;t(this,"a",void 0),t(this,"b",void 0),t(this,"c",void 0),t(this,"d",void 0),t(this,"length",void 0),t(this,"getArcLength",void 0),t(this,"getPoint",void 0),t(this,"getDerivative",void 0),t(this,"getTotalLength",(function(){return g.length})),t(this,"getPointAtLength",(function(t){var n=[g.a.x,g.b.x,g.c.x,g.d.x],e=[g.a.y,g.b.y,g.c.y,g.d.y],i=q(t,g.length,(function(t){return g.getArcLength(n,e,t)}));return g.getPoint(n,e,i)})),t(this,"getTangentAtLength",(function(t){var n=[g.a.x,g.b.x,g.c.x,g.d.x],e=[g.a.y,g.b.y,g.c.y,g.d.y],i=q(t,g.length,(function(t){return g.getArcLength(n,e,t)})),h=g.getDerivative(n,e,i),r=Math.sqrt(h.x*h.x+h.y*h.y);return r>0?{x:h.x/r,y:h.y/r}:{x:0,y:0}})),t(this,"getPropertiesAtLength",(function(t){var n,e=[g.a.x,g.b.x,g.c.x,g.d.x],i=[g.a.y,g.b.y,g.c.y,g.d.y],h=q(t,g.length,(function(t){return g.getArcLength(e,i,t)})),r=g.getDerivative(e,i,h),s=Math.sqrt(r.x*r.x+r.y*r.y);n=s>0?{x:r.x/s,y:r.y/s}:{x:0,y:0};var a=g.getPoint(e,i,h);return{x:a.x,y:a.y,tangentX:n.x,tangentY:n.y}})),t(this,"getC",(function(){return g.c})),t(this,"getD",(function(){return g.d})),this.a={x:n,y:e},this.b={x:i,y:h},this.c={x:r,y:s},void 0!==a&&void 0!==o?(this.getArcLength=A,this.getPoint=L,this.getDerivative=w,this.d={x:a,y:o}):(this.getArcLength=P,this.getPoint=d,this.getDerivative=b,this.d={x:0,y:0}),this.length=this.getArcLength([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],1)},S=function(e){var r=this;t(this,"length",0),t(this,"partial_lengths",[]),t(this,"functions",[]),t(this,"initial_point",null),t(this,"getPartAtLength",(function(t){t<0?t=0:t>r.length&&(t=r.length);for(var n=r.partial_lengths.length-1;r.partial_lengths[n]>=t&&n>0;)n--;return n++,{fraction:t-r.partial_lengths[n-1],i:n}})),t(this,"getTotalLength",(function(){return r.length})),t(this,"getPointAtLength",(function(t){var n=r.getPartAtLength(t),e=r.functions[n.i];if(e)return e.getPointAtLength(n.fraction);if(r.initial_point)return r.initial_point;throw new Error("Wrong function at this part.")})),t(this,"getTangentAtLength",(function(t){var n=r.getPartAtLength(t),e=r.functions[n.i];if(e)return e.getTangentAtLength(n.fraction);if(r.initial_point)return{x:0,y:0};throw new Error("Wrong function at this part.")})),t(this,"getPropertiesAtLength",(function(t){var n=r.getPartAtLength(t),e=r.functions[n.i];if(e)return e.getPropertiesAtLength(n.fraction);if(r.initial_point)return{x:r.initial_point.x,y:r.initial_point.y,tangentX:0,tangentY:0};throw new Error("Wrong function at this part.")})),t(this,"getParts",(function(){for(var t=[],n=0;n<r.functions.length;n++)if(null!==r.functions[n]){r.functions[n]=r.functions[n];var e={start:r.functions[n].getPointAtLength(0),end:r.functions[n].getPointAtLength(r.partial_lengths[n]-r.partial_lengths[n-1]),length:r.partial_lengths[n]-r.partial_lengths[n-1],getPointAtLength:r.functions[n].getPointAtLength,getTangentAtLength:r.functions[n].getTangentAtLength,getPropertiesAtLength:r.functions[n].getPropertiesAtLength};t.push(e)}return t}));for(var g,u=Array.isArray(e)?e:function(t){var e=(t&&t.length>0?t:"M0,0").match(h);if(!e)throw new Error("No path elements found in string ".concat(t));return e.reduce((function(t,e){var h=e.charAt(0),r=h.toLowerCase(),a=s(e.substr(1));for("m"===r&&a.length>2&&(t.push([h].concat(n(a.splice(0,2)))),r="l",h="m"===h?"l":"L");a.length>=0;){if(a.length===i[r]){t.push([h].concat(n(a.splice(0,i[r]))));break}if(a.length<i[r])throw new Error('Malformed path data: "'.concat(h,'" must have ').concat(i[r]," elements and has ").concat(a.length,": ").concat(e));t.push([h].concat(n(a.splice(0,i[r]))))}return t}),[])}(e),l=[0,0],c=[0,0],f=[0,0],y=0;y<u.length;y++){if("M"===u[y][0])f=[(l=[u[y][1],u[y][2]])[0],l[1]],this.functions.push(null),0===y&&(this.initial_point={x:u[y][1],y:u[y][2]});else if("m"===u[y][0])f=[(l=[u[y][1]+l[0],u[y][2]+l[1]])[0],l[1]],this.functions.push(null);else if("L"===u[y][0])this.length+=Math.sqrt(Math.pow(l[0]-u[y][1],2)+Math.pow(l[1]-u[y][2],2)),this.functions.push(new a(l[0],u[y][1],l[1],u[y][2])),l=[u[y][1],u[y][2]];else if("l"===u[y][0])this.length+=Math.sqrt(Math.pow(u[y][1],2)+Math.pow(u[y][2],2)),this.functions.push(new a(l[0],u[y][1]+l[0],l[1],u[y][2]+l[1])),l=[u[y][1]+l[0],u[y][2]+l[1]];else if("H"===u[y][0])this.length+=Math.abs(l[0]-u[y][1]),this.functions.push(new a(l[0],u[y][1],l[1],l[1])),l[0]=u[y][1];else if("h"===u[y][0])this.length+=Math.abs(u[y][1]),this.functions.push(new a(l[0],l[0]+u[y][1],l[1],l[1])),l[0]=u[y][1]+l[0];else if("V"===u[y][0])this.length+=Math.abs(l[1]-u[y][1]),this.functions.push(new a(l[0],l[0],l[1],u[y][1])),l[1]=u[y][1];else if("v"===u[y][0])this.length+=Math.abs(u[y][1]),this.functions.push(new a(l[0],l[0],l[1],l[1]+u[y][1])),l[1]=u[y][1]+l[1];else if("z"===u[y][0]||"Z"===u[y][0])this.length+=Math.sqrt(Math.pow(f[0]-l[0],2)+Math.pow(f[1]-l[1],2)),this.functions.push(new a(l[0],f[0],l[1],f[1])),l=[f[0],f[1]];else if("C"===u[y][0])g=new _(l[0],l[1],u[y][1],u[y][2],u[y][3],u[y][4],u[y][5],u[y][6]),this.length+=g.getTotalLength(),l=[u[y][5],u[y][6]],this.functions.push(g);else if("c"===u[y][0])(g=new _(l[0],l[1],l[0]+u[y][1],l[1]+u[y][2],l[0]+u[y][3],l[1]+u[y][4],l[0]+u[y][5],l[1]+u[y][6])).getTotalLength()>0?(this.length+=g.getTotalLength(),this.functions.push(g),l=[u[y][5]+l[0],u[y][6]+l[1]]):this.functions.push(new a(l[0],l[0],l[1],l[1]));else if("S"===u[y][0]){if(y>0&&["C","c","S","s"].indexOf(u[y-1][0])>-1){if(g){var x=g.getC();g=new _(l[0],l[1],2*l[0]-x.x,2*l[1]-x.y,u[y][1],u[y][2],u[y][3],u[y][4])}}else g=new _(l[0],l[1],l[0],l[1],u[y][1],u[y][2],u[y][3],u[y][4]);g&&(this.length+=g.getTotalLength(),l=[u[y][3],u[y][4]],this.functions.push(g))}else if("s"===u[y][0]){if(y>0&&["C","c","S","s"].indexOf(u[y-1][0])>-1){if(g){var p=g.getC(),v=g.getD();g=new _(l[0],l[1],l[0]+v.x-p.x,l[1]+v.y-p.y,l[0]+u[y][1],l[1]+u[y][2],l[0]+u[y][3],l[1]+u[y][4])}}else g=new _(l[0],l[1],l[0],l[1],l[0]+u[y][1],l[1]+u[y][2],l[0]+u[y][3],l[1]+u[y][4]);g&&(this.length+=g.getTotalLength(),l=[u[y][3]+l[0],u[y][4]+l[1]],this.functions.push(g))}else if("Q"===u[y][0]){if(l[0]==u[y][1]&&l[1]==u[y][2]){var M=new a(u[y][1],u[y][3],u[y][2],u[y][4]);this.length+=M.getTotalLength(),this.functions.push(M)}else g=new _(l[0],l[1],u[y][1],u[y][2],u[y][3],u[y][4],void 0,void 0),this.length+=g.getTotalLength(),this.functions.push(g);l=[u[y][3],u[y][4]],c=[u[y][1],u[y][2]]}else if("q"===u[y][0]){if(0!=u[y][1]||0!=u[y][2])g=new _(l[0],l[1],l[0]+u[y][1],l[1]+u[y][2],l[0]+u[y][3],l[1]+u[y][4],void 0,void 0),this.length+=g.getTotalLength(),this.functions.push(g);else{var L=new a(l[0]+u[y][1],l[0]+u[y][3],l[1]+u[y][2],l[1]+u[y][4]);this.length+=L.getTotalLength(),this.functions.push(L)}c=[l[0]+u[y][1],l[1]+u[y][2]],l=[u[y][3]+l[0],u[y][4]+l[1]]}else if("T"===u[y][0]){if(y>0&&["Q","q","T","t"].indexOf(u[y-1][0])>-1)g=new _(l[0],l[1],2*l[0]-c[0],2*l[1]-c[1],u[y][1],u[y][2],void 0,void 0),this.functions.push(g),this.length+=g.getTotalLength();else{var w=new a(l[0],u[y][1],l[1],u[y][2]);this.functions.push(w),this.length+=w.getTotalLength()}c=[2*l[0]-c[0],2*l[1]-c[1]],l=[u[y][1],u[y][2]]}else if("t"===u[y][0]){if(y>0&&["Q","q","T","t"].indexOf(u[y-1][0])>-1)g=new _(l[0],l[1],2*l[0]-c[0],2*l[1]-c[1],l[0]+u[y][1],l[1]+u[y][2],void 0,void 0),this.length+=g.getTotalLength(),this.functions.push(g);else{var A=new a(l[0],l[0]+u[y][1],l[1],l[1]+u[y][2]);this.length+=A.getTotalLength(),this.functions.push(A)}c=[2*l[0]-c[0],2*l[1]-c[1]],l=[u[y][1]+l[0],u[y][2]+l[1]]}else if("A"===u[y][0]){var d=new o(l[0],l[1],u[y][1],u[y][2],u[y][3],1===u[y][4],1===u[y][5],u[y][6],u[y][7]);this.length+=d.getTotalLength(),l=[u[y][6],u[y][7]],this.functions.push(d)}else if("a"===u[y][0]){var P=new o(l[0],l[1],u[y][1],u[y][2],u[y][3],1===u[y][4],1===u[y][5],l[0]+u[y][6],l[1]+u[y][7]);this.length+=P.getTotalLength(),l=[l[0]+u[y][6],l[1]+u[y][7]],this.functions.push(P)}this.partial_lengths.push(this.length)}},C=function(n){var e=this;if(t(this,"inst",void 0),t(this,"getTotalLength",(function(){return e.inst.getTotalLength()})),t(this,"getPointAtLength",(function(t){return e.inst.getPointAtLength(t)})),t(this,"getTangentAtLength",(function(t){return e.inst.getTangentAtLength(t)})),t(this,"getPropertiesAtLength",(function(t){return e.inst.getPropertiesAtLength(t)})),t(this,"getParts",(function(){return e.inst.getParts()})),this.inst=new S(n),!(this instanceof C))return new C(n)};exports.svgPathProperties=C;
// http://geoexamples.com/path-properties/ v1.1.1 Copyright 2023 Roger Veciana i Rovira
"use strict";function t(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,h(i.key),i)}}function n(n,e,i){return e&&t(n.prototype,e),i&&t(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function e(t,n,e){return(n=h(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function i(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){if(!t)return;if("string"==typeof t)return r(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return r(t,n)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function h(t){var n=function(t,n){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,n||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==typeof n?n:String(n)}Object.defineProperty(exports,"__esModule",{value:!0});var s={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},a=/([astvzqmhlc])([^astvzqmhlc]*)/gi,o=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi,g=function(t){var n=t.match(o);return n?n.map(Number):[]},u=n((function(t,n,i,r){var h=this;e(this,"x0",void 0),e(this,"x1",void 0),e(this,"y0",void 0),e(this,"y1",void 0),e(this,"getTotalLength",(function(){return Math.sqrt(Math.pow(h.x0-h.x1,2)+Math.pow(h.y0-h.y1,2))})),e(this,"getPointAtLength",(function(t){var n=t/Math.sqrt(Math.pow(h.x0-h.x1,2)+Math.pow(h.y0-h.y1,2));n=Number.isNaN(n)?1:n;var e=(h.x1-h.x0)*n,i=(h.y1-h.y0)*n;return{x:h.x0+e,y:h.y0+i}})),e(this,"getTangentAtLength",(function(t){var n=Math.sqrt((h.x1-h.x0)*(h.x1-h.x0)+(h.y1-h.y0)*(h.y1-h.y0));return{x:(h.x1-h.x0)/n,y:(h.y1-h.y0)/n}})),e(this,"getPropertiesAtLength",(function(t){var n=h.getPointAtLength(t),e=h.getTangentAtLength(t);return{x:n.x,y:n.y,tangentX:e.x,tangentY:e.y}})),this.x0=t,this.x1=n,this.y0=i,this.y1=r})),l=n((function(t,n,i,r,h,s,a,o,g){var u=this;e(this,"x0",void 0),e(this,"y0",void 0),e(this,"rx",void 0),e(this,"ry",void 0),e(this,"xAxisRotate",void 0),e(this,"LargeArcFlag",void 0),e(this,"SweepFlag",void 0),e(this,"x1",void 0),e(this,"y1",void 0),e(this,"length",void 0),e(this,"getTotalLength",(function(){return u.length})),e(this,"getPointAtLength",(function(t){t<0?t=0:t>u.length&&(t=u.length);var n=c({x:u.x0,y:u.y0},u.rx,u.ry,u.xAxisRotate,u.LargeArcFlag,u.SweepFlag,{x:u.x1,y:u.y1},t/u.length);return{x:n.x,y:n.y}})),e(this,"getTangentAtLength",(function(t){t<0?t=0:t>u.length&&(t=u.length);var n,e=.05,i=u.getPointAtLength(t);t<0?t=0:t>u.length&&(t=u.length);var r=(n=t<u.length-e?u.getPointAtLength(t+e):u.getPointAtLength(t-e)).x-i.x,h=n.y-i.y,s=Math.sqrt(r*r+h*h);return t<u.length-e?{x:-r/s,y:-h/s}:{x:r/s,y:h/s}})),e(this,"getPropertiesAtLength",(function(t){var n=u.getTangentAtLength(t),e=u.getPointAtLength(t);return{x:e.x,y:e.y,tangentX:n.x,tangentY:n.y}})),this.x0=t,this.y0=n,this.rx=i,this.ry=r,this.xAxisRotate=h,this.LargeArcFlag=s,this.SweepFlag=a,this.x1=o,this.y1=g;var l=f(300,(function(e){return c({x:t,y:n},i,r,h,s,a,{x:o,y:g},e)}));this.length=l.arcLength})),c=function(t,n,e,i,r,h,s,a){n=Math.abs(n),e=Math.abs(e),i=y(i,360);var o=p(i);if(t.x===s.x&&t.y===s.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===n||0===e)return{x:0,y:0,ellipticalArcAngle:0};var g=(t.x-s.x)/2,u=(t.y-s.y)/2,l={x:Math.cos(o)*g+Math.sin(o)*u,y:-Math.sin(o)*g+Math.cos(o)*u},c=Math.pow(l.x,2)/Math.pow(n,2)+Math.pow(l.y,2)/Math.pow(e,2);c>1&&(n=Math.sqrt(c)*n,e=Math.sqrt(c)*e);var f=(Math.pow(n,2)*Math.pow(e,2)-Math.pow(n,2)*Math.pow(l.y,2)-Math.pow(e,2)*Math.pow(l.x,2))/(Math.pow(n,2)*Math.pow(l.y,2)+Math.pow(e,2)*Math.pow(l.x,2));f=f<0?0:f;var x=(r!==h?1:-1)*Math.sqrt(f),v=x*(n*l.y/e),w=x*(-e*l.x/n),L={x:Math.cos(o)*v-Math.sin(o)*w+(t.x+s.x)/2,y:Math.sin(o)*v+Math.cos(o)*w+(t.y+s.y)/2},A={x:(l.x-v)/n,y:(l.y-w)/e},d=M({x:1,y:0},A),b=M(A,{x:(-l.x-v)/n,y:(-l.y-w)/e});!h&&b>0?b-=2*Math.PI:h&&b<0&&(b+=2*Math.PI);var P=d+(b%=2*Math.PI)*a,m=n*Math.cos(P),T=e*Math.sin(P);return{x:Math.cos(o)*m-Math.sin(o)*T+L.x,y:Math.sin(o)*m+Math.cos(o)*T+L.y,ellipticalArcStartAngle:d,ellipticalArcEndAngle:d+b,ellipticalArcAngle:P,ellipticalArcCenter:L,resultantRx:n,resultantRy:e}},f=function(t,n){t=t||500;for(var e,i=0,r=[],h=[],s=n(0),a=0;a<t;a++){var o=v(a*(1/t),0,1);e=n(o),i+=x(s,e),h.push([s,e]),r.push({t:o,arcLength:i}),s=e}return e=n(1),h.push([s,e]),i+=x(s,e),r.push({t:1,arcLength:i}),{arcLength:i,arcLengthMap:r,approximationLines:h}},y=function(t,n){return(t%n+n)%n},p=function(t){return t*(Math.PI/180)},x=function(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))},v=function(t,n,e){return Math.min(Math.max(t,n),e)},M=function(t,n){var e=t.x*n.x+t.y*n.y,i=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(n.x,2)+Math.pow(n.y,2)));return(t.x*n.y-t.y*n.x<0?-1:1)*Math.acos(e/i)},w=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],L=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],A=[[1],[1,1],[1,2,1],[1,3,3,1]],d=function(t,n,e){return{x:(1-e)*(1-e)*(1-e)*t[0]+3*(1-e)*(1-e)*e*t[1]+3*(1-e)*e*e*t[2]+e*e*e*t[3],y:(1-e)*(1-e)*(1-e)*n[0]+3*(1-e)*(1-e)*e*n[1]+3*(1-e)*e*e*n[2]+e*e*e*n[3]}},b=function(t,n,e){return m([3*(t[1]-t[0]),3*(t[2]-t[1]),3*(t[3]-t[2])],[3*(n[1]-n[0]),3*(n[2]-n[1]),3*(n[3]-n[2])],e)},P=function(t,n,e){var i,r,h;i=e/2,r=0;for(var s=0;s<20;s++)h=i*w[20][s]+i,r+=L[20][s]*_(t,n,h);return i*r},m=function(t,n,e){return{x:(1-e)*(1-e)*t[0]+2*(1-e)*e*t[1]+e*e*t[2],y:(1-e)*(1-e)*n[0]+2*(1-e)*e*n[1]+e*e*n[2]}},T=function(t,n,e){void 0===e&&(e=1);var i=t[0]-2*t[1]+t[2],r=n[0]-2*n[1]+n[2],h=2*t[1]-2*t[0],s=2*n[1]-2*n[0],a=4*(i*i+r*r),o=4*(i*h+r*s),g=h*h+s*s;if(0===a)return e*Math.sqrt(Math.pow(t[2]-t[0],2)+Math.pow(n[2]-n[0],2));var u=o/(2*a),l=e+u,c=g/a-u*u,f=l*l+c>0?Math.sqrt(l*l+c):0,y=u*u+c>0?Math.sqrt(u*u+c):0,p=u+Math.sqrt(u*u+c)!==0&&(l+f)/(u+y)!=0?c*Math.log(Math.abs((l+f)/(u+y))):0;return Math.sqrt(a)/2*(l*f-u*y+p)},q=function(t,n,e){return{x:2*(1-e)*(t[1]-t[0])+2*e*(t[2]-t[1]),y:2*(1-e)*(n[1]-n[0])+2*e*(n[2]-n[1])}};function _(t,n,e){var i=S(1,e,t),r=S(1,e,n),h=i*i+r*r;return Math.sqrt(h)}var S=function t(n,e,i){var r,h,s=i.length-1;if(0===s)return 0;if(0===n){h=0;for(var a=0;a<=s;a++)h+=A[s][a]*Math.pow(1-e,s-a)*Math.pow(e,a)*i[a];return h}r=new Array(s);for(var o=0;o<s;o++)r[o]=s*(i[o+1]-i[o]);return t(n-1,e,r)},O=function(t,n,e){for(var i=1,r=t/n,h=(t-e(r))/n,s=0;i>.001;){var a=e(r+h),o=Math.abs(t-a)/n;if(o<i)i=o,r+=h;else{var g=e(r-h),u=Math.abs(t-g)/n;u<i?(i=u,r-=h):h/=2}if(++s>500)break}return r},j=n((function(t,n,i,r,h,s,a,o){var g=this;e(this,"a",void 0),e(this,"b",void 0),e(this,"c",void 0),e(this,"d",void 0),e(this,"length",void 0),e(this,"getArcLength",void 0),e(this,"getPoint",void 0),e(this,"getDerivative",void 0),e(this,"getTotalLength",(function(){return g.length})),e(this,"getPointAtLength",(function(t){var n=[g.a.x,g.b.x,g.c.x,g.d.x],e=[g.a.y,g.b.y,g.c.y,g.d.y],i=O(t,g.length,(function(t){return g.getArcLength(n,e,t)}));return g.getPoint(n,e,i)})),e(this,"getTangentAtLength",(function(t){var n=[g.a.x,g.b.x,g.c.x,g.d.x],e=[g.a.y,g.b.y,g.c.y,g.d.y],i=O(t,g.length,(function(t){return g.getArcLength(n,e,t)})),r=g.getDerivative(n,e,i),h=Math.sqrt(r.x*r.x+r.y*r.y);return h>0?{x:r.x/h,y:r.y/h}:{x:0,y:0}})),e(this,"getPropertiesAtLength",(function(t){var n,e=[g.a.x,g.b.x,g.c.x,g.d.x],i=[g.a.y,g.b.y,g.c.y,g.d.y],r=O(t,g.length,(function(t){return g.getArcLength(e,i,t)})),h=g.getDerivative(e,i,r),s=Math.sqrt(h.x*h.x+h.y*h.y);n=s>0?{x:h.x/s,y:h.y/s}:{x:0,y:0};var a=g.getPoint(e,i,r);return{x:a.x,y:a.y,tangentX:n.x,tangentY:n.y}})),e(this,"getC",(function(){return g.c})),e(this,"getD",(function(){return g.d})),this.a={x:t,y:n},this.b={x:i,y:r},this.c={x:h,y:s},void 0!==a&&void 0!==o?(this.getArcLength=P,this.getPoint=d,this.getDerivative=b,this.d={x:a,y:o}):(this.getArcLength=T,this.getPoint=m,this.getDerivative=q,this.d={x:0,y:0}),this.length=this.getArcLength([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],1)})),C=n((function(t){var n=this;e(this,"length",0),e(this,"partial_lengths",[]),e(this,"functions",[]),e(this,"initial_point",null),e(this,"getPartAtLength",(function(t){t<0?t=0:t>n.length&&(t=n.length);for(var e=n.partial_lengths.length-1;n.partial_lengths[e]>=t&&e>0;)e--;return e++,{fraction:t-n.partial_lengths[e-1],i:e}})),e(this,"getTotalLength",(function(){return n.length})),e(this,"getPointAtLength",(function(t){var e=n.getPartAtLength(t),i=n.functions[e.i];if(i)return i.getPointAtLength(e.fraction);if(n.initial_point)return n.initial_point;throw new Error("Wrong function at this part.")})),e(this,"getTangentAtLength",(function(t){var e=n.getPartAtLength(t),i=n.functions[e.i];if(i)return i.getTangentAtLength(e.fraction);if(n.initial_point)return{x:0,y:0};throw new Error("Wrong function at this part.")})),e(this,"getPropertiesAtLength",(function(t){var e=n.getPartAtLength(t),i=n.functions[e.i];if(i)return i.getPropertiesAtLength(e.fraction);if(n.initial_point)return{x:n.initial_point.x,y:n.initial_point.y,tangentX:0,tangentY:0};throw new Error("Wrong function at this part.")})),e(this,"getParts",(function(){for(var t=[],e=0;e<n.functions.length;e++)if(null!==n.functions[e]){n.functions[e]=n.functions[e];var i={start:n.functions[e].getPointAtLength(0),end:n.functions[e].getPointAtLength(n.partial_lengths[e]-n.partial_lengths[e-1]),length:n.partial_lengths[e]-n.partial_lengths[e-1],getPointAtLength:n.functions[e].getPointAtLength,getTangentAtLength:n.functions[e].getTangentAtLength,getPropertiesAtLength:n.functions[e].getPropertiesAtLength};t.push(i)}return t}));for(var r,h=Array.isArray(t)?t:function(t){var n=(t&&t.length>0?t:"M0,0").match(a);if(!n)throw new Error("No path elements found in string ".concat(t));return n.reduce((function(t,n){var e=n.charAt(0),r=e.toLowerCase(),h=g(n.substr(1));for("m"===r&&h.length>2&&(t.push([e].concat(i(h.splice(0,2)))),r="l",e="m"===e?"l":"L");h.length>=0;){if(h.length===s[r]){t.push([e].concat(i(h.splice(0,s[r]))));break}if(h.length<s[r])throw new Error('Malformed path data: "'.concat(e,'" must have ').concat(s[r]," elements and has ").concat(h.length,": ").concat(n));t.push([e].concat(i(h.splice(0,s[r]))))}return t}),[])}(t),o=[0,0],c=[0,0],f=[0,0],y=0;y<h.length;y++){if("M"===h[y][0])f=[(o=[h[y][1],h[y][2]])[0],o[1]],this.functions.push(null),0===y&&(this.initial_point={x:h[y][1],y:h[y][2]});else if("m"===h[y][0])f=[(o=[h[y][1]+o[0],h[y][2]+o[1]])[0],o[1]],this.functions.push(null);else if("L"===h[y][0])this.length+=Math.sqrt(Math.pow(o[0]-h[y][1],2)+Math.pow(o[1]-h[y][2],2)),this.functions.push(new u(o[0],h[y][1],o[1],h[y][2])),o=[h[y][1],h[y][2]];else if("l"===h[y][0])this.length+=Math.sqrt(Math.pow(h[y][1],2)+Math.pow(h[y][2],2)),this.functions.push(new u(o[0],h[y][1]+o[0],o[1],h[y][2]+o[1])),o=[h[y][1]+o[0],h[y][2]+o[1]];else if("H"===h[y][0])this.length+=Math.abs(o[0]-h[y][1]),this.functions.push(new u(o[0],h[y][1],o[1],o[1])),o[0]=h[y][1];else if("h"===h[y][0])this.length+=Math.abs(h[y][1]),this.functions.push(new u(o[0],o[0]+h[y][1],o[1],o[1])),o[0]=h[y][1]+o[0];else if("V"===h[y][0])this.length+=Math.abs(o[1]-h[y][1]),this.functions.push(new u(o[0],o[0],o[1],h[y][1])),o[1]=h[y][1];else if("v"===h[y][0])this.length+=Math.abs(h[y][1]),this.functions.push(new u(o[0],o[0],o[1],o[1]+h[y][1])),o[1]=h[y][1]+o[1];else if("z"===h[y][0]||"Z"===h[y][0])this.length+=Math.sqrt(Math.pow(f[0]-o[0],2)+Math.pow(f[1]-o[1],2)),this.functions.push(new u(o[0],f[0],o[1],f[1])),o=[f[0],f[1]];else if("C"===h[y][0])r=new j(o[0],o[1],h[y][1],h[y][2],h[y][3],h[y][4],h[y][5],h[y][6]),this.length+=r.getTotalLength(),o=[h[y][5],h[y][6]],this.functions.push(r);else if("c"===h[y][0])(r=new j(o[0],o[1],o[0]+h[y][1],o[1]+h[y][2],o[0]+h[y][3],o[1]+h[y][4],o[0]+h[y][5],o[1]+h[y][6])).getTotalLength()>0?(this.length+=r.getTotalLength(),this.functions.push(r),o=[h[y][5]+o[0],h[y][6]+o[1]]):this.functions.push(new u(o[0],o[0],o[1],o[1]));else if("S"===h[y][0]){if(y>0&&["C","c","S","s"].indexOf(h[y-1][0])>-1){if(r){var p=r.getC();r=new j(o[0],o[1],2*o[0]-p.x,2*o[1]-p.y,h[y][1],h[y][2],h[y][3],h[y][4])}}else r=new j(o[0],o[1],o[0],o[1],h[y][1],h[y][2],h[y][3],h[y][4]);r&&(this.length+=r.getTotalLength(),o=[h[y][3],h[y][4]],this.functions.push(r))}else if("s"===h[y][0]){if(y>0&&["C","c","S","s"].indexOf(h[y-1][0])>-1){if(r){var x=r.getC(),v=r.getD();r=new j(o[0],o[1],o[0]+v.x-x.x,o[1]+v.y-x.y,o[0]+h[y][1],o[1]+h[y][2],o[0]+h[y][3],o[1]+h[y][4])}}else r=new j(o[0],o[1],o[0],o[1],o[0]+h[y][1],o[1]+h[y][2],o[0]+h[y][3],o[1]+h[y][4]);r&&(this.length+=r.getTotalLength(),o=[h[y][3]+o[0],h[y][4]+o[1]],this.functions.push(r))}else if("Q"===h[y][0]){if(o[0]==h[y][1]&&o[1]==h[y][2]){var M=new u(h[y][1],h[y][3],h[y][2],h[y][4]);this.length+=M.getTotalLength(),this.functions.push(M)}else r=new j(o[0],o[1],h[y][1],h[y][2],h[y][3],h[y][4],void 0,void 0),this.length+=r.getTotalLength(),this.functions.push(r);o=[h[y][3],h[y][4]],c=[h[y][1],h[y][2]]}else if("q"===h[y][0]){if(0!=h[y][1]||0!=h[y][2])r=new j(o[0],o[1],o[0]+h[y][1],o[1]+h[y][2],o[0]+h[y][3],o[1]+h[y][4],void 0,void 0),this.length+=r.getTotalLength(),this.functions.push(r);else{var w=new u(o[0]+h[y][1],o[0]+h[y][3],o[1]+h[y][2],o[1]+h[y][4]);this.length+=w.getTotalLength(),this.functions.push(w)}c=[o[0]+h[y][1],o[1]+h[y][2]],o=[h[y][3]+o[0],h[y][4]+o[1]]}else if("T"===h[y][0]){if(y>0&&["Q","q","T","t"].indexOf(h[y-1][0])>-1)r=new j(o[0],o[1],2*o[0]-c[0],2*o[1]-c[1],h[y][1],h[y][2],void 0,void 0),this.functions.push(r),this.length+=r.getTotalLength();else{var L=new u(o[0],h[y][1],o[1],h[y][2]);this.functions.push(L),this.length+=L.getTotalLength()}c=[2*o[0]-c[0],2*o[1]-c[1]],o=[h[y][1],h[y][2]]}else if("t"===h[y][0]){if(y>0&&["Q","q","T","t"].indexOf(h[y-1][0])>-1)r=new j(o[0],o[1],2*o[0]-c[0],2*o[1]-c[1],o[0]+h[y][1],o[1]+h[y][2],void 0,void 0),this.length+=r.getTotalLength(),this.functions.push(r);else{var A=new u(o[0],o[0]+h[y][1],o[1],o[1]+h[y][2]);this.length+=A.getTotalLength(),this.functions.push(A)}c=[2*o[0]-c[0],2*o[1]-c[1]],o=[h[y][1]+o[0],h[y][2]+o[1]]}else if("A"===h[y][0]){var d=new l(o[0],o[1],h[y][1],h[y][2],h[y][3],1===h[y][4],1===h[y][5],h[y][6],h[y][7]);this.length+=d.getTotalLength(),o=[h[y][6],h[y][7]],this.functions.push(d)}else if("a"===h[y][0]){var b=new l(o[0],o[1],h[y][1],h[y][2],h[y][3],1===h[y][4],1===h[y][5],o[0]+h[y][6],o[1]+h[y][7]);this.length+=b.getTotalLength(),o=[o[0]+h[y][6],o[1]+h[y][7]],this.functions.push(b)}this.partial_lengths.push(this.length)}})),E=n((function(t){var n=this;if(e(this,"inst",void 0),e(this,"getTotalLength",(function(){return n.inst.getTotalLength()})),e(this,"getPointAtLength",(function(t){return n.inst.getPointAtLength(t)})),e(this,"getTangentAtLength",(function(t){return n.inst.getTangentAtLength(t)})),e(this,"getPropertiesAtLength",(function(t){return n.inst.getPropertiesAtLength(t)})),e(this,"getParts",(function(){return n.inst.getParts()})),this.inst=new C(t),!(this instanceof E))return new E(t)}));exports.svgPathProperties=E;

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

// http://geoexamples.com/path-properties/ v1.1.0 Copyright 2023 Roger Veciana i Rovira
function t(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function n(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(!t)return;if("string"==typeof t)return e(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return e(t,n)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}var i={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},h=/([astvzqmhlc])([^astvzqmhlc]*)/gi,r=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi,s=function(t){var n=t.match(r);return n?n.map(Number):[]},a=function(n,e,i,h){var r=this;t(this,"x0",void 0),t(this,"x1",void 0),t(this,"y0",void 0),t(this,"y1",void 0),t(this,"getTotalLength",(function(){return Math.sqrt(Math.pow(r.x0-r.x1,2)+Math.pow(r.y0-r.y1,2))})),t(this,"getPointAtLength",(function(t){var n=t/Math.sqrt(Math.pow(r.x0-r.x1,2)+Math.pow(r.y0-r.y1,2));n=Number.isNaN(n)?1:n;var e=(r.x1-r.x0)*n,i=(r.y1-r.y0)*n;return{x:r.x0+e,y:r.y0+i}})),t(this,"getTangentAtLength",(function(t){var n=Math.sqrt((r.x1-r.x0)*(r.x1-r.x0)+(r.y1-r.y0)*(r.y1-r.y0));return{x:-(r.x1-r.x0)/n,y:-(r.y1-r.y0)/n}})),t(this,"getPropertiesAtLength",(function(t){var n=r.getPointAtLength(t),e=r.getTangentAtLength(t);return{x:n.x,y:n.y,tangentX:e.x,tangentY:e.y}})),this.x0=n,this.x1=e,this.y0=i,this.y1=h},o=function(n,e,i,h,r,s,a,o,l){var c=this;t(this,"x0",void 0),t(this,"y0",void 0),t(this,"rx",void 0),t(this,"ry",void 0),t(this,"xAxisRotate",void 0),t(this,"LargeArcFlag",void 0),t(this,"SweepFlag",void 0),t(this,"x1",void 0),t(this,"y1",void 0),t(this,"length",void 0),t(this,"getTotalLength",(function(){return c.length})),t(this,"getPointAtLength",(function(t){t<0?t=0:t>c.length&&(t=c.length);var n=g({x:c.x0,y:c.y0},c.rx,c.ry,c.xAxisRotate,c.LargeArcFlag,c.SweepFlag,{x:c.x1,y:c.y1},t/c.length);return{x:n.x,y:n.y}})),t(this,"getTangentAtLength",(function(t){t<0?t=0:t>c.length&&(t=c.length);var n,e=.05,i=c.getPointAtLength(t);t<0?t=0:t>c.length&&(t=c.length);var h=(n=t<c.length-e?c.getPointAtLength(t+e):c.getPointAtLength(t-e)).x-i.x,r=n.y-i.y,s=Math.sqrt(h*h+r*r);return t<c.length-e?{x:-h/s,y:-r/s}:{x:h/s,y:r/s}})),t(this,"getPropertiesAtLength",(function(t){var n=c.getTangentAtLength(t),e=c.getPointAtLength(t);return{x:e.x,y:e.y,tangentX:n.x,tangentY:n.y}})),this.x0=n,this.y0=e,this.rx=i,this.ry=h,this.xAxisRotate=r,this.LargeArcFlag=s,this.SweepFlag=a,this.x1=o,this.y1=l;var f=u(300,(function(t){return g({x:n,y:e},i,h,r,s,a,{x:o,y:l},t)}));this.length=f.arcLength},g=function(t,n,e,i,h,r,s,a){n=Math.abs(n),e=Math.abs(e),i=l(i,360);var o=c(i);if(t.x===s.x&&t.y===s.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===n||0===e)return{x:0,y:0,ellipticalArcAngle:0};var g=(t.x-s.x)/2,u=(t.y-s.y)/2,f={x:Math.cos(o)*g+Math.sin(o)*u,y:-Math.sin(o)*g+Math.cos(o)*u},y=Math.pow(f.x,2)/Math.pow(n,2)+Math.pow(f.y,2)/Math.pow(e,2);y>1&&(n=Math.sqrt(y)*n,e=Math.sqrt(y)*e);var p=(Math.pow(n,2)*Math.pow(e,2)-Math.pow(n,2)*Math.pow(f.y,2)-Math.pow(e,2)*Math.pow(f.x,2))/(Math.pow(n,2)*Math.pow(f.y,2)+Math.pow(e,2)*Math.pow(f.x,2));p=p<0?0:p;var v=(h!==r?1:-1)*Math.sqrt(p),M=v*(n*f.y/e),L=v*(-e*f.x/n),w={x:Math.cos(o)*M-Math.sin(o)*L+(t.x+s.x)/2,y:Math.sin(o)*M+Math.cos(o)*L+(t.y+s.y)/2},A={x:(f.x-M)/n,y:(f.y-L)/e},d=x({x:1,y:0},A),P=x(A,{x:(-f.x-M)/n,y:(-f.y-L)/e});!r&&P>0?P-=2*Math.PI:r&&P<0&&(P+=2*Math.PI);var b=d+(P%=2*Math.PI)*a,T=n*Math.cos(b),m=e*Math.sin(b);return{x:Math.cos(o)*T-Math.sin(o)*m+w.x,y:Math.sin(o)*T+Math.cos(o)*m+w.y,ellipticalArcStartAngle:d,ellipticalArcEndAngle:d+P,ellipticalArcAngle:b,ellipticalArcCenter:w,resultantRx:n,resultantRy:e}},u=function(t,n){t=t||500;for(var e,i=0,h=[],r=[],s=n(0),a=0;a<t;a++){var o=y(a*(1/t),0,1);e=n(o),i+=f(s,e),r.push([s,e]),h.push({t:o,arcLength:i}),s=e}return e=n(1),r.push([s,e]),i+=f(s,e),h.push({t:1,arcLength:i}),{arcLength:i,arcLengthMap:h,approximationLines:r}},l=function(t,n){return(t%n+n)%n},c=function(t){return t*(Math.PI/180)},f=function(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))},y=function(t,n,e){return Math.min(Math.max(t,n),e)},x=function(t,n){var e=t.x*n.x+t.y*n.y,i=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(n.x,2)+Math.pow(n.y,2)));return(t.x*n.y-t.y*n.x<0?-1:1)*Math.acos(e/i)},p=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],v=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],M=[[1],[1,1],[1,2,1],[1,3,3,1]],L=function(t,n,e){return{x:(1-e)*(1-e)*(1-e)*t[0]+3*(1-e)*(1-e)*e*t[1]+3*(1-e)*e*e*t[2]+e*e*e*t[3],y:(1-e)*(1-e)*(1-e)*n[0]+3*(1-e)*(1-e)*e*n[1]+3*(1-e)*e*e*n[2]+e*e*e*n[3]}},w=function(t,n,e){return d([3*(t[1]-t[0]),3*(t[2]-t[1]),3*(t[3]-t[2])],[3*(n[1]-n[0]),3*(n[2]-n[1]),3*(n[3]-n[2])],e)},A=function(t,n,e){var i,h,r;i=e/2,h=0;for(var s=0;s<20;s++)r=i*p[20][s]+i,h+=v[20][s]*T(t,n,r);return i*h},d=function(t,n,e){return{x:(1-e)*(1-e)*t[0]+2*(1-e)*e*t[1]+e*e*t[2],y:(1-e)*(1-e)*n[0]+2*(1-e)*e*n[1]+e*e*n[2]}},P=function(t,n,e){void 0===e&&(e=1);var i=t[0]-2*t[1]+t[2],h=n[0]-2*n[1]+n[2],r=2*t[1]-2*t[0],s=2*n[1]-2*n[0],a=4*(i*i+h*h),o=4*(i*r+h*s),g=r*r+s*s;if(0===a)return e*Math.sqrt(Math.pow(t[2]-t[0],2)+Math.pow(n[2]-n[0],2));var u=o/(2*a),l=e+u,c=g/a-u*u,f=l*l+c>0?Math.sqrt(l*l+c):0,y=u*u+c>0?Math.sqrt(u*u+c):0,x=u+Math.sqrt(u*u+c)!==0&&(l+f)/(u+y)!=0?c*Math.log(Math.abs((l+f)/(u+y))):0;return Math.sqrt(a)/2*(l*f-u*y+x)},b=function(t,n,e){return{x:2*(1-e)*(t[1]-t[0])+2*e*(t[2]-t[1]),y:2*(1-e)*(n[1]-n[0])+2*e*(n[2]-n[1])}};function T(t,n,e){var i=m(1,e,t),h=m(1,e,n),r=i*i+h*h;return Math.sqrt(r)}var m=function t(n,e,i){var h,r,s=i.length-1;if(0===s)return 0;if(0===n){r=0;for(var a=0;a<=s;a++)r+=M[s][a]*Math.pow(1-e,s-a)*Math.pow(e,a)*i[a];return r}h=new Array(s);for(var o=0;o<s;o++)h[o]=s*(i[o+1]-i[o]);return t(n-1,e,h)},q=function(t,n,e){for(var i=1,h=t/n,r=(t-e(h))/n,s=0;i>.001;){var a=e(h+r),o=Math.abs(t-a)/n;if(o<i)i=o,h+=r;else{var g=e(h-r),u=Math.abs(t-g)/n;u<i?(i=u,h-=r):r/=2}if(++s>500)break}return h},_=function(n,e,i,h,r,s,a,o){var g=this;t(this,"a",void 0),t(this,"b",void 0),t(this,"c",void 0),t(this,"d",void 0),t(this,"length",void 0),t(this,"getArcLength",void 0),t(this,"getPoint",void 0),t(this,"getDerivative",void 0),t(this,"getTotalLength",(function(){return g.length})),t(this,"getPointAtLength",(function(t){var n=[g.a.x,g.b.x,g.c.x,g.d.x],e=[g.a.y,g.b.y,g.c.y,g.d.y],i=q(t,g.length,(function(t){return g.getArcLength(n,e,t)}));return g.getPoint(n,e,i)})),t(this,"getTangentAtLength",(function(t){var n=[g.a.x,g.b.x,g.c.x,g.d.x],e=[g.a.y,g.b.y,g.c.y,g.d.y],i=q(t,g.length,(function(t){return g.getArcLength(n,e,t)})),h=g.getDerivative(n,e,i),r=Math.sqrt(h.x*h.x+h.y*h.y);return r>0?{x:h.x/r,y:h.y/r}:{x:0,y:0}})),t(this,"getPropertiesAtLength",(function(t){var n,e=[g.a.x,g.b.x,g.c.x,g.d.x],i=[g.a.y,g.b.y,g.c.y,g.d.y],h=q(t,g.length,(function(t){return g.getArcLength(e,i,t)})),r=g.getDerivative(e,i,h),s=Math.sqrt(r.x*r.x+r.y*r.y);n=s>0?{x:r.x/s,y:r.y/s}:{x:0,y:0};var a=g.getPoint(e,i,h);return{x:a.x,y:a.y,tangentX:n.x,tangentY:n.y}})),t(this,"getC",(function(){return g.c})),t(this,"getD",(function(){return g.d})),this.a={x:n,y:e},this.b={x:i,y:h},this.c={x:r,y:s},void 0!==a&&void 0!==o?(this.getArcLength=A,this.getPoint=L,this.getDerivative=w,this.d={x:a,y:o}):(this.getArcLength=P,this.getPoint=d,this.getDerivative=b,this.d={x:0,y:0}),this.length=this.getArcLength([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],1)},S=function(e){var r=this;t(this,"length",0),t(this,"partial_lengths",[]),t(this,"functions",[]),t(this,"initial_point",null),t(this,"getPartAtLength",(function(t){t<0?t=0:t>r.length&&(t=r.length);for(var n=r.partial_lengths.length-1;r.partial_lengths[n]>=t&&n>0;)n--;return n++,{fraction:t-r.partial_lengths[n-1],i:n}})),t(this,"getTotalLength",(function(){return r.length})),t(this,"getPointAtLength",(function(t){var n=r.getPartAtLength(t),e=r.functions[n.i];if(e)return e.getPointAtLength(n.fraction);if(r.initial_point)return r.initial_point;throw new Error("Wrong function at this part.")})),t(this,"getTangentAtLength",(function(t){var n=r.getPartAtLength(t),e=r.functions[n.i];if(e)return e.getTangentAtLength(n.fraction);if(r.initial_point)return{x:0,y:0};throw new Error("Wrong function at this part.")})),t(this,"getPropertiesAtLength",(function(t){var n=r.getPartAtLength(t),e=r.functions[n.i];if(e)return e.getPropertiesAtLength(n.fraction);if(r.initial_point)return{x:r.initial_point.x,y:r.initial_point.y,tangentX:0,tangentY:0};throw new Error("Wrong function at this part.")})),t(this,"getParts",(function(){for(var t=[],n=0;n<r.functions.length;n++)if(null!==r.functions[n]){r.functions[n]=r.functions[n];var e={start:r.functions[n].getPointAtLength(0),end:r.functions[n].getPointAtLength(r.partial_lengths[n]-r.partial_lengths[n-1]),length:r.partial_lengths[n]-r.partial_lengths[n-1],getPointAtLength:r.functions[n].getPointAtLength,getTangentAtLength:r.functions[n].getTangentAtLength,getPropertiesAtLength:r.functions[n].getPropertiesAtLength};t.push(e)}return t}));for(var g,u=Array.isArray(e)?e:function(t){var e=(t&&t.length>0?t:"M0,0").match(h);if(!e)throw new Error("No path elements found in string ".concat(t));return e.reduce((function(t,e){var h=e.charAt(0),r=h.toLowerCase(),a=s(e.substr(1));for("m"===r&&a.length>2&&(t.push([h].concat(n(a.splice(0,2)))),r="l",h="m"===h?"l":"L");a.length>=0;){if(a.length===i[r]){t.push([h].concat(n(a.splice(0,i[r]))));break}if(a.length<i[r])throw new Error('Malformed path data: "'.concat(h,'" must have ').concat(i[r]," elements and has ").concat(a.length,": ").concat(e));t.push([h].concat(n(a.splice(0,i[r]))))}return t}),[])}(e),l=[0,0],c=[0,0],f=[0,0],y=0;y<u.length;y++){if("M"===u[y][0])f=[(l=[u[y][1],u[y][2]])[0],l[1]],this.functions.push(null),0===y&&(this.initial_point={x:u[y][1],y:u[y][2]});else if("m"===u[y][0])f=[(l=[u[y][1]+l[0],u[y][2]+l[1]])[0],l[1]],this.functions.push(null);else if("L"===u[y][0])this.length+=Math.sqrt(Math.pow(l[0]-u[y][1],2)+Math.pow(l[1]-u[y][2],2)),this.functions.push(new a(l[0],u[y][1],l[1],u[y][2])),l=[u[y][1],u[y][2]];else if("l"===u[y][0])this.length+=Math.sqrt(Math.pow(u[y][1],2)+Math.pow(u[y][2],2)),this.functions.push(new a(l[0],u[y][1]+l[0],l[1],u[y][2]+l[1])),l=[u[y][1]+l[0],u[y][2]+l[1]];else if("H"===u[y][0])this.length+=Math.abs(l[0]-u[y][1]),this.functions.push(new a(l[0],u[y][1],l[1],l[1])),l[0]=u[y][1];else if("h"===u[y][0])this.length+=Math.abs(u[y][1]),this.functions.push(new a(l[0],l[0]+u[y][1],l[1],l[1])),l[0]=u[y][1]+l[0];else if("V"===u[y][0])this.length+=Math.abs(l[1]-u[y][1]),this.functions.push(new a(l[0],l[0],l[1],u[y][1])),l[1]=u[y][1];else if("v"===u[y][0])this.length+=Math.abs(u[y][1]),this.functions.push(new a(l[0],l[0],l[1],l[1]+u[y][1])),l[1]=u[y][1]+l[1];else if("z"===u[y][0]||"Z"===u[y][0])this.length+=Math.sqrt(Math.pow(f[0]-l[0],2)+Math.pow(f[1]-l[1],2)),this.functions.push(new a(l[0],f[0],l[1],f[1])),l=[f[0],f[1]];else if("C"===u[y][0])g=new _(l[0],l[1],u[y][1],u[y][2],u[y][3],u[y][4],u[y][5],u[y][6]),this.length+=g.getTotalLength(),l=[u[y][5],u[y][6]],this.functions.push(g);else if("c"===u[y][0])(g=new _(l[0],l[1],l[0]+u[y][1],l[1]+u[y][2],l[0]+u[y][3],l[1]+u[y][4],l[0]+u[y][5],l[1]+u[y][6])).getTotalLength()>0?(this.length+=g.getTotalLength(),this.functions.push(g),l=[u[y][5]+l[0],u[y][6]+l[1]]):this.functions.push(new a(l[0],l[0],l[1],l[1]));else if("S"===u[y][0]){if(y>0&&["C","c","S","s"].indexOf(u[y-1][0])>-1){if(g){var x=g.getC();g=new _(l[0],l[1],2*l[0]-x.x,2*l[1]-x.y,u[y][1],u[y][2],u[y][3],u[y][4])}}else g=new _(l[0],l[1],l[0],l[1],u[y][1],u[y][2],u[y][3],u[y][4]);g&&(this.length+=g.getTotalLength(),l=[u[y][3],u[y][4]],this.functions.push(g))}else if("s"===u[y][0]){if(y>0&&["C","c","S","s"].indexOf(u[y-1][0])>-1){if(g){var p=g.getC(),v=g.getD();g=new _(l[0],l[1],l[0]+v.x-p.x,l[1]+v.y-p.y,l[0]+u[y][1],l[1]+u[y][2],l[0]+u[y][3],l[1]+u[y][4])}}else g=new _(l[0],l[1],l[0],l[1],l[0]+u[y][1],l[1]+u[y][2],l[0]+u[y][3],l[1]+u[y][4]);g&&(this.length+=g.getTotalLength(),l=[u[y][3]+l[0],u[y][4]+l[1]],this.functions.push(g))}else if("Q"===u[y][0]){if(l[0]==u[y][1]&&l[1]==u[y][2]){var M=new a(u[y][1],u[y][3],u[y][2],u[y][4]);this.length+=M.getTotalLength(),this.functions.push(M)}else g=new _(l[0],l[1],u[y][1],u[y][2],u[y][3],u[y][4],void 0,void 0),this.length+=g.getTotalLength(),this.functions.push(g);l=[u[y][3],u[y][4]],c=[u[y][1],u[y][2]]}else if("q"===u[y][0]){if(0!=u[y][1]||0!=u[y][2])g=new _(l[0],l[1],l[0]+u[y][1],l[1]+u[y][2],l[0]+u[y][3],l[1]+u[y][4],void 0,void 0),this.length+=g.getTotalLength(),this.functions.push(g);else{var L=new a(l[0]+u[y][1],l[0]+u[y][3],l[1]+u[y][2],l[1]+u[y][4]);this.length+=L.getTotalLength(),this.functions.push(L)}c=[l[0]+u[y][1],l[1]+u[y][2]],l=[u[y][3]+l[0],u[y][4]+l[1]]}else if("T"===u[y][0]){if(y>0&&["Q","q","T","t"].indexOf(u[y-1][0])>-1)g=new _(l[0],l[1],2*l[0]-c[0],2*l[1]-c[1],u[y][1],u[y][2],void 0,void 0),this.functions.push(g),this.length+=g.getTotalLength();else{var w=new a(l[0],u[y][1],l[1],u[y][2]);this.functions.push(w),this.length+=w.getTotalLength()}c=[2*l[0]-c[0],2*l[1]-c[1]],l=[u[y][1],u[y][2]]}else if("t"===u[y][0]){if(y>0&&["Q","q","T","t"].indexOf(u[y-1][0])>-1)g=new _(l[0],l[1],2*l[0]-c[0],2*l[1]-c[1],l[0]+u[y][1],l[1]+u[y][2],void 0,void 0),this.length+=g.getTotalLength(),this.functions.push(g);else{var A=new a(l[0],l[0]+u[y][1],l[1],l[1]+u[y][2]);this.length+=A.getTotalLength(),this.functions.push(A)}c=[2*l[0]-c[0],2*l[1]-c[1]],l=[u[y][1]+l[0],u[y][2]+l[1]]}else if("A"===u[y][0]){var d=new o(l[0],l[1],u[y][1],u[y][2],u[y][3],1===u[y][4],1===u[y][5],u[y][6],u[y][7]);this.length+=d.getTotalLength(),l=[u[y][6],u[y][7]],this.functions.push(d)}else if("a"===u[y][0]){var P=new o(l[0],l[1],u[y][1],u[y][2],u[y][3],1===u[y][4],1===u[y][5],l[0]+u[y][6],l[1]+u[y][7]);this.length+=P.getTotalLength(),l=[l[0]+u[y][6],l[1]+u[y][7]],this.functions.push(P)}this.partial_lengths.push(this.length)}},C=function(n){var e=this;if(t(this,"inst",void 0),t(this,"getTotalLength",(function(){return e.inst.getTotalLength()})),t(this,"getPointAtLength",(function(t){return e.inst.getPointAtLength(t)})),t(this,"getTangentAtLength",(function(t){return e.inst.getTangentAtLength(t)})),t(this,"getPropertiesAtLength",(function(t){return e.inst.getPropertiesAtLength(t)})),t(this,"getParts",(function(){return e.inst.getParts()})),this.inst=new S(n),!(this instanceof C))return new C(n)};export{C as svgPathProperties};
// http://geoexamples.com/path-properties/ v1.1.1 Copyright 2023 Roger Veciana i Rovira
function t(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,h(i.key),i)}}function n(n,e,i){return e&&t(n.prototype,e),i&&t(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function e(t,n,e){return(n=h(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function i(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){if(!t)return;if("string"==typeof t)return r(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return r(t,n)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function h(t){var n=function(t,n){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,n||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==typeof n?n:String(n)}var a={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},s=/([astvzqmhlc])([^astvzqmhlc]*)/gi,o=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi,g=function(t){var n=t.match(o);return n?n.map(Number):[]},u=n((function(t,n,i,r){var h=this;e(this,"x0",void 0),e(this,"x1",void 0),e(this,"y0",void 0),e(this,"y1",void 0),e(this,"getTotalLength",(function(){return Math.sqrt(Math.pow(h.x0-h.x1,2)+Math.pow(h.y0-h.y1,2))})),e(this,"getPointAtLength",(function(t){var n=t/Math.sqrt(Math.pow(h.x0-h.x1,2)+Math.pow(h.y0-h.y1,2));n=Number.isNaN(n)?1:n;var e=(h.x1-h.x0)*n,i=(h.y1-h.y0)*n;return{x:h.x0+e,y:h.y0+i}})),e(this,"getTangentAtLength",(function(t){var n=Math.sqrt((h.x1-h.x0)*(h.x1-h.x0)+(h.y1-h.y0)*(h.y1-h.y0));return{x:(h.x1-h.x0)/n,y:(h.y1-h.y0)/n}})),e(this,"getPropertiesAtLength",(function(t){var n=h.getPointAtLength(t),e=h.getTangentAtLength(t);return{x:n.x,y:n.y,tangentX:e.x,tangentY:e.y}})),this.x0=t,this.x1=n,this.y0=i,this.y1=r})),l=n((function(t,n,i,r,h,a,s,o,g){var u=this;e(this,"x0",void 0),e(this,"y0",void 0),e(this,"rx",void 0),e(this,"ry",void 0),e(this,"xAxisRotate",void 0),e(this,"LargeArcFlag",void 0),e(this,"SweepFlag",void 0),e(this,"x1",void 0),e(this,"y1",void 0),e(this,"length",void 0),e(this,"getTotalLength",(function(){return u.length})),e(this,"getPointAtLength",(function(t){t<0?t=0:t>u.length&&(t=u.length);var n=c({x:u.x0,y:u.y0},u.rx,u.ry,u.xAxisRotate,u.LargeArcFlag,u.SweepFlag,{x:u.x1,y:u.y1},t/u.length);return{x:n.x,y:n.y}})),e(this,"getTangentAtLength",(function(t){t<0?t=0:t>u.length&&(t=u.length);var n,e=.05,i=u.getPointAtLength(t);t<0?t=0:t>u.length&&(t=u.length);var r=(n=t<u.length-e?u.getPointAtLength(t+e):u.getPointAtLength(t-e)).x-i.x,h=n.y-i.y,a=Math.sqrt(r*r+h*h);return t<u.length-e?{x:-r/a,y:-h/a}:{x:r/a,y:h/a}})),e(this,"getPropertiesAtLength",(function(t){var n=u.getTangentAtLength(t),e=u.getPointAtLength(t);return{x:e.x,y:e.y,tangentX:n.x,tangentY:n.y}})),this.x0=t,this.y0=n,this.rx=i,this.ry=r,this.xAxisRotate=h,this.LargeArcFlag=a,this.SweepFlag=s,this.x1=o,this.y1=g;var l=f(300,(function(e){return c({x:t,y:n},i,r,h,a,s,{x:o,y:g},e)}));this.length=l.arcLength})),c=function(t,n,e,i,r,h,a,s){n=Math.abs(n),e=Math.abs(e),i=y(i,360);var o=p(i);if(t.x===a.x&&t.y===a.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===n||0===e)return{x:0,y:0,ellipticalArcAngle:0};var g=(t.x-a.x)/2,u=(t.y-a.y)/2,l={x:Math.cos(o)*g+Math.sin(o)*u,y:-Math.sin(o)*g+Math.cos(o)*u},c=Math.pow(l.x,2)/Math.pow(n,2)+Math.pow(l.y,2)/Math.pow(e,2);c>1&&(n=Math.sqrt(c)*n,e=Math.sqrt(c)*e);var f=(Math.pow(n,2)*Math.pow(e,2)-Math.pow(n,2)*Math.pow(l.y,2)-Math.pow(e,2)*Math.pow(l.x,2))/(Math.pow(n,2)*Math.pow(l.y,2)+Math.pow(e,2)*Math.pow(l.x,2));f=f<0?0:f;var x=(r!==h?1:-1)*Math.sqrt(f),v=x*(n*l.y/e),w=x*(-e*l.x/n),L={x:Math.cos(o)*v-Math.sin(o)*w+(t.x+a.x)/2,y:Math.sin(o)*v+Math.cos(o)*w+(t.y+a.y)/2},A={x:(l.x-v)/n,y:(l.y-w)/e},d=M({x:1,y:0},A),b=M(A,{x:(-l.x-v)/n,y:(-l.y-w)/e});!h&&b>0?b-=2*Math.PI:h&&b<0&&(b+=2*Math.PI);var P=d+(b%=2*Math.PI)*s,m=n*Math.cos(P),T=e*Math.sin(P);return{x:Math.cos(o)*m-Math.sin(o)*T+L.x,y:Math.sin(o)*m+Math.cos(o)*T+L.y,ellipticalArcStartAngle:d,ellipticalArcEndAngle:d+b,ellipticalArcAngle:P,ellipticalArcCenter:L,resultantRx:n,resultantRy:e}},f=function(t,n){t=t||500;for(var e,i=0,r=[],h=[],a=n(0),s=0;s<t;s++){var o=v(s*(1/t),0,1);e=n(o),i+=x(a,e),h.push([a,e]),r.push({t:o,arcLength:i}),a=e}return e=n(1),h.push([a,e]),i+=x(a,e),r.push({t:1,arcLength:i}),{arcLength:i,arcLengthMap:r,approximationLines:h}},y=function(t,n){return(t%n+n)%n},p=function(t){return t*(Math.PI/180)},x=function(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))},v=function(t,n,e){return Math.min(Math.max(t,n),e)},M=function(t,n){var e=t.x*n.x+t.y*n.y,i=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(n.x,2)+Math.pow(n.y,2)));return(t.x*n.y-t.y*n.x<0?-1:1)*Math.acos(e/i)},w=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],L=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],A=[[1],[1,1],[1,2,1],[1,3,3,1]],d=function(t,n,e){return{x:(1-e)*(1-e)*(1-e)*t[0]+3*(1-e)*(1-e)*e*t[1]+3*(1-e)*e*e*t[2]+e*e*e*t[3],y:(1-e)*(1-e)*(1-e)*n[0]+3*(1-e)*(1-e)*e*n[1]+3*(1-e)*e*e*n[2]+e*e*e*n[3]}},b=function(t,n,e){return m([3*(t[1]-t[0]),3*(t[2]-t[1]),3*(t[3]-t[2])],[3*(n[1]-n[0]),3*(n[2]-n[1]),3*(n[3]-n[2])],e)},P=function(t,n,e){var i,r,h;i=e/2,r=0;for(var a=0;a<20;a++)h=i*w[20][a]+i,r+=L[20][a]*_(t,n,h);return i*r},m=function(t,n,e){return{x:(1-e)*(1-e)*t[0]+2*(1-e)*e*t[1]+e*e*t[2],y:(1-e)*(1-e)*n[0]+2*(1-e)*e*n[1]+e*e*n[2]}},T=function(t,n,e){void 0===e&&(e=1);var i=t[0]-2*t[1]+t[2],r=n[0]-2*n[1]+n[2],h=2*t[1]-2*t[0],a=2*n[1]-2*n[0],s=4*(i*i+r*r),o=4*(i*h+r*a),g=h*h+a*a;if(0===s)return e*Math.sqrt(Math.pow(t[2]-t[0],2)+Math.pow(n[2]-n[0],2));var u=o/(2*s),l=e+u,c=g/s-u*u,f=l*l+c>0?Math.sqrt(l*l+c):0,y=u*u+c>0?Math.sqrt(u*u+c):0,p=u+Math.sqrt(u*u+c)!==0&&(l+f)/(u+y)!=0?c*Math.log(Math.abs((l+f)/(u+y))):0;return Math.sqrt(s)/2*(l*f-u*y+p)},q=function(t,n,e){return{x:2*(1-e)*(t[1]-t[0])+2*e*(t[2]-t[1]),y:2*(1-e)*(n[1]-n[0])+2*e*(n[2]-n[1])}};function _(t,n,e){var i=S(1,e,t),r=S(1,e,n),h=i*i+r*r;return Math.sqrt(h)}var S=function t(n,e,i){var r,h,a=i.length-1;if(0===a)return 0;if(0===n){h=0;for(var s=0;s<=a;s++)h+=A[a][s]*Math.pow(1-e,a-s)*Math.pow(e,s)*i[s];return h}r=new Array(a);for(var o=0;o<a;o++)r[o]=a*(i[o+1]-i[o]);return t(n-1,e,r)},C=function(t,n,e){for(var i=1,r=t/n,h=(t-e(r))/n,a=0;i>.001;){var s=e(r+h),o=Math.abs(t-s)/n;if(o<i)i=o,r+=h;else{var g=e(r-h),u=Math.abs(t-g)/n;u<i?(i=u,r-=h):h/=2}if(++a>500)break}return r},O=n((function(t,n,i,r,h,a,s,o){var g=this;e(this,"a",void 0),e(this,"b",void 0),e(this,"c",void 0),e(this,"d",void 0),e(this,"length",void 0),e(this,"getArcLength",void 0),e(this,"getPoint",void 0),e(this,"getDerivative",void 0),e(this,"getTotalLength",(function(){return g.length})),e(this,"getPointAtLength",(function(t){var n=[g.a.x,g.b.x,g.c.x,g.d.x],e=[g.a.y,g.b.y,g.c.y,g.d.y],i=C(t,g.length,(function(t){return g.getArcLength(n,e,t)}));return g.getPoint(n,e,i)})),e(this,"getTangentAtLength",(function(t){var n=[g.a.x,g.b.x,g.c.x,g.d.x],e=[g.a.y,g.b.y,g.c.y,g.d.y],i=C(t,g.length,(function(t){return g.getArcLength(n,e,t)})),r=g.getDerivative(n,e,i),h=Math.sqrt(r.x*r.x+r.y*r.y);return h>0?{x:r.x/h,y:r.y/h}:{x:0,y:0}})),e(this,"getPropertiesAtLength",(function(t){var n,e=[g.a.x,g.b.x,g.c.x,g.d.x],i=[g.a.y,g.b.y,g.c.y,g.d.y],r=C(t,g.length,(function(t){return g.getArcLength(e,i,t)})),h=g.getDerivative(e,i,r),a=Math.sqrt(h.x*h.x+h.y*h.y);n=a>0?{x:h.x/a,y:h.y/a}:{x:0,y:0};var s=g.getPoint(e,i,r);return{x:s.x,y:s.y,tangentX:n.x,tangentY:n.y}})),e(this,"getC",(function(){return g.c})),e(this,"getD",(function(){return g.d})),this.a={x:t,y:n},this.b={x:i,y:r},this.c={x:h,y:a},void 0!==s&&void 0!==o?(this.getArcLength=P,this.getPoint=d,this.getDerivative=b,this.d={x:s,y:o}):(this.getArcLength=T,this.getPoint=m,this.getDerivative=q,this.d={x:0,y:0}),this.length=this.getArcLength([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],1)})),j=n((function(t){var n=this;e(this,"length",0),e(this,"partial_lengths",[]),e(this,"functions",[]),e(this,"initial_point",null),e(this,"getPartAtLength",(function(t){t<0?t=0:t>n.length&&(t=n.length);for(var e=n.partial_lengths.length-1;n.partial_lengths[e]>=t&&e>0;)e--;return e++,{fraction:t-n.partial_lengths[e-1],i:e}})),e(this,"getTotalLength",(function(){return n.length})),e(this,"getPointAtLength",(function(t){var e=n.getPartAtLength(t),i=n.functions[e.i];if(i)return i.getPointAtLength(e.fraction);if(n.initial_point)return n.initial_point;throw new Error("Wrong function at this part.")})),e(this,"getTangentAtLength",(function(t){var e=n.getPartAtLength(t),i=n.functions[e.i];if(i)return i.getTangentAtLength(e.fraction);if(n.initial_point)return{x:0,y:0};throw new Error("Wrong function at this part.")})),e(this,"getPropertiesAtLength",(function(t){var e=n.getPartAtLength(t),i=n.functions[e.i];if(i)return i.getPropertiesAtLength(e.fraction);if(n.initial_point)return{x:n.initial_point.x,y:n.initial_point.y,tangentX:0,tangentY:0};throw new Error("Wrong function at this part.")})),e(this,"getParts",(function(){for(var t=[],e=0;e<n.functions.length;e++)if(null!==n.functions[e]){n.functions[e]=n.functions[e];var i={start:n.functions[e].getPointAtLength(0),end:n.functions[e].getPointAtLength(n.partial_lengths[e]-n.partial_lengths[e-1]),length:n.partial_lengths[e]-n.partial_lengths[e-1],getPointAtLength:n.functions[e].getPointAtLength,getTangentAtLength:n.functions[e].getTangentAtLength,getPropertiesAtLength:n.functions[e].getPropertiesAtLength};t.push(i)}return t}));for(var r,h=Array.isArray(t)?t:function(t){var n=(t&&t.length>0?t:"M0,0").match(s);if(!n)throw new Error("No path elements found in string ".concat(t));return n.reduce((function(t,n){var e=n.charAt(0),r=e.toLowerCase(),h=g(n.substr(1));for("m"===r&&h.length>2&&(t.push([e].concat(i(h.splice(0,2)))),r="l",e="m"===e?"l":"L");h.length>=0;){if(h.length===a[r]){t.push([e].concat(i(h.splice(0,a[r]))));break}if(h.length<a[r])throw new Error('Malformed path data: "'.concat(e,'" must have ').concat(a[r]," elements and has ").concat(h.length,": ").concat(n));t.push([e].concat(i(h.splice(0,a[r]))))}return t}),[])}(t),o=[0,0],c=[0,0],f=[0,0],y=0;y<h.length;y++){if("M"===h[y][0])f=[(o=[h[y][1],h[y][2]])[0],o[1]],this.functions.push(null),0===y&&(this.initial_point={x:h[y][1],y:h[y][2]});else if("m"===h[y][0])f=[(o=[h[y][1]+o[0],h[y][2]+o[1]])[0],o[1]],this.functions.push(null);else if("L"===h[y][0])this.length+=Math.sqrt(Math.pow(o[0]-h[y][1],2)+Math.pow(o[1]-h[y][2],2)),this.functions.push(new u(o[0],h[y][1],o[1],h[y][2])),o=[h[y][1],h[y][2]];else if("l"===h[y][0])this.length+=Math.sqrt(Math.pow(h[y][1],2)+Math.pow(h[y][2],2)),this.functions.push(new u(o[0],h[y][1]+o[0],o[1],h[y][2]+o[1])),o=[h[y][1]+o[0],h[y][2]+o[1]];else if("H"===h[y][0])this.length+=Math.abs(o[0]-h[y][1]),this.functions.push(new u(o[0],h[y][1],o[1],o[1])),o[0]=h[y][1];else if("h"===h[y][0])this.length+=Math.abs(h[y][1]),this.functions.push(new u(o[0],o[0]+h[y][1],o[1],o[1])),o[0]=h[y][1]+o[0];else if("V"===h[y][0])this.length+=Math.abs(o[1]-h[y][1]),this.functions.push(new u(o[0],o[0],o[1],h[y][1])),o[1]=h[y][1];else if("v"===h[y][0])this.length+=Math.abs(h[y][1]),this.functions.push(new u(o[0],o[0],o[1],o[1]+h[y][1])),o[1]=h[y][1]+o[1];else if("z"===h[y][0]||"Z"===h[y][0])this.length+=Math.sqrt(Math.pow(f[0]-o[0],2)+Math.pow(f[1]-o[1],2)),this.functions.push(new u(o[0],f[0],o[1],f[1])),o=[f[0],f[1]];else if("C"===h[y][0])r=new O(o[0],o[1],h[y][1],h[y][2],h[y][3],h[y][4],h[y][5],h[y][6]),this.length+=r.getTotalLength(),o=[h[y][5],h[y][6]],this.functions.push(r);else if("c"===h[y][0])(r=new O(o[0],o[1],o[0]+h[y][1],o[1]+h[y][2],o[0]+h[y][3],o[1]+h[y][4],o[0]+h[y][5],o[1]+h[y][6])).getTotalLength()>0?(this.length+=r.getTotalLength(),this.functions.push(r),o=[h[y][5]+o[0],h[y][6]+o[1]]):this.functions.push(new u(o[0],o[0],o[1],o[1]));else if("S"===h[y][0]){if(y>0&&["C","c","S","s"].indexOf(h[y-1][0])>-1){if(r){var p=r.getC();r=new O(o[0],o[1],2*o[0]-p.x,2*o[1]-p.y,h[y][1],h[y][2],h[y][3],h[y][4])}}else r=new O(o[0],o[1],o[0],o[1],h[y][1],h[y][2],h[y][3],h[y][4]);r&&(this.length+=r.getTotalLength(),o=[h[y][3],h[y][4]],this.functions.push(r))}else if("s"===h[y][0]){if(y>0&&["C","c","S","s"].indexOf(h[y-1][0])>-1){if(r){var x=r.getC(),v=r.getD();r=new O(o[0],o[1],o[0]+v.x-x.x,o[1]+v.y-x.y,o[0]+h[y][1],o[1]+h[y][2],o[0]+h[y][3],o[1]+h[y][4])}}else r=new O(o[0],o[1],o[0],o[1],o[0]+h[y][1],o[1]+h[y][2],o[0]+h[y][3],o[1]+h[y][4]);r&&(this.length+=r.getTotalLength(),o=[h[y][3]+o[0],h[y][4]+o[1]],this.functions.push(r))}else if("Q"===h[y][0]){if(o[0]==h[y][1]&&o[1]==h[y][2]){var M=new u(h[y][1],h[y][3],h[y][2],h[y][4]);this.length+=M.getTotalLength(),this.functions.push(M)}else r=new O(o[0],o[1],h[y][1],h[y][2],h[y][3],h[y][4],void 0,void 0),this.length+=r.getTotalLength(),this.functions.push(r);o=[h[y][3],h[y][4]],c=[h[y][1],h[y][2]]}else if("q"===h[y][0]){if(0!=h[y][1]||0!=h[y][2])r=new O(o[0],o[1],o[0]+h[y][1],o[1]+h[y][2],o[0]+h[y][3],o[1]+h[y][4],void 0,void 0),this.length+=r.getTotalLength(),this.functions.push(r);else{var w=new u(o[0]+h[y][1],o[0]+h[y][3],o[1]+h[y][2],o[1]+h[y][4]);this.length+=w.getTotalLength(),this.functions.push(w)}c=[o[0]+h[y][1],o[1]+h[y][2]],o=[h[y][3]+o[0],h[y][4]+o[1]]}else if("T"===h[y][0]){if(y>0&&["Q","q","T","t"].indexOf(h[y-1][0])>-1)r=new O(o[0],o[1],2*o[0]-c[0],2*o[1]-c[1],h[y][1],h[y][2],void 0,void 0),this.functions.push(r),this.length+=r.getTotalLength();else{var L=new u(o[0],h[y][1],o[1],h[y][2]);this.functions.push(L),this.length+=L.getTotalLength()}c=[2*o[0]-c[0],2*o[1]-c[1]],o=[h[y][1],h[y][2]]}else if("t"===h[y][0]){if(y>0&&["Q","q","T","t"].indexOf(h[y-1][0])>-1)r=new O(o[0],o[1],2*o[0]-c[0],2*o[1]-c[1],o[0]+h[y][1],o[1]+h[y][2],void 0,void 0),this.length+=r.getTotalLength(),this.functions.push(r);else{var A=new u(o[0],o[0]+h[y][1],o[1],o[1]+h[y][2]);this.length+=A.getTotalLength(),this.functions.push(A)}c=[2*o[0]-c[0],2*o[1]-c[1]],o=[h[y][1]+o[0],h[y][2]+o[1]]}else if("A"===h[y][0]){var d=new l(o[0],o[1],h[y][1],h[y][2],h[y][3],1===h[y][4],1===h[y][5],h[y][6],h[y][7]);this.length+=d.getTotalLength(),o=[h[y][6],h[y][7]],this.functions.push(d)}else if("a"===h[y][0]){var b=new l(o[0],o[1],h[y][1],h[y][2],h[y][3],1===h[y][4],1===h[y][5],o[0]+h[y][6],o[1]+h[y][7]);this.length+=b.getTotalLength(),o=[o[0]+h[y][6],o[1]+h[y][7]],this.functions.push(b)}this.partial_lengths.push(this.length)}})),E=n((function(t){var n=this;if(e(this,"inst",void 0),e(this,"getTotalLength",(function(){return n.inst.getTotalLength()})),e(this,"getPointAtLength",(function(t){return n.inst.getPointAtLength(t)})),e(this,"getTangentAtLength",(function(t){return n.inst.getTangentAtLength(t)})),e(this,"getPropertiesAtLength",(function(t){return n.inst.getPropertiesAtLength(t)})),e(this,"getParts",(function(){return n.inst.getParts()})),this.inst=new j(t),!(this instanceof E))return new E(t)}));export{E as svgPathProperties};

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

// http://geoexamples.com/path-properties/ v1.1.0 Copyright 2023 Roger Veciana i Rovira
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).svgPathProperties={})}(this,(function(t){"use strict";function n(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function e(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(!t)return;if("string"==typeof t)return i(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return i(t,n)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}var h={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},r=/([astvzqmhlc])([^astvzqmhlc]*)/gi,s=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi,a=function(t){var n=t.match(s);return n?n.map(Number):[]},o=function(t,e,i,h){var r=this;n(this,"x0",void 0),n(this,"x1",void 0),n(this,"y0",void 0),n(this,"y1",void 0),n(this,"getTotalLength",(function(){return Math.sqrt(Math.pow(r.x0-r.x1,2)+Math.pow(r.y0-r.y1,2))})),n(this,"getPointAtLength",(function(t){var n=t/Math.sqrt(Math.pow(r.x0-r.x1,2)+Math.pow(r.y0-r.y1,2));n=Number.isNaN(n)?1:n;var e=(r.x1-r.x0)*n,i=(r.y1-r.y0)*n;return{x:r.x0+e,y:r.y0+i}})),n(this,"getTangentAtLength",(function(t){var n=Math.sqrt((r.x1-r.x0)*(r.x1-r.x0)+(r.y1-r.y0)*(r.y1-r.y0));return{x:-(r.x1-r.x0)/n,y:-(r.y1-r.y0)/n}})),n(this,"getPropertiesAtLength",(function(t){var n=r.getPointAtLength(t),e=r.getTangentAtLength(t);return{x:n.x,y:n.y,tangentX:e.x,tangentY:e.y}})),this.x0=t,this.x1=e,this.y0=i,this.y1=h},g=function(t,e,i,h,r,s,a,o,g){var c=this;n(this,"x0",void 0),n(this,"y0",void 0),n(this,"rx",void 0),n(this,"ry",void 0),n(this,"xAxisRotate",void 0),n(this,"LargeArcFlag",void 0),n(this,"SweepFlag",void 0),n(this,"x1",void 0),n(this,"y1",void 0),n(this,"length",void 0),n(this,"getTotalLength",(function(){return c.length})),n(this,"getPointAtLength",(function(t){t<0?t=0:t>c.length&&(t=c.length);var n=u({x:c.x0,y:c.y0},c.rx,c.ry,c.xAxisRotate,c.LargeArcFlag,c.SweepFlag,{x:c.x1,y:c.y1},t/c.length);return{x:n.x,y:n.y}})),n(this,"getTangentAtLength",(function(t){t<0?t=0:t>c.length&&(t=c.length);var n,e=.05,i=c.getPointAtLength(t);t<0?t=0:t>c.length&&(t=c.length);var h=(n=t<c.length-e?c.getPointAtLength(t+e):c.getPointAtLength(t-e)).x-i.x,r=n.y-i.y,s=Math.sqrt(h*h+r*r);return t<c.length-e?{x:-h/s,y:-r/s}:{x:h/s,y:r/s}})),n(this,"getPropertiesAtLength",(function(t){var n=c.getTangentAtLength(t),e=c.getPointAtLength(t);return{x:e.x,y:e.y,tangentX:n.x,tangentY:n.y}})),this.x0=t,this.y0=e,this.rx=i,this.ry=h,this.xAxisRotate=r,this.LargeArcFlag=s,this.SweepFlag=a,this.x1=o,this.y1=g;var f=l(300,(function(n){return u({x:t,y:e},i,h,r,s,a,{x:o,y:g},n)}));this.length=f.arcLength},u=function(t,n,e,i,h,r,s,a){n=Math.abs(n),e=Math.abs(e),i=c(i,360);var o=f(i);if(t.x===s.x&&t.y===s.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===n||0===e)return{x:0,y:0,ellipticalArcAngle:0};var g=(t.x-s.x)/2,u=(t.y-s.y)/2,l={x:Math.cos(o)*g+Math.sin(o)*u,y:-Math.sin(o)*g+Math.cos(o)*u},y=Math.pow(l.x,2)/Math.pow(n,2)+Math.pow(l.y,2)/Math.pow(e,2);y>1&&(n=Math.sqrt(y)*n,e=Math.sqrt(y)*e);var p=(Math.pow(n,2)*Math.pow(e,2)-Math.pow(n,2)*Math.pow(l.y,2)-Math.pow(e,2)*Math.pow(l.x,2))/(Math.pow(n,2)*Math.pow(l.y,2)+Math.pow(e,2)*Math.pow(l.x,2));p=p<0?0:p;var v=(h!==r?1:-1)*Math.sqrt(p),M=v*(n*l.y/e),L=v*(-e*l.x/n),w={x:Math.cos(o)*M-Math.sin(o)*L+(t.x+s.x)/2,y:Math.sin(o)*M+Math.cos(o)*L+(t.y+s.y)/2},d={x:(l.x-M)/n,y:(l.y-L)/e},A=x({x:1,y:0},d),P=x(d,{x:(-l.x-M)/n,y:(-l.y-L)/e});!r&&P>0?P-=2*Math.PI:r&&P<0&&(P+=2*Math.PI);var b=A+(P%=2*Math.PI)*a,T=n*Math.cos(b),m=e*Math.sin(b);return{x:Math.cos(o)*T-Math.sin(o)*m+w.x,y:Math.sin(o)*T+Math.cos(o)*m+w.y,ellipticalArcStartAngle:A,ellipticalArcEndAngle:A+P,ellipticalArcAngle:b,ellipticalArcCenter:w,resultantRx:n,resultantRy:e}},l=function(t,n){t=t||500;for(var e,i=0,h=[],r=[],s=n(0),a=0;a<t;a++){var o=p(a*(1/t),0,1);e=n(o),i+=y(s,e),r.push([s,e]),h.push({t:o,arcLength:i}),s=e}return e=n(1),r.push([s,e]),i+=y(s,e),h.push({t:1,arcLength:i}),{arcLength:i,arcLengthMap:h,approximationLines:r}},c=function(t,n){return(t%n+n)%n},f=function(t){return t*(Math.PI/180)},y=function(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))},p=function(t,n,e){return Math.min(Math.max(t,n),e)},x=function(t,n){var e=t.x*n.x+t.y*n.y,i=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(n.x,2)+Math.pow(n.y,2)));return(t.x*n.y-t.y*n.x<0?-1:1)*Math.acos(e/i)},v=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],M=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],L=[[1],[1,1],[1,2,1],[1,3,3,1]],w=function(t,n,e){return{x:(1-e)*(1-e)*(1-e)*t[0]+3*(1-e)*(1-e)*e*t[1]+3*(1-e)*e*e*t[2]+e*e*e*t[3],y:(1-e)*(1-e)*(1-e)*n[0]+3*(1-e)*(1-e)*e*n[1]+3*(1-e)*e*e*n[2]+e*e*e*n[3]}},d=function(t,n,e){return P([3*(t[1]-t[0]),3*(t[2]-t[1]),3*(t[3]-t[2])],[3*(n[1]-n[0]),3*(n[2]-n[1]),3*(n[3]-n[2])],e)},A=function(t,n,e){var i,h,r;i=e/2,h=0;for(var s=0;s<20;s++)r=i*v[20][s]+i,h+=M[20][s]*m(t,n,r);return i*h},P=function(t,n,e){return{x:(1-e)*(1-e)*t[0]+2*(1-e)*e*t[1]+e*e*t[2],y:(1-e)*(1-e)*n[0]+2*(1-e)*e*n[1]+e*e*n[2]}},b=function(t,n,e){void 0===e&&(e=1);var i=t[0]-2*t[1]+t[2],h=n[0]-2*n[1]+n[2],r=2*t[1]-2*t[0],s=2*n[1]-2*n[0],a=4*(i*i+h*h),o=4*(i*r+h*s),g=r*r+s*s;if(0===a)return e*Math.sqrt(Math.pow(t[2]-t[0],2)+Math.pow(n[2]-n[0],2));var u=o/(2*a),l=e+u,c=g/a-u*u,f=l*l+c>0?Math.sqrt(l*l+c):0,y=u*u+c>0?Math.sqrt(u*u+c):0,p=u+Math.sqrt(u*u+c)!==0&&(l+f)/(u+y)!=0?c*Math.log(Math.abs((l+f)/(u+y))):0;return Math.sqrt(a)/2*(l*f-u*y+p)},T=function(t,n,e){return{x:2*(1-e)*(t[1]-t[0])+2*e*(t[2]-t[1]),y:2*(1-e)*(n[1]-n[0])+2*e*(n[2]-n[1])}};function m(t,n,e){var i=q(1,e,t),h=q(1,e,n),r=i*i+h*h;return Math.sqrt(r)}var q=function t(n,e,i){var h,r,s=i.length-1;if(0===s)return 0;if(0===n){r=0;for(var a=0;a<=s;a++)r+=L[s][a]*Math.pow(1-e,s-a)*Math.pow(e,a)*i[a];return r}h=new Array(s);for(var o=0;o<s;o++)h[o]=s*(i[o+1]-i[o]);return t(n-1,e,h)},_=function(t,n,e){for(var i=1,h=t/n,r=(t-e(h))/n,s=0;i>.001;){var a=e(h+r),o=Math.abs(t-a)/n;if(o<i)i=o,h+=r;else{var g=e(h-r),u=Math.abs(t-g)/n;u<i?(i=u,h-=r):r/=2}if(++s>500)break}return h},S=function(t,e,i,h,r,s,a,o){var g=this;n(this,"a",void 0),n(this,"b",void 0),n(this,"c",void 0),n(this,"d",void 0),n(this,"length",void 0),n(this,"getArcLength",void 0),n(this,"getPoint",void 0),n(this,"getDerivative",void 0),n(this,"getTotalLength",(function(){return g.length})),n(this,"getPointAtLength",(function(t){var n=[g.a.x,g.b.x,g.c.x,g.d.x],e=[g.a.y,g.b.y,g.c.y,g.d.y],i=_(t,g.length,(function(t){return g.getArcLength(n,e,t)}));return g.getPoint(n,e,i)})),n(this,"getTangentAtLength",(function(t){var n=[g.a.x,g.b.x,g.c.x,g.d.x],e=[g.a.y,g.b.y,g.c.y,g.d.y],i=_(t,g.length,(function(t){return g.getArcLength(n,e,t)})),h=g.getDerivative(n,e,i),r=Math.sqrt(h.x*h.x+h.y*h.y);return r>0?{x:h.x/r,y:h.y/r}:{x:0,y:0}})),n(this,"getPropertiesAtLength",(function(t){var n,e=[g.a.x,g.b.x,g.c.x,g.d.x],i=[g.a.y,g.b.y,g.c.y,g.d.y],h=_(t,g.length,(function(t){return g.getArcLength(e,i,t)})),r=g.getDerivative(e,i,h),s=Math.sqrt(r.x*r.x+r.y*r.y);n=s>0?{x:r.x/s,y:r.y/s}:{x:0,y:0};var a=g.getPoint(e,i,h);return{x:a.x,y:a.y,tangentX:n.x,tangentY:n.y}})),n(this,"getC",(function(){return g.c})),n(this,"getD",(function(){return g.d})),this.a={x:t,y:e},this.b={x:i,y:h},this.c={x:r,y:s},void 0!==a&&void 0!==o?(this.getArcLength=A,this.getPoint=w,this.getDerivative=d,this.d={x:a,y:o}):(this.getArcLength=b,this.getPoint=P,this.getDerivative=T,this.d={x:0,y:0}),this.length=this.getArcLength([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],1)},C=function(t){var i=this;n(this,"length",0),n(this,"partial_lengths",[]),n(this,"functions",[]),n(this,"initial_point",null),n(this,"getPartAtLength",(function(t){t<0?t=0:t>i.length&&(t=i.length);for(var n=i.partial_lengths.length-1;i.partial_lengths[n]>=t&&n>0;)n--;return n++,{fraction:t-i.partial_lengths[n-1],i:n}})),n(this,"getTotalLength",(function(){return i.length})),n(this,"getPointAtLength",(function(t){var n=i.getPartAtLength(t),e=i.functions[n.i];if(e)return e.getPointAtLength(n.fraction);if(i.initial_point)return i.initial_point;throw new Error("Wrong function at this part.")})),n(this,"getTangentAtLength",(function(t){var n=i.getPartAtLength(t),e=i.functions[n.i];if(e)return e.getTangentAtLength(n.fraction);if(i.initial_point)return{x:0,y:0};throw new Error("Wrong function at this part.")})),n(this,"getPropertiesAtLength",(function(t){var n=i.getPartAtLength(t),e=i.functions[n.i];if(e)return e.getPropertiesAtLength(n.fraction);if(i.initial_point)return{x:i.initial_point.x,y:i.initial_point.y,tangentX:0,tangentY:0};throw new Error("Wrong function at this part.")})),n(this,"getParts",(function(){for(var t=[],n=0;n<i.functions.length;n++)if(null!==i.functions[n]){i.functions[n]=i.functions[n];var e={start:i.functions[n].getPointAtLength(0),end:i.functions[n].getPointAtLength(i.partial_lengths[n]-i.partial_lengths[n-1]),length:i.partial_lengths[n]-i.partial_lengths[n-1],getPointAtLength:i.functions[n].getPointAtLength,getTangentAtLength:i.functions[n].getTangentAtLength,getPropertiesAtLength:i.functions[n].getPropertiesAtLength};t.push(e)}return t}));for(var s,u=Array.isArray(t)?t:function(t){var n=(t&&t.length>0?t:"M0,0").match(r);if(!n)throw new Error("No path elements found in string ".concat(t));return n.reduce((function(t,n){var i=n.charAt(0),r=i.toLowerCase(),s=a(n.substr(1));for("m"===r&&s.length>2&&(t.push([i].concat(e(s.splice(0,2)))),r="l",i="m"===i?"l":"L");s.length>=0;){if(s.length===h[r]){t.push([i].concat(e(s.splice(0,h[r]))));break}if(s.length<h[r])throw new Error('Malformed path data: "'.concat(i,'" must have ').concat(h[r]," elements and has ").concat(s.length,": ").concat(n));t.push([i].concat(e(s.splice(0,h[r]))))}return t}),[])}(t),l=[0,0],c=[0,0],f=[0,0],y=0;y<u.length;y++){if("M"===u[y][0])f=[(l=[u[y][1],u[y][2]])[0],l[1]],this.functions.push(null),0===y&&(this.initial_point={x:u[y][1],y:u[y][2]});else if("m"===u[y][0])f=[(l=[u[y][1]+l[0],u[y][2]+l[1]])[0],l[1]],this.functions.push(null);else if("L"===u[y][0])this.length+=Math.sqrt(Math.pow(l[0]-u[y][1],2)+Math.pow(l[1]-u[y][2],2)),this.functions.push(new o(l[0],u[y][1],l[1],u[y][2])),l=[u[y][1],u[y][2]];else if("l"===u[y][0])this.length+=Math.sqrt(Math.pow(u[y][1],2)+Math.pow(u[y][2],2)),this.functions.push(new o(l[0],u[y][1]+l[0],l[1],u[y][2]+l[1])),l=[u[y][1]+l[0],u[y][2]+l[1]];else if("H"===u[y][0])this.length+=Math.abs(l[0]-u[y][1]),this.functions.push(new o(l[0],u[y][1],l[1],l[1])),l[0]=u[y][1];else if("h"===u[y][0])this.length+=Math.abs(u[y][1]),this.functions.push(new o(l[0],l[0]+u[y][1],l[1],l[1])),l[0]=u[y][1]+l[0];else if("V"===u[y][0])this.length+=Math.abs(l[1]-u[y][1]),this.functions.push(new o(l[0],l[0],l[1],u[y][1])),l[1]=u[y][1];else if("v"===u[y][0])this.length+=Math.abs(u[y][1]),this.functions.push(new o(l[0],l[0],l[1],l[1]+u[y][1])),l[1]=u[y][1]+l[1];else if("z"===u[y][0]||"Z"===u[y][0])this.length+=Math.sqrt(Math.pow(f[0]-l[0],2)+Math.pow(f[1]-l[1],2)),this.functions.push(new o(l[0],f[0],l[1],f[1])),l=[f[0],f[1]];else if("C"===u[y][0])s=new S(l[0],l[1],u[y][1],u[y][2],u[y][3],u[y][4],u[y][5],u[y][6]),this.length+=s.getTotalLength(),l=[u[y][5],u[y][6]],this.functions.push(s);else if("c"===u[y][0])(s=new S(l[0],l[1],l[0]+u[y][1],l[1]+u[y][2],l[0]+u[y][3],l[1]+u[y][4],l[0]+u[y][5],l[1]+u[y][6])).getTotalLength()>0?(this.length+=s.getTotalLength(),this.functions.push(s),l=[u[y][5]+l[0],u[y][6]+l[1]]):this.functions.push(new o(l[0],l[0],l[1],l[1]));else if("S"===u[y][0]){if(y>0&&["C","c","S","s"].indexOf(u[y-1][0])>-1){if(s){var p=s.getC();s=new S(l[0],l[1],2*l[0]-p.x,2*l[1]-p.y,u[y][1],u[y][2],u[y][3],u[y][4])}}else s=new S(l[0],l[1],l[0],l[1],u[y][1],u[y][2],u[y][3],u[y][4]);s&&(this.length+=s.getTotalLength(),l=[u[y][3],u[y][4]],this.functions.push(s))}else if("s"===u[y][0]){if(y>0&&["C","c","S","s"].indexOf(u[y-1][0])>-1){if(s){var x=s.getC(),v=s.getD();s=new S(l[0],l[1],l[0]+v.x-x.x,l[1]+v.y-x.y,l[0]+u[y][1],l[1]+u[y][2],l[0]+u[y][3],l[1]+u[y][4])}}else s=new S(l[0],l[1],l[0],l[1],l[0]+u[y][1],l[1]+u[y][2],l[0]+u[y][3],l[1]+u[y][4]);s&&(this.length+=s.getTotalLength(),l=[u[y][3]+l[0],u[y][4]+l[1]],this.functions.push(s))}else if("Q"===u[y][0]){if(l[0]==u[y][1]&&l[1]==u[y][2]){var M=new o(u[y][1],u[y][3],u[y][2],u[y][4]);this.length+=M.getTotalLength(),this.functions.push(M)}else s=new S(l[0],l[1],u[y][1],u[y][2],u[y][3],u[y][4],void 0,void 0),this.length+=s.getTotalLength(),this.functions.push(s);l=[u[y][3],u[y][4]],c=[u[y][1],u[y][2]]}else if("q"===u[y][0]){if(0!=u[y][1]||0!=u[y][2])s=new S(l[0],l[1],l[0]+u[y][1],l[1]+u[y][2],l[0]+u[y][3],l[1]+u[y][4],void 0,void 0),this.length+=s.getTotalLength(),this.functions.push(s);else{var L=new o(l[0]+u[y][1],l[0]+u[y][3],l[1]+u[y][2],l[1]+u[y][4]);this.length+=L.getTotalLength(),this.functions.push(L)}c=[l[0]+u[y][1],l[1]+u[y][2]],l=[u[y][3]+l[0],u[y][4]+l[1]]}else if("T"===u[y][0]){if(y>0&&["Q","q","T","t"].indexOf(u[y-1][0])>-1)s=new S(l[0],l[1],2*l[0]-c[0],2*l[1]-c[1],u[y][1],u[y][2],void 0,void 0),this.functions.push(s),this.length+=s.getTotalLength();else{var w=new o(l[0],u[y][1],l[1],u[y][2]);this.functions.push(w),this.length+=w.getTotalLength()}c=[2*l[0]-c[0],2*l[1]-c[1]],l=[u[y][1],u[y][2]]}else if("t"===u[y][0]){if(y>0&&["Q","q","T","t"].indexOf(u[y-1][0])>-1)s=new S(l[0],l[1],2*l[0]-c[0],2*l[1]-c[1],l[0]+u[y][1],l[1]+u[y][2],void 0,void 0),this.length+=s.getTotalLength(),this.functions.push(s);else{var d=new o(l[0],l[0]+u[y][1],l[1],l[1]+u[y][2]);this.length+=d.getTotalLength(),this.functions.push(d)}c=[2*l[0]-c[0],2*l[1]-c[1]],l=[u[y][1]+l[0],u[y][2]+l[1]]}else if("A"===u[y][0]){var A=new g(l[0],l[1],u[y][1],u[y][2],u[y][3],1===u[y][4],1===u[y][5],u[y][6],u[y][7]);this.length+=A.getTotalLength(),l=[u[y][6],u[y][7]],this.functions.push(A)}else if("a"===u[y][0]){var P=new g(l[0],l[1],u[y][1],u[y][2],u[y][3],1===u[y][4],1===u[y][5],l[0]+u[y][6],l[1]+u[y][7]);this.length+=P.getTotalLength(),l=[l[0]+u[y][6],l[1]+u[y][7]],this.functions.push(P)}this.partial_lengths.push(this.length)}},O=function(t){var e=this;if(n(this,"inst",void 0),n(this,"getTotalLength",(function(){return e.inst.getTotalLength()})),n(this,"getPointAtLength",(function(t){return e.inst.getPointAtLength(t)})),n(this,"getTangentAtLength",(function(t){return e.inst.getTangentAtLength(t)})),n(this,"getPropertiesAtLength",(function(t){return e.inst.getPropertiesAtLength(t)})),n(this,"getParts",(function(){return e.inst.getParts()})),this.inst=new C(t),!(this instanceof O))return new O(t)};t.svgPathProperties=O,Object.defineProperty(t,"__esModule",{value:!0})}));
// http://geoexamples.com/path-properties/ v1.1.1 Copyright 2023 Roger Veciana i Rovira
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).svgPathProperties={})}(this,(function(t){"use strict";function n(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,s(i.key),i)}}function e(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function i(t,n,e){return(n=s(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function r(t){return function(t){if(Array.isArray(t))return h(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){if(!t)return;if("string"==typeof t)return h(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return h(t,n)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function s(t){var n=function(t,n){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,n||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==typeof n?n:String(n)}var a={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},o=/([astvzqmhlc])([^astvzqmhlc]*)/gi,g=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi,u=function(t){var n=t.match(g);return n?n.map(Number):[]},l=e((function(t,n,e,r){var h=this;i(this,"x0",void 0),i(this,"x1",void 0),i(this,"y0",void 0),i(this,"y1",void 0),i(this,"getTotalLength",(function(){return Math.sqrt(Math.pow(h.x0-h.x1,2)+Math.pow(h.y0-h.y1,2))})),i(this,"getPointAtLength",(function(t){var n=t/Math.sqrt(Math.pow(h.x0-h.x1,2)+Math.pow(h.y0-h.y1,2));n=Number.isNaN(n)?1:n;var e=(h.x1-h.x0)*n,i=(h.y1-h.y0)*n;return{x:h.x0+e,y:h.y0+i}})),i(this,"getTangentAtLength",(function(t){var n=Math.sqrt((h.x1-h.x0)*(h.x1-h.x0)+(h.y1-h.y0)*(h.y1-h.y0));return{x:(h.x1-h.x0)/n,y:(h.y1-h.y0)/n}})),i(this,"getPropertiesAtLength",(function(t){var n=h.getPointAtLength(t),e=h.getTangentAtLength(t);return{x:n.x,y:n.y,tangentX:e.x,tangentY:e.y}})),this.x0=t,this.x1=n,this.y0=e,this.y1=r})),c=e((function(t,n,e,r,h,s,a,o,g){var u=this;i(this,"x0",void 0),i(this,"y0",void 0),i(this,"rx",void 0),i(this,"ry",void 0),i(this,"xAxisRotate",void 0),i(this,"LargeArcFlag",void 0),i(this,"SweepFlag",void 0),i(this,"x1",void 0),i(this,"y1",void 0),i(this,"length",void 0),i(this,"getTotalLength",(function(){return u.length})),i(this,"getPointAtLength",(function(t){t<0?t=0:t>u.length&&(t=u.length);var n=f({x:u.x0,y:u.y0},u.rx,u.ry,u.xAxisRotate,u.LargeArcFlag,u.SweepFlag,{x:u.x1,y:u.y1},t/u.length);return{x:n.x,y:n.y}})),i(this,"getTangentAtLength",(function(t){t<0?t=0:t>u.length&&(t=u.length);var n,e=.05,i=u.getPointAtLength(t);t<0?t=0:t>u.length&&(t=u.length);var r=(n=t<u.length-e?u.getPointAtLength(t+e):u.getPointAtLength(t-e)).x-i.x,h=n.y-i.y,s=Math.sqrt(r*r+h*h);return t<u.length-e?{x:-r/s,y:-h/s}:{x:r/s,y:h/s}})),i(this,"getPropertiesAtLength",(function(t){var n=u.getTangentAtLength(t),e=u.getPointAtLength(t);return{x:e.x,y:e.y,tangentX:n.x,tangentY:n.y}})),this.x0=t,this.y0=n,this.rx=e,this.ry=r,this.xAxisRotate=h,this.LargeArcFlag=s,this.SweepFlag=a,this.x1=o,this.y1=g;var l=y(300,(function(i){return f({x:t,y:n},e,r,h,s,a,{x:o,y:g},i)}));this.length=l.arcLength})),f=function(t,n,e,i,r,h,s,a){n=Math.abs(n),e=Math.abs(e),i=p(i,360);var o=x(i);if(t.x===s.x&&t.y===s.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===n||0===e)return{x:0,y:0,ellipticalArcAngle:0};var g=(t.x-s.x)/2,u=(t.y-s.y)/2,l={x:Math.cos(o)*g+Math.sin(o)*u,y:-Math.sin(o)*g+Math.cos(o)*u},c=Math.pow(l.x,2)/Math.pow(n,2)+Math.pow(l.y,2)/Math.pow(e,2);c>1&&(n=Math.sqrt(c)*n,e=Math.sqrt(c)*e);var f=(Math.pow(n,2)*Math.pow(e,2)-Math.pow(n,2)*Math.pow(l.y,2)-Math.pow(e,2)*Math.pow(l.x,2))/(Math.pow(n,2)*Math.pow(l.y,2)+Math.pow(e,2)*Math.pow(l.x,2));f=f<0?0:f;var y=(r!==h?1:-1)*Math.sqrt(f),v=y*(n*l.y/e),M=y*(-e*l.x/n),d={x:Math.cos(o)*v-Math.sin(o)*M+(t.x+s.x)/2,y:Math.sin(o)*v+Math.cos(o)*M+(t.y+s.y)/2},L={x:(l.x-v)/n,y:(l.y-M)/e},A=w({x:1,y:0},L),b=w(L,{x:(-l.x-v)/n,y:(-l.y-M)/e});!h&&b>0?b-=2*Math.PI:h&&b<0&&(b+=2*Math.PI);var P=A+(b%=2*Math.PI)*a,m=n*Math.cos(P),T=e*Math.sin(P);return{x:Math.cos(o)*m-Math.sin(o)*T+d.x,y:Math.sin(o)*m+Math.cos(o)*T+d.y,ellipticalArcStartAngle:A,ellipticalArcEndAngle:A+b,ellipticalArcAngle:P,ellipticalArcCenter:d,resultantRx:n,resultantRy:e}},y=function(t,n){t=t||500;for(var e,i=0,r=[],h=[],s=n(0),a=0;a<t;a++){var o=M(a*(1/t),0,1);e=n(o),i+=v(s,e),h.push([s,e]),r.push({t:o,arcLength:i}),s=e}return e=n(1),h.push([s,e]),i+=v(s,e),r.push({t:1,arcLength:i}),{arcLength:i,arcLengthMap:r,approximationLines:h}},p=function(t,n){return(t%n+n)%n},x=function(t){return t*(Math.PI/180)},v=function(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))},M=function(t,n,e){return Math.min(Math.max(t,n),e)},w=function(t,n){var e=t.x*n.x+t.y*n.y,i=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(n.x,2)+Math.pow(n.y,2)));return(t.x*n.y-t.y*n.x<0?-1:1)*Math.acos(e/i)},d=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],L=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],A=[[1],[1,1],[1,2,1],[1,3,3,1]],b=function(t,n,e){return{x:(1-e)*(1-e)*(1-e)*t[0]+3*(1-e)*(1-e)*e*t[1]+3*(1-e)*e*e*t[2]+e*e*e*t[3],y:(1-e)*(1-e)*(1-e)*n[0]+3*(1-e)*(1-e)*e*n[1]+3*(1-e)*e*e*n[2]+e*e*e*n[3]}},P=function(t,n,e){return T([3*(t[1]-t[0]),3*(t[2]-t[1]),3*(t[3]-t[2])],[3*(n[1]-n[0]),3*(n[2]-n[1]),3*(n[3]-n[2])],e)},m=function(t,n,e){var i,r,h;i=e/2,r=0;for(var s=0;s<20;s++)h=i*d[20][s]+i,r+=L[20][s]*S(t,n,h);return i*r},T=function(t,n,e){return{x:(1-e)*(1-e)*t[0]+2*(1-e)*e*t[1]+e*e*t[2],y:(1-e)*(1-e)*n[0]+2*(1-e)*e*n[1]+e*e*n[2]}},q=function(t,n,e){void 0===e&&(e=1);var i=t[0]-2*t[1]+t[2],r=n[0]-2*n[1]+n[2],h=2*t[1]-2*t[0],s=2*n[1]-2*n[0],a=4*(i*i+r*r),o=4*(i*h+r*s),g=h*h+s*s;if(0===a)return e*Math.sqrt(Math.pow(t[2]-t[0],2)+Math.pow(n[2]-n[0],2));var u=o/(2*a),l=e+u,c=g/a-u*u,f=l*l+c>0?Math.sqrt(l*l+c):0,y=u*u+c>0?Math.sqrt(u*u+c):0,p=u+Math.sqrt(u*u+c)!==0&&(l+f)/(u+y)!=0?c*Math.log(Math.abs((l+f)/(u+y))):0;return Math.sqrt(a)/2*(l*f-u*y+p)},_=function(t,n,e){return{x:2*(1-e)*(t[1]-t[0])+2*e*(t[2]-t[1]),y:2*(1-e)*(n[1]-n[0])+2*e*(n[2]-n[1])}};function S(t,n,e){var i=j(1,e,t),r=j(1,e,n),h=i*i+r*r;return Math.sqrt(h)}var j=function t(n,e,i){var r,h,s=i.length-1;if(0===s)return 0;if(0===n){h=0;for(var a=0;a<=s;a++)h+=A[s][a]*Math.pow(1-e,s-a)*Math.pow(e,a)*i[a];return h}r=new Array(s);for(var o=0;o<s;o++)r[o]=s*(i[o+1]-i[o]);return t(n-1,e,r)},O=function(t,n,e){for(var i=1,r=t/n,h=(t-e(r))/n,s=0;i>.001;){var a=e(r+h),o=Math.abs(t-a)/n;if(o<i)i=o,r+=h;else{var g=e(r-h),u=Math.abs(t-g)/n;u<i?(i=u,r-=h):h/=2}if(++s>500)break}return r},C=e((function(t,n,e,r,h,s,a,o){var g=this;i(this,"a",void 0),i(this,"b",void 0),i(this,"c",void 0),i(this,"d",void 0),i(this,"length",void 0),i(this,"getArcLength",void 0),i(this,"getPoint",void 0),i(this,"getDerivative",void 0),i(this,"getTotalLength",(function(){return g.length})),i(this,"getPointAtLength",(function(t){var n=[g.a.x,g.b.x,g.c.x,g.d.x],e=[g.a.y,g.b.y,g.c.y,g.d.y],i=O(t,g.length,(function(t){return g.getArcLength(n,e,t)}));return g.getPoint(n,e,i)})),i(this,"getTangentAtLength",(function(t){var n=[g.a.x,g.b.x,g.c.x,g.d.x],e=[g.a.y,g.b.y,g.c.y,g.d.y],i=O(t,g.length,(function(t){return g.getArcLength(n,e,t)})),r=g.getDerivative(n,e,i),h=Math.sqrt(r.x*r.x+r.y*r.y);return h>0?{x:r.x/h,y:r.y/h}:{x:0,y:0}})),i(this,"getPropertiesAtLength",(function(t){var n,e=[g.a.x,g.b.x,g.c.x,g.d.x],i=[g.a.y,g.b.y,g.c.y,g.d.y],r=O(t,g.length,(function(t){return g.getArcLength(e,i,t)})),h=g.getDerivative(e,i,r),s=Math.sqrt(h.x*h.x+h.y*h.y);n=s>0?{x:h.x/s,y:h.y/s}:{x:0,y:0};var a=g.getPoint(e,i,r);return{x:a.x,y:a.y,tangentX:n.x,tangentY:n.y}})),i(this,"getC",(function(){return g.c})),i(this,"getD",(function(){return g.d})),this.a={x:t,y:n},this.b={x:e,y:r},this.c={x:h,y:s},void 0!==a&&void 0!==o?(this.getArcLength=m,this.getPoint=b,this.getDerivative=P,this.d={x:a,y:o}):(this.getArcLength=q,this.getPoint=T,this.getDerivative=_,this.d={x:0,y:0}),this.length=this.getArcLength([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],1)})),E=e((function(t){var n=this;i(this,"length",0),i(this,"partial_lengths",[]),i(this,"functions",[]),i(this,"initial_point",null),i(this,"getPartAtLength",(function(t){t<0?t=0:t>n.length&&(t=n.length);for(var e=n.partial_lengths.length-1;n.partial_lengths[e]>=t&&e>0;)e--;return e++,{fraction:t-n.partial_lengths[e-1],i:e}})),i(this,"getTotalLength",(function(){return n.length})),i(this,"getPointAtLength",(function(t){var e=n.getPartAtLength(t),i=n.functions[e.i];if(i)return i.getPointAtLength(e.fraction);if(n.initial_point)return n.initial_point;throw new Error("Wrong function at this part.")})),i(this,"getTangentAtLength",(function(t){var e=n.getPartAtLength(t),i=n.functions[e.i];if(i)return i.getTangentAtLength(e.fraction);if(n.initial_point)return{x:0,y:0};throw new Error("Wrong function at this part.")})),i(this,"getPropertiesAtLength",(function(t){var e=n.getPartAtLength(t),i=n.functions[e.i];if(i)return i.getPropertiesAtLength(e.fraction);if(n.initial_point)return{x:n.initial_point.x,y:n.initial_point.y,tangentX:0,tangentY:0};throw new Error("Wrong function at this part.")})),i(this,"getParts",(function(){for(var t=[],e=0;e<n.functions.length;e++)if(null!==n.functions[e]){n.functions[e]=n.functions[e];var i={start:n.functions[e].getPointAtLength(0),end:n.functions[e].getPointAtLength(n.partial_lengths[e]-n.partial_lengths[e-1]),length:n.partial_lengths[e]-n.partial_lengths[e-1],getPointAtLength:n.functions[e].getPointAtLength,getTangentAtLength:n.functions[e].getTangentAtLength,getPropertiesAtLength:n.functions[e].getPropertiesAtLength};t.push(i)}return t}));for(var e,h=Array.isArray(t)?t:function(t){var n=(t&&t.length>0?t:"M0,0").match(o);if(!n)throw new Error("No path elements found in string ".concat(t));return n.reduce((function(t,n){var e=n.charAt(0),i=e.toLowerCase(),h=u(n.substr(1));for("m"===i&&h.length>2&&(t.push([e].concat(r(h.splice(0,2)))),i="l",e="m"===e?"l":"L");h.length>=0;){if(h.length===a[i]){t.push([e].concat(r(h.splice(0,a[i]))));break}if(h.length<a[i])throw new Error('Malformed path data: "'.concat(e,'" must have ').concat(a[i]," elements and has ").concat(h.length,": ").concat(n));t.push([e].concat(r(h.splice(0,a[i]))))}return t}),[])}(t),s=[0,0],g=[0,0],f=[0,0],y=0;y<h.length;y++){if("M"===h[y][0])f=[(s=[h[y][1],h[y][2]])[0],s[1]],this.functions.push(null),0===y&&(this.initial_point={x:h[y][1],y:h[y][2]});else if("m"===h[y][0])f=[(s=[h[y][1]+s[0],h[y][2]+s[1]])[0],s[1]],this.functions.push(null);else if("L"===h[y][0])this.length+=Math.sqrt(Math.pow(s[0]-h[y][1],2)+Math.pow(s[1]-h[y][2],2)),this.functions.push(new l(s[0],h[y][1],s[1],h[y][2])),s=[h[y][1],h[y][2]];else if("l"===h[y][0])this.length+=Math.sqrt(Math.pow(h[y][1],2)+Math.pow(h[y][2],2)),this.functions.push(new l(s[0],h[y][1]+s[0],s[1],h[y][2]+s[1])),s=[h[y][1]+s[0],h[y][2]+s[1]];else if("H"===h[y][0])this.length+=Math.abs(s[0]-h[y][1]),this.functions.push(new l(s[0],h[y][1],s[1],s[1])),s[0]=h[y][1];else if("h"===h[y][0])this.length+=Math.abs(h[y][1]),this.functions.push(new l(s[0],s[0]+h[y][1],s[1],s[1])),s[0]=h[y][1]+s[0];else if("V"===h[y][0])this.length+=Math.abs(s[1]-h[y][1]),this.functions.push(new l(s[0],s[0],s[1],h[y][1])),s[1]=h[y][1];else if("v"===h[y][0])this.length+=Math.abs(h[y][1]),this.functions.push(new l(s[0],s[0],s[1],s[1]+h[y][1])),s[1]=h[y][1]+s[1];else if("z"===h[y][0]||"Z"===h[y][0])this.length+=Math.sqrt(Math.pow(f[0]-s[0],2)+Math.pow(f[1]-s[1],2)),this.functions.push(new l(s[0],f[0],s[1],f[1])),s=[f[0],f[1]];else if("C"===h[y][0])e=new C(s[0],s[1],h[y][1],h[y][2],h[y][3],h[y][4],h[y][5],h[y][6]),this.length+=e.getTotalLength(),s=[h[y][5],h[y][6]],this.functions.push(e);else if("c"===h[y][0])(e=new C(s[0],s[1],s[0]+h[y][1],s[1]+h[y][2],s[0]+h[y][3],s[1]+h[y][4],s[0]+h[y][5],s[1]+h[y][6])).getTotalLength()>0?(this.length+=e.getTotalLength(),this.functions.push(e),s=[h[y][5]+s[0],h[y][6]+s[1]]):this.functions.push(new l(s[0],s[0],s[1],s[1]));else if("S"===h[y][0]){if(y>0&&["C","c","S","s"].indexOf(h[y-1][0])>-1){if(e){var p=e.getC();e=new C(s[0],s[1],2*s[0]-p.x,2*s[1]-p.y,h[y][1],h[y][2],h[y][3],h[y][4])}}else e=new C(s[0],s[1],s[0],s[1],h[y][1],h[y][2],h[y][3],h[y][4]);e&&(this.length+=e.getTotalLength(),s=[h[y][3],h[y][4]],this.functions.push(e))}else if("s"===h[y][0]){if(y>0&&["C","c","S","s"].indexOf(h[y-1][0])>-1){if(e){var x=e.getC(),v=e.getD();e=new C(s[0],s[1],s[0]+v.x-x.x,s[1]+v.y-x.y,s[0]+h[y][1],s[1]+h[y][2],s[0]+h[y][3],s[1]+h[y][4])}}else e=new C(s[0],s[1],s[0],s[1],s[0]+h[y][1],s[1]+h[y][2],s[0]+h[y][3],s[1]+h[y][4]);e&&(this.length+=e.getTotalLength(),s=[h[y][3]+s[0],h[y][4]+s[1]],this.functions.push(e))}else if("Q"===h[y][0]){if(s[0]==h[y][1]&&s[1]==h[y][2]){var M=new l(h[y][1],h[y][3],h[y][2],h[y][4]);this.length+=M.getTotalLength(),this.functions.push(M)}else e=new C(s[0],s[1],h[y][1],h[y][2],h[y][3],h[y][4],void 0,void 0),this.length+=e.getTotalLength(),this.functions.push(e);s=[h[y][3],h[y][4]],g=[h[y][1],h[y][2]]}else if("q"===h[y][0]){if(0!=h[y][1]||0!=h[y][2])e=new C(s[0],s[1],s[0]+h[y][1],s[1]+h[y][2],s[0]+h[y][3],s[1]+h[y][4],void 0,void 0),this.length+=e.getTotalLength(),this.functions.push(e);else{var w=new l(s[0]+h[y][1],s[0]+h[y][3],s[1]+h[y][2],s[1]+h[y][4]);this.length+=w.getTotalLength(),this.functions.push(w)}g=[s[0]+h[y][1],s[1]+h[y][2]],s=[h[y][3]+s[0],h[y][4]+s[1]]}else if("T"===h[y][0]){if(y>0&&["Q","q","T","t"].indexOf(h[y-1][0])>-1)e=new C(s[0],s[1],2*s[0]-g[0],2*s[1]-g[1],h[y][1],h[y][2],void 0,void 0),this.functions.push(e),this.length+=e.getTotalLength();else{var d=new l(s[0],h[y][1],s[1],h[y][2]);this.functions.push(d),this.length+=d.getTotalLength()}g=[2*s[0]-g[0],2*s[1]-g[1]],s=[h[y][1],h[y][2]]}else if("t"===h[y][0]){if(y>0&&["Q","q","T","t"].indexOf(h[y-1][0])>-1)e=new C(s[0],s[1],2*s[0]-g[0],2*s[1]-g[1],s[0]+h[y][1],s[1]+h[y][2],void 0,void 0),this.length+=e.getTotalLength(),this.functions.push(e);else{var L=new l(s[0],s[0]+h[y][1],s[1],s[1]+h[y][2]);this.length+=L.getTotalLength(),this.functions.push(L)}g=[2*s[0]-g[0],2*s[1]-g[1]],s=[h[y][1]+s[0],h[y][2]+s[1]]}else if("A"===h[y][0]){var A=new c(s[0],s[1],h[y][1],h[y][2],h[y][3],1===h[y][4],1===h[y][5],h[y][6],h[y][7]);this.length+=A.getTotalLength(),s=[h[y][6],h[y][7]],this.functions.push(A)}else if("a"===h[y][0]){var b=new c(s[0],s[1],h[y][1],h[y][2],h[y][3],1===h[y][4],1===h[y][5],s[0]+h[y][6],s[1]+h[y][7]);this.length+=b.getTotalLength(),s=[s[0]+h[y][6],s[1]+h[y][7]],this.functions.push(b)}this.partial_lengths.push(this.length)}})),D=e((function(t){var n=this;if(i(this,"inst",void 0),i(this,"getTotalLength",(function(){return n.inst.getTotalLength()})),i(this,"getPointAtLength",(function(t){return n.inst.getPointAtLength(t)})),i(this,"getTangentAtLength",(function(t){return n.inst.getTangentAtLength(t)})),i(this,"getPropertiesAtLength",(function(t){return n.inst.getPropertiesAtLength(t)})),i(this,"getParts",(function(){return n.inst.getParts()})),this.inst=new E(t),!(this instanceof D))return new D(t)}));t.svgPathProperties=D,Object.defineProperty(t,"__esModule",{value:!0})}));

@@ -11,4 +11,4 @@ import SVGPathProperties from "./svg-path-properties";

}
declare type svgPathProperties = _svgPathProperties;
type svgPathProperties = _svgPathProperties;
export declare const svgPathProperties: typeof _svgPathProperties & ((val: string) => svgPathProperties);
export {};

@@ -19,3 +19,3 @@ export interface Properties {

}
export declare type PointArray = [number, number];
export type PointArray = [number, number];
export interface PointProperties {

@@ -27,2 +27,2 @@ x: number;

}
export declare type pathOrders = "a" | "c" | "h" | "l" | "m" | "q" | "s" | "t" | "v" | "z";
export type pathOrders = "a" | "c" | "h" | "l" | "m" | "q" | "s" | "t" | "v" | "z";
{
"name": "svg-path-properties",
"version": "1.1.1",
"version": "1.2.0",
"description": "Calculate the length for an SVG path, to use it with node or a Canvas element",

@@ -36,14 +36,13 @@ "keywords": [

"license": "ISC",
"dependencies": {},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/core": "^7.21.8",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "^7.11.0",
"@babel/preset-env": "^7.11.5",
"@babel/preset-typescript": "^7.10.4",
"@types/tape": "^4.13.0",
"@babel/preset-env": "^7.21.5",
"@babel/preset-typescript": "^7.21.5",
"@types/tape": "^4.13.4",
"babel6-plugin-strip-class-callcheck": "^6.0.0",
"eslint": "^7.10.0",
"prettier": "^2.1.2",
"rollup": "^2.28.2",
"eslint": "^7.32.0",
"prettier": "^2.8.8",
"rollup": "^2.79.1",
"rollup-plugin-babel": "^4.4.0",

@@ -53,6 +52,6 @@ "rollup-plugin-commonjs": "^10.1.0",

"rollup-plugin-terser": "^7.0.2",
"tape": "^5.0.1",
"ts-node": "^9.0.0",
"typescript": "^4.0.3"
"tape": "^5.6.3",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
}
}

@@ -42,4 +42,4 @@ import { Properties, Point, PointProperties } from "./types";

return {
x: -(this.x1 - this.x0) / module,
y: -(this.y1 - this.y0) / module,
x: (this.x1 - this.x0) / module,
y: (this.y1 - this.y0) / module,
};

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

@@ -396,3 +396,3 @@ import parse from "./parse";

public getParts = () => {
const parts = [];
const parts: PartProperties[] = [];
for (var i = 0; i < this.functions.length; i++) {

@@ -399,0 +399,0 @@ if (this.functions[i] !== null) {

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

import * as test from "tape";
import test from "tape";
import { Bezier } from "../src/bezier";

@@ -39,3 +39,12 @@ import { inDelta } from "./inDelta";

test("Testing pull request #16 solution", function (test) {
var curve = new Bezier(640.48, 1285.21, 642.39, 644.73, 642.39, 644.73, undefined, undefined);
var curve = new Bezier(
640.48,
1285.21,
642.39,
644.73,
642.39,
644.73,
undefined,
undefined
);
var tangent = curve.getTangentAtLength(curve.getTotalLength() / 2);

@@ -42,0 +51,0 @@ test.true(inDelta(tangent.y, 0, 1));

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

import * as test from "tape";
import test from "tape";
import SVGPathProperties from "../src/svg-path-properties";

@@ -54,3 +54,3 @@

parts[0].getTangentAtLength(5),
{ x: -1, y: -0 },
{ x: 1, y: 0 },
"testing getTangentAtLength"

@@ -60,3 +60,3 @@ );

parts[1].getTangentAtLength(5),
{ x: -1, y: -0 },
{ x: 1, y: 0 },
"testing getTangentAtLength"

@@ -67,3 +67,3 @@ );

parts[0].getPropertiesAtLength(5),
{ tangentX: -1, tangentY: -0, x: 15, y: 0 },
{ tangentX: 1, tangentY: 0, x: 15, y: 0 },
"testing getPropertiesAtLength"

@@ -73,3 +73,3 @@ );

parts[1].getPropertiesAtLength(5),
{ tangentX: -1, tangentY: -0, x: 25, y: 0 },
{ tangentX: 1, tangentY: 0, x: 25, y: 0 },
"testing getPropertiesAtLength"

@@ -76,0 +76,0 @@ );

@@ -1,10 +0,14 @@

export const inDelta = (actual, expected, delta) => {
return (Array.isArray(expected) ? inDeltaArray : inDeltaNumber)(
actual,
expected,
delta
);
export const inDelta = (
actual: number[] | number,
expected: number[] | number,
delta: number
) => {
if (Array.isArray(actual) && Array.isArray(expected))
return inDeltaArray(actual, expected, delta);
else if (!Array.isArray(actual) && !Array.isArray(expected))
return inDeltaNumber(actual, expected, delta);
else throw new Error("Both elements should be either arrays or numbers");
};
const inDeltaArray = (actual, expected, delta) => {
const inDeltaArray = (actual: number[], expected: number[], delta: number) => {
const n = expected.length;

@@ -17,4 +21,4 @@ let i = -1;

const inDeltaNumber = (actual, expected, delta) => {
const inDeltaNumber = (actual: number, expected: number, delta: number) => {
return actual >= expected - delta && actual <= expected + delta;
};

@@ -1,9 +0,8 @@

import * as test from "tape";
import { inDelta } from "./inDelta";
import test from "tape";
import { svgPathProperties } from "../src/index";
test("Creation with different styles test", function(test) {
test("Creation with different styles test", function (test) {
const svgPath = "M0,100 q50,-150 100,0 t100,0";
const a = new svgPathProperties(svgPath); // MyClass
const b = svgPathProperties(svgPath); // also MyClass
const b = new svgPathProperties(svgPath); // also MyClass

@@ -10,0 +9,0 @@ test.equal(

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

import * as test from "tape";
import test from "tape";
import { LinearPosition } from "../src/linear";

@@ -63,6 +63,10 @@ import SVGPathProperties from "../src/svg-path-properties";

//S & s
properties = new SVGPathProperties("M100,200 C100,100 250,100 250,200 S400,300 400,200");
properties = new SVGPathProperties(
"M100,200 C100,100 250,100 250,200 S400,300 400,200"
);
test.true(inDelta(properties.getTotalLength(), 475.746, 0.1));
properties = new SVGPathProperties("M100,200 c0,-100 150,-100 150,0 s150,100 150,0");
properties = new SVGPathProperties(
"M100,200 c0,-100 150,-100 150,0 s150,100 150,0"
);
test.true(inDelta(properties.getTotalLength(), 475.746, 0.1));

@@ -95,3 +99,5 @@

properties = new SVGPathProperties("M0,100 Q50,-50 100,100 T200,100 T300,100");
properties = new SVGPathProperties(
"M0,100 Q50,-50 100,100 T200,100 T300,100"
);
test.true(inDelta(properties.getTotalLength(), 565.26, 0.1));

@@ -98,0 +104,0 @@

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

import * as test from "tape";
import test from "tape";
import parse from "../src/parse";
test("overloaded moveTo", test => {
test("overloaded moveTo", (test) => {
test.deepEqual(parse("m 12.5,52 39,0 0,-40 -39,0 z"), [

@@ -10,3 +10,3 @@ ["m", 12.5, 52],

["l", -39, 0],
["z"]
["z"],
]);

@@ -19,3 +19,3 @@

["L", -39, 0],
["z"]
["z"],
]);

@@ -35,3 +35,3 @@

["c", 50, 0, 50, 100, 100, 100],
["c", 50, 0, 50, -100, 100, -100]
["c", 50, 0, 50, -100, 100, -100],
],

@@ -52,3 +52,3 @@ "Correct parse c"

["l", 10, 10],
["l", 10, 10]
["l", 10, 10],
]);

@@ -63,7 +63,9 @@

test("arcTo, quadratic curveTo, smooth curveTo, smooth quadratic curveTo", function (test) {
test.deepEqual(parse("A 30 50 0 0 1 162.55 162.45"), [["A", 30, 50, 0, 0, 1, 162.55, 162.45]]);
test.deepEqual(parse("A 30 50 0 0 1 162.55 162.45"), [
["A", 30, 50, 0, 0, 1, 162.55, 162.45],
]);
test.deepEqual(parse("M10 80 Q 95 10 180 80"), [
["M", 10, 80],
["Q", 95, 10, 180, 80]
["Q", 95, 10, 180, 80],
]);

@@ -79,7 +81,6 @@ test.deepEqual(parse("S 1 2, 3 4"), [["S", 1, 2, 3, 4]]);

test("Empty string", test => {
test("Empty string", (test) => {
test.deepEqual(parse(""), [["M", 0, 0]]);
test.deepEqual(parse(null), [["M", 0, 0]]);
test.end();
});

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

import * as test from "tape";
import test from "tape";
import SVGPathProperties from "../src/svg-path-properties";

@@ -10,8 +10,15 @@ import { inDelta } from "./inDelta";

xValues: [0, 100, 200, 300, 400, 500],
yValues: [50, 50, 50, 50, 50, 50]
yValues: [50, 50, 50, 50, 50, 50],
},
{
path: "M0,50L300,300",
xValues: [0, 59.999996185302734, 119.99999237060547, 180, 239.99998474121094, 300],
yValues: [50, 100, 150, 200, 249.99998474121094, 300]
xValues: [
0,
59.999996185302734,
119.99999237060547,
180,
239.99998474121094,
300,
],
yValues: [50, 100, 150, 200, 249.99998474121094, 300],
},

@@ -21,3 +28,3 @@ {

xValues: [0, 50, 100, 150, 200, 250, 300],
yValues: [50, 50, 50, 50, 50, 50, 50]
yValues: [50, 50, 50, 50, 50, 50, 50],
},

@@ -27,3 +34,3 @@ {

xValues: [50, 100, 150, 200, 250, 300, 350],
yValues: [50, 50, 50, 50, 50, 50, 50]
yValues: [50, 50, 50, 50, 50, 50, 50],
},

@@ -40,4 +47,4 @@ {

166.6666717529297,
200
]
200,
],
},

@@ -54,4 +61,4 @@ {

176.6666717529297,
210
]
210,
],
},

@@ -61,9 +68,9 @@ {

xValues: [50, 183.3333282470703, 300, 300, 166.66668701171875, 50, 50],
yValues: [50, 50, 66.66665649414062, 200, 200, 183.33331298828125, 50]
}
yValues: [50, 50, 66.66665649414062, 200, 200, 183.33331298828125, 50],
},
];
let properties: SVGPathProperties;
for (let i = 0; i < paths.length; i++) {
properties = new SVGPathProperties(paths[i].path);
for (let j = 0; j < paths[i].xValues.length; j++) {
properties = new SVGPathProperties(paths[i].path);
const position = properties.getPointAtLength(

@@ -79,3 +86,6 @@ (j * properties.getTotalLength()) / (paths[i].xValues.length - 1)

);
test.deepEqual(properties.getPointAtLength(-1), properties.getPointAtLength(0));
test.deepEqual(
properties.getPointAtLength(-1),
properties.getPointAtLength(0)
);
}

@@ -97,3 +107,3 @@

544.75341796875,
600
600,
],

@@ -107,4 +117,4 @@ yValues: [

240.47999572753906,
300
]
300,
],
},

@@ -120,3 +130,3 @@ {

174.39163208007812,
200
200,
],

@@ -130,4 +140,4 @@ yValues: [

157.15139770507812,
100
]
100,
],
},

@@ -143,3 +153,3 @@ {

174.39163208007812,
200
200,
],

@@ -153,4 +163,4 @@ yValues: [

157.15139770507812,
100
]
100,
],
},

@@ -166,5 +176,5 @@ {

166.6666717529297,
200
200,
],
yValues: [100, 100, 100, 100, 100, 100, 100]
yValues: [100, 100, 100, 100, 100, 100, 100],
},

@@ -180,3 +190,3 @@ {

250.00059509277344,
300
300,
],

@@ -190,10 +200,10 @@ yValues: [

25.00008201599121,
100
]
}
100,
],
},
];
let properties: SVGPathProperties;
for (let i = 0; i < paths.length; i++) {
properties = new SVGPathProperties(paths[i].path);
for (let j = 0; j < paths[i].xValues.length; j++) {
properties = new SVGPathProperties(paths[i].path);
const position = properties.getPointAtLength(

@@ -209,3 +219,6 @@ (j * properties.getTotalLength()) / (paths[i].xValues.length - 1)

);
test.deepEqual(properties.getPointAtLength(-1), properties.getPointAtLength(0));
test.deepEqual(
properties.getPointAtLength(-1),
properties.getPointAtLength(0)
);
}

@@ -226,3 +239,3 @@ test.end();

496.41815185546875,
500.0001220703125
500.0001220703125,
],

@@ -236,4 +249,4 @@ yValues: [

144.5059051513672,
199.99981689453125
]
199.99981689453125,
],
},

@@ -249,3 +262,3 @@ {

363.11114501953125,
400
400,
],

@@ -259,4 +272,4 @@ yValues: [

265.62835693359375,
200
]
200,
],
},

@@ -272,3 +285,3 @@ {

367.6199951171875,
400
400,
],

@@ -282,4 +295,4 @@ yValues: [

238.78338623046875,
200
]
200,
],
},

@@ -296,3 +309,3 @@ {

164.99853515625,
240
240,
],

@@ -306,4 +319,4 @@ yValues: [

121.38365936279297,
100
]
100,
],
},

@@ -320,3 +333,3 @@ {

164.99853515625,
240
240,
],

@@ -330,10 +343,10 @@ yValues: [

121.38365936279297,
100
]
}
100,
],
},
];
let properties: SVGPathProperties;
for (let i = 0; i < paths.length; i++) {
properties = new SVGPathProperties(paths[i].path);
for (let j = 0; j < paths[i].xValues.length; j++) {
properties = new SVGPathProperties(paths[i].path);
const position = properties.getPointAtLength(

@@ -349,3 +362,6 @@ (j * properties.getTotalLength()) / (paths[i].xValues.length - 1)

);
test.deepEqual(properties.getPointAtLength(-1), properties.getPointAtLength(0));
test.deepEqual(
properties.getPointAtLength(-1),
properties.getPointAtLength(0)
);
}

@@ -388,3 +404,5 @@ test.end();

test("Testing with multiple rings", function (test) {
let properties = new SVGPathProperties("M100,100h100v100h-100Z m200,0h1v1h-1z");
let properties = new SVGPathProperties(
"M100,100h100v100h-100Z m200,0h1v1h-1z"
);
test.deepEqual(properties.getPointAtLength(0), { x: 100, y: 100 });

@@ -397,4 +415,9 @@ test.deepEqual(properties.getPointAtLength(401), { x: 301, y: 100 });

test.deepEqual(properties.getPointAtLength(200), { x: 400, y: 100 });
test.deepEqual(properties.getPointAtLength(200), properties.getPointAtLength(500));
properties = new SVGPathProperties("M100,100 L101,100 M200,0 M500,600 M0,0L1,0L1,1L0,1Z");
test.deepEqual(
properties.getPointAtLength(200),
properties.getPointAtLength(500)
);
properties = new SVGPathProperties(
"M100,100 L101,100 M200,0 M500,600 M0,0L1,0L1,1L0,1Z"
);
test.deepEqual(properties.getPointAtLength(0), { x: 100, y: 100 });

@@ -420,15 +443,27 @@ test.deepEqual(properties.getPointAtLength(1), { x: 101, y: 100 });

test.deepEqual(properties.getTangentAtLength(0), { x: 0, y: 0 });
test.deepEqual(properties.getPropertiesAtLength(0), { x: 0, y: 0, tangentX: 0, tangentY: 0 });
properties = new SVGPathProperties(null);
test.deepEqual(properties.getPointAtLength(0), { x: 0, y: 0 });
test.deepEqual(properties.getTangentAtLength(0), { x: 0, y: 0 });
test.deepEqual(properties.getPropertiesAtLength(0), { x: 0, y: 0, tangentX: 0, tangentY: 0 });
test.deepEqual(properties.getPropertiesAtLength(0), {
x: 0,
y: 0,
tangentX: 0,
tangentY: 0,
});
properties = new SVGPathProperties("");
test.deepEqual(properties.getPointAtLength(0), { x: 0, y: 0 });
test.deepEqual(properties.getTangentAtLength(0), { x: 0, y: 0 });
test.deepEqual(properties.getPropertiesAtLength(0), { x: 0, y: 0, tangentX: 0, tangentY: 0 });
test.deepEqual(properties.getPropertiesAtLength(0), {
x: 0,
y: 0,
tangentX: 0,
tangentY: 0,
});
properties = new SVGPathProperties("M10, 10");
test.deepEqual(properties.getPointAtLength(0), { x: 10, y: 10 });
test.deepEqual(properties.getTangentAtLength(0), { x: 0, y: 0 });
test.deepEqual(properties.getPropertiesAtLength(0), { x: 10, y: 10, tangentX: 0, tangentY: 0 });
test.deepEqual(properties.getPropertiesAtLength(0), {
x: 10,
y: 10,
tangentX: 0,
tangentY: 0,
});

@@ -441,7 +476,10 @@ test.end();

);
test.deepEqual(properties.getPointAtLength(300), { x: 111.7377391058728, y: 310.0179550672576 });
test.deepEqual(properties.getPointAtLength(300), {
x: 111.7377391058728,
y: 310.0179550672576,
});
test.deepEqual(properties.getTangentAtLength(300), {
x: -0.29770950875462776,
y: 0.9546565080682572
y: 0.9546565080682572,
});

@@ -453,3 +491,3 @@

tangentX: -0.29770950875462776,
tangentY: 0.9546565080682572
tangentY: 0.9546565080682572,
});

@@ -456,0 +494,0 @@

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

import * as test from "tape";
import test from "tape";
import SVGPathProperties from "../src/svg-path-properties";

@@ -9,4 +9,4 @@ import { inDelta } from "./inDelta";

path: "M0,50L500,50",
xValues: [-1, -1, -1, -1, -1, -1, -1],
yValues: [-0, -0, -0, -0, -0, -0, -0],
xValues: [1, 1, 1, 1, 1, 1, 1],
yValues: [0, 0, 0, 0, 0, 0, 0],
},

@@ -16,18 +16,18 @@ {

xValues: [
-0.7682212795973759,
-0.7682212795973759,
-0.7682212795973759,
-0.7682212795973759,
-0.7682212795973759,
-0.7682212795973759,
-0.7682212795973759,
0.7682212795973759,
0.7682212795973759,
0.7682212795973759,
0.7682212795973759,
0.7682212795973759,
0.7682212795973759,
0.7682212795973759,
],
yValues: [
-0.6401843996644798,
-0.6401843996644798,
-0.6401843996644798,
-0.6401843996644798,
-0.6401843996644798,
-0.6401843996644798,
-0.6401843996644798,
0.6401843996644798,
0.6401843996644798,
0.6401843996644798,
0.6401843996644798,
0.6401843996644798,
0.6401843996644798,
0.6401843996644798,
],

@@ -37,24 +37,24 @@ },

path: "M0,50H300",
xValues: [-1, -1, -1, -1, -1, -1, -1],
yValues: [-0, -0, -0, -0, -0, -0, -0],
xValues: [1, 1, 1, 1, 1, 1, 1],
yValues: [0, 0, 0, 0, 0, 0, 0],
},
{
path: "M50,50h300",
xValues: [-1, -1, -1, -1, -1, -1, -1],
yValues: [-0, -0, -0, -0, -0, -0, -0],
xValues: [1, 1, 1, 1, 1, 1, 1],
yValues: [0, 0, 0, 0, 0, 0, 0],
},
{
path: "M50,0V200",
xValues: [-0, -0, -0, -0, -0, -0, -0],
yValues: [-1, -1, -1, -1, -1, -1, -1],
xValues: [0, 0, 0, 0, 0, 0, 0],
yValues: [1, 1, 1, 1, 1, 1, 1],
},
{
path: "M50,10v200",
xValues: [-0, -0, -0, -0, -0, -0, -0],
yValues: [-1, -1, -1, -1, -1, -1, -1],
xValues: [0, 0, 0, 0, 0, 0, 0],
yValues: [1, 1, 1, 1, 1, 1, 1],
},
{
path: "M50,50H300V200H50Z",
xValues: [-1, -1, -0, -0, 1, -0, -0],
yValues: [-0, -0, -1, -1, -0, 1, 1],
xValues: [1, 1, 0, 0, -1, 0, 0],
yValues: [0, 0, 1, 1, 0, -1, -1],
},

@@ -126,4 +126,4 @@ {

path: "M0,100 T200,100",
xValues: [-1, -1, -1, -1, -1, -1, -1],
yValues: [-0, -0, -0, -0, -0, -0, -0],
xValues: [1, 1, 1, 1, 1, 1, 1],
yValues: [0, 0, 0, 0, 0, 0, 0],
},

@@ -130,0 +130,0 @@ {

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc