import{n as $,e as _,d as b}from"./scheduler.D08FylXR.js";import{C as w,D as B,E as R,F as S}from"./index.bOCONIGK.js";import{c as q}from"./index.CvmYViMX.js";function D(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=_,start:r=w()+f,end:u=r+c,tick:h=$,css:a}=e(s,{from:t,to:n},o);let d=!0,i=!1,l;function m(){a&&(l=R(s,0,1,c,f,p,a)),f||(i=!0)}function y(){a&&S(s,l),d=!1}return B(g=>{if(!i&&g>=r&&(i=!0),i&&g>=u&&(h(1,0),y()),!d)return!1;if(i){const x=g-r,C=0+1*p(x/c);h(C,1-C)}return!0}),m(),h(0,1),y}function E(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 j(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:d=q}=o;return{delay:h,duration:b(a)?a(Math.sqrt(r*r+u*u)):a,easing:d,css:(i,l)=>{const m=l*r,y=l*u,g=i+l*t.width/e.width,x=i+l*t.height/e.height;return`transform: ${f} translate(${m}px, ${y}px) scale(${g}, ${x});`}}}export{j as a,D as c,E as f};
