import{g,bk as w,T as m,aG as p,p as S,bi as _}from"./index-dcf0de03.js";class u{constructor(r){let{x:s,y:i,width:o,height:a}=r;this.x=s,this.y=i,this.width=o,this.height=a}get top(){return this.y}get bottom(){return this.y+this.height}get left(){return this.x}get right(){return this.x+this.width}}function B(n,r){return{x:{before:Math.max(0,r.left-n.left),after:Math.max(0,n.right-r.right)},y:{before:Math.max(0,r.top-n.top),after:Math.max(0,n.bottom-r.bottom)}}}function L(n){const r=n.getBoundingClientRect(),s=getComputedStyle(n),i=s.transform;if(i){let o,a,t,e,d;if(i.startsWith("matrix3d("))o=i.slice(9,-1).split(/, /),a=+o[0],t=+o[5],e=+o[12],d=+o[13];else if(i.startsWith("matrix("))o=i.slice(7,-1).split(/, /),a=+o[0],t=+o[3],e=+o[4],d=+o[5];else return new u(r);const f=s.transformOrigin,c=r.x-e-(1-a)*parseFloat(f),h=r.y-d-(1-t)*parseFloat(f.slice(f.indexOf(" ")+1)),y=a?r.width/a:n.offsetWidth+1,b=t?r.height/t:n.offsetHeight+1;return new u({x:c,y:h,width:y,height:b})}else return new u(r)}function P(n,r,s){if(typeof n.animate>"u")return{finished:Promise.resolve()};let i;try{i=n.animate(r,s)}catch{return{finished:Promise.resolve()}}return typeof i.finished>"u"&&(i.finished=new Promise(o=>{i.onfinish=()=>{o(i)}})),i}const A="cubic-bezier(0.4, 0, 0.2, 1)",C="cubic-bezier(0.0, 0, 0.2, 1)",$="cubic-bezier(0.4, 0, 1, 1)",T=S({disabled:Boolean,group:Boolean,hideOnLeave:Boolean,leaveAbsolute:Boolean,mode:String,origin:String},"transition");function l(n,r,s){return g()({name:n,props:T({mode:s,origin:r}),setup(i,o){let{slots:a}=o;const t={onBeforeEnter(e){i.origin&&(e.style.transformOrigin=i.origin)},onLeave(e){if(i.leaveAbsolute){const{offsetTop:d,offsetLeft:f,offsetWidth:c,offsetHeight:h}=e;e._transitionInitialStyles={position:e.style.position,top:e.style.top,left:e.style.left,width:e.style.width,height:e.style.height},e.style.position="absolute",e.style.top=`${d}px`,e.style.left=`${f}px`,e.style.width=`${c}px`,e.style.height=`${h}px`}i.hideOnLeave&&e.style.setProperty("display","none","important")},onAfterLeave(e){if(i.leaveAbsolute&&(e!=null&&e._transitionInitialStyles)){const{position:d,top:f,left:c,width:h,height:y}=e._transitionInitialStyles;delete e._transitionInitialStyles,e.style.position=d||"",e.style.top=f||"",e.style.left=c||"",e.style.width=h||"",e.style.height=y||""}}};return()=>{const e=i.group?w:m;return p(e,{name:i.disabled?"":n,css:!i.disabled,...i.group?void 0:{mode:i.mode},...i.disabled?{}:t},a.default)}}})}function x(n,r){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"in-out";return g()({name:n,props:{mode:{type:String,default:s},disabled:Boolean},setup(i,o){let{slots:a}=o;return()=>p(m,{name:i.disabled?"":n,css:!i.disabled,...i.disabled?{}:r},a.default)}})}function v(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const s=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)?"width":"height",i=_(`offset-${s}`);return{onBeforeEnter(t){t._parent=t.parentNode,t._initialStyle={transition:t.style.transition,overflow:t.style.overflow,[s]:t.style[s]}},onEnter(t){const e=t._initialStyle;t.style.setProperty("transition","none","important"),t.style.overflow="hidden";const d=`${t[i]}px`;t.style[s]="0",t.offsetHeight,t.style.transition=e.transition,n&&t._parent&&t._parent.classList.add(n),requestAnimationFrame(()=>{t.style[s]=d})},onAfterEnter:a,onEnterCancelled:a,onLeave(t){t._initialStyle={transition:"",overflow:t.style.overflow,[s]:t.style[s]},t.style.overflow="hidden",t.style[s]=`${t[i]}px`,t.offsetHeight,requestAnimationFrame(()=>t.style[s]="0")},onAfterLeave:o,onLeaveCancelled:o};function o(t){n&&t._parent&&t._parent.classList.remove(n),a(t)}function a(t){const e=t._initialStyle[s];t.style.overflow=t._initialStyle.overflow,e!=null&&(t.style[s]=e),delete t._initialStyle}}l("fab-transition","center center","out-in");l("dialog-bottom-transition");l("dialog-top-transition");const z=l("fade-transition"),F=l("scale-transition");l("scroll-x-transition");l("scroll-x-reverse-transition");l("scroll-y-transition");l("scroll-y-reverse-transition");l("slide-x-transition");l("slide-x-reverse-transition");const O=l("slide-y-transition");l("slide-y-reverse-transition");const V=x("expand-transition",v()),H=x("expand-x-transition",v("",!0));export{u as B,z as V,P as a,V as b,F as c,O as d,H as e,C as f,$ as g,B as h,L as n,A as s};
