"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const T=require("./utils/paths.cjs.js");/*!
 * CustomEase 3.13.0
 * https://gsap.com
 *
 * @license Copyright 2008-2025, GreenSock. All rights reserved.
 * Subject to the terms at https://gsap.com/standard-license
 * @author: Jack Doyle, jack@greensock.com
*/var d,O,q=function(){return d||typeof window!="undefined"&&(d=window.gsap)&&d.registerPlugin&&d},j=function(){d=q(),d?(d.registerEase("_CE",E.create),O=1):console.warn("Please gsap.registerPlugin(CustomEase)")},I=1e20,C=function(n){return~~(n*1e3+(n<0?-.5:.5))/1e3},R=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/gi,k=/[cLlsSaAhHvVtTqQ]/g,v=function(n){var m=n.length,e=I,r;for(r=1;r<m;r+=6)+n[r]<e&&(e=+n[r]);return e},H=function(n,m,e){!e&&e!==0&&(e=Math.max(+n[n.length-1],+n[1]));var r=+n[0]*-1,o=-e,c=n.length,i=1/(+n[c-2]+r),s=-m||(Math.abs(+n[c-1]-+n[1])<.01*(+n[c-2]-+n[0])?v(n)+o:+n[c-1]+o),y;for(s?s=1/s:s=-i,y=0;y<c;y+=2)n[y]=(+n[y]+r)*i,n[y+1]=(+n[y+1]+o)*s},L=function g(n,m,e,r,o,c,i,s,y,u,a){var x=(n+e)/2,_=(m+r)/2,t=(e+o)/2,M=(r+c)/2,l=(o+i)/2,f=(c+s)/2,h=(x+t)/2,p=(_+M)/2,w=(t+l)/2,P=(M+f)/2,D=(h+w)/2,G=(p+P)/2,b=i-n,S=s-m,V=Math.abs((e-i)*S-(r-s)*b),A=Math.abs((o-i)*S-(c-s)*b),z;return u||(u=[{x:n,y:m},{x:i,y:s}],a=1),u.splice(a||u.length-1,0,{x:D,y:G}),(V+A)*(V+A)>y*(b*b+S*S)&&(z=u.length,g(n,m,x,_,h,p,D,G,y,u,a),g(D,G,w,P,l,f,i,s,y,u,a+1+(u.length-z))),u},E=(function(){function g(m,e,r){O||j(),this.id=m,this.setData(e,r)}var n=g.prototype;return n.setData=function(e,r){r=r||{},e=e||"0,0,1,1";var o=e.match(R),c=1,i=[],s=[],y=r.precision||1,u=y<=1,a,x,_,t,M,l,f,h,p;if(this.data=e,(k.test(e)||~e.indexOf("M")&&e.indexOf("C")<0)&&(o=T.stringToRawPath(e)[0]),a=o.length,a===4)o.unshift(0,0),o.push(1,1),a=8;else if((a-2)%6)throw"Invalid CustomEase";for((+o[0]!=0||+o[a-2]!=1)&&H(o,r.height,r.originY),this.segment=o,t=2;t<a;t+=6)x={x:+o[t-2],y:+o[t-1]},_={x:+o[t+4],y:+o[t+5]},i.push(x,_),L(x.x,x.y,+o[t],+o[t+1],+o[t+2],+o[t+3],_.x,_.y,1/(y*2e5),i,i.length-1);for(a=i.length,t=0;t<a;t++)f=i[t],h=i[t-1]||f,(f.x>h.x||h.y!==f.y&&h.x===f.x||f===h)&&f.x<=1?(h.cx=f.x-h.x,h.cy=f.y-h.y,h.n=f,h.nx=f.x,u&&t>1&&Math.abs(h.cy/h.cx-i[t-2].cy/i[t-2].cx)>2&&(u=0),h.cx<c&&(h.cx?c=h.cx:(h.cx=.001,t===a-1&&(h.x-=.001,c=Math.min(c,.001),u=0)))):(i.splice(t--,1),a--);if(a=1/c+1|0,M=1/a,l=0,f=i[0],u){for(t=0;t<a;t++)p=t*M,f.nx<p&&(f=i[++l]),x=f.y+(p-f.x)/f.cx*f.cy,s[t]={x:p,cx:M,y:x,cy:0,nx:9},t&&(s[t-1].cy=x-s[t-1].y);l=i[i.length-1],s[a-1].cy=l.y-x,s[a-1].cx=l.x-s[s.length-1].x}else{for(t=0;t<a;t++)f.nx<t*M&&(f=i[++l]),s[t]=f;l<i.length-1&&(s[t-1]=i[i.length-2])}return this.ease=function(w){var P=s[w*a|0]||s[a-1];return P.nx<w&&(P=P.n),P.y+(w-P.x)/P.cx*P.cy},this.ease.custom=this,this.id&&d&&d.registerEase(this.id,this.ease),this},n.getSVGData=function(e){return g.getSVGData(this,e)},g.create=function(e,r,o){return new g(e,r,o).ease},g.register=function(e){d=e,j()},g.get=function(e){return d.parseEase(e)},g.getSVGData=function(e,r){r=r||{};var o=r.width||100,c=r.height||100,i=r.x||0,s=(r.y||0)+c,y=d.utils.toArray(r.path)[0],u,a,x,_,t,M,l,f,h,p;if(r.invert&&(c=-c,s=0),typeof e=="string"&&(e=d.parseEase(e)),e.custom&&(e=e.custom),e instanceof g)u=T.rawPathToString(T.transformRawPath([e.segment],o,0,0,-c,i,s));else{for(u=[i,s],l=Math.max(5,(r.precision||1)*200),_=1/l,l+=2,f=5/l,h=C(i+_*o),p=C(s+e(_)*-c),a=(p-s)/(h-i),x=2;x<l;x++)t=C(i+x*_*o),M=C(s+e(x*_)*-c),(Math.abs((M-p)/(t-h)-a)>f||x===l-1)&&(u.push(h,p),a=(M-p)/(t-h)),h=t,p=M;u="M"+u.join(",")}return y&&y.setAttribute("d",u),u},g})();E.version="3.13.0";E.headless=!0;q()&&d.registerPlugin(E);exports.CustomEase=E;exports.default=E;
