/** * pasition v1.0.2 By dntzhang * Github: https://github.com/AlloyTeam/pasition * MIT Licensed. */ !function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):t.pasition=r()}(this,function(){"use strict";function t(t){var n=[];return t.replace(w,function(t,a,e){var o=a.toLowerCase();for(e=r(e),"m"==o&&e.length>2&&(n.push([a].concat(e.splice(0,2))),o="l",a="m"==a?"l":"L");;){if(e.length==b[o])return e.unshift(a),n.push(e);if(e.lengtht-1&&(o-=t),a[o]=e}r.push(a)}return r}function i(t){for(var r=[],n=0;n1&&(i=1),i<-1&&(i=-1),e*Math.acos(i)},g=function(t,r,n,a,e,o,s,u,i,c,h,p){var f=Math.pow(e,2),l=Math.pow(o,2),M=Math.pow(h,2),x=Math.pow(p,2),g=f*l-f*x-l*M;g<0&&(g=0),g/=f*x+l*M,g=Math.sqrt(g)*(s===u?-1:1);var d=g*e/o*p,b=g*-o/e*h,w=c*d-i*b+(t+n)/2,m=i*d+c*b+(r+a)/2,C=(h-d)/e,_=(p-b)/o,q=(-h-d)/e,E=(-p-b)/o,k=y(1,0,C,_),S=y(C,_,q,E);return 0===u&&S>0&&(S-=v),1===u&&S<0&&(S+=v),[w,m,k,S]},d=function(t){var r=t.px,n=t.py,a=t.cx,e=t.cy,o=t.rx,s=t.ry,u=t.xAxisRotation,i=void 0===u?0:u,c=t.largeArcFlag,h=void 0===c?0:c,p=t.sweepFlag,f=void 0===p?0:p,y=[];if(0===o||0===s)return[];var d=Math.sin(i*v/360),b=Math.cos(i*v/360),w=b*(r-a)/2+d*(n-e)/2,m=-d*(r-a)/2+b*(n-e)/2;if(0===w&&0===m)return[];o=Math.abs(o),s=Math.abs(s);var C=Math.pow(w,2)/Math.pow(o,2)+Math.pow(m,2)/Math.pow(s,2);C>1&&(o*=Math.sqrt(C),s*=Math.sqrt(C));var _=g(r,n,a,e,o,s,h,f,d,b,w,m),q=l(_,4),E=q[0],k=q[1],S=q[2],U=q[3],N=Math.max(Math.ceil(Math.abs(U)/(v/4)),1);U/=N;for(var O=0;Oe-1&&(a-=e)},C._splitCurves=function(t,r){for(var n=0,a=0;n=t.length-1&&(a=0)}},C.lerp=function(t,r,n){return C._lerp(C.path2shapes(t),C.path2shapes(r),n)},C.MIM_CURVES_COUNT=100,C._preprocessing=function(t,r){var n=t.length,a=r.length,e=JSON.parse(JSON.stringify(t)),u=JSON.parse(JSON.stringify(r));return n>a?f(u,n-a):na?n=p)return h=n,s(h,1),o(h),void cancelAnimationFrame(c);var u=i(r/p);h=C._lerp(a[0],a[1],u),s(h,u),c=requestAnimationFrame(t)}()},C});