import{n as $,j as b,e as C}from"./scheduler.-rnGJo_9.js";import{F as w,G as B,H as R,I as S}from"./index.BZ2zs19M.js";import{c as q}from"./index.CvmYViMX.js";function k(s,t,e,o){if(!t)return $;const n=s.getBoundingClientRect();if(t.left===n.left&&t.right===n.right&&t.top===n.top&&t.bottom===n.bottom)return $;const{delay:f=0,duration:c=300,easing:p=b,start:r=w()+f,end:u=r+c,tick:h=$,css:a}=e(s,{from:t,to:n},o);let y=!0,i=!1,l;function m(){a&&(l=R(s,0,1,c,f,p,a)),f||(i=!0)}function d(){a&&S(s,l),y=!1}return B(g=>{if(!i&&g>=r&&(i=!0),i&&g>=u&&(h(1,0),d()),!y)return!1;if(i){const x=g-r,_=0+1*p(x/c);h(_,1-_)}return!0}),m(),h(0,1),d}function G(s){const t=getComputedStyle(s);if(t.position!=="absolute"&&t.position!=="fixed"){const{width:e,height:o}=t,n=s.getBoundingClientRect();s.style.position="absolute",s.style.width=e,s.style.height=o,F(s,n)}}function F(s,t){const e=s.getBoundingClientRect();if(t.left!==e.left||t.top!==e.top){const o=getComputedStyle(s),n=o.transform==="none"?"":o.transform;s.style.transform=`${n} translate(${t.left-e.left}px, ${t.top-e.top}px)`}}function H(s,{from:t,to:e},o={}){const n=getComputedStyle(s),f=n.transform==="none"?"":n.transform,[c,p]=n.transformOrigin.split(" ").map(parseFloat),r=t.left+t.width*c/e.width-(e.left+c),u=t.top+t.height*p/e.height-(e.top+p),{delay:h=0,duration:a=i=>Math.sqrt(i)*120,easing:y=q}=o;return{delay:h,duration:C(a)?a(Math.sqrt(r*r+u*u)):a,easing:y,css:(i,l)=>{const m=l*r,d=l*u,g=i+l*t.width/e.width,x=i+l*t.height/e.height;return`transform: ${f} translate(${m}px, ${d}px) scale(${g}, ${x});`}}}export{H as a,k as c,G as f};
