function e(e,n,o){return new Promise((t=>{if(o?.duration===1/0)throw new Error("Promise-based animations must be finite.");const i=e.animate(n,{...o,duration:r()?0:o.duration});i.addEventListener("cancel",t,{once:!0}),i.addEventListener("finish",t,{once:!0})}))}function n(e){return(e=e.toString().toLowerCase()).indexOf("ms")>-1?parseFloat(e):e.indexOf("s")>-1?1e3*parseFloat(e):parseFloat(e)}function r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}function o(e){return Promise.all(e.getAnimations().map((e=>new Promise((n=>{const r=requestAnimationFrame(n);e.addEventListener("cancel",(()=>r),{once:!0}),e.addEventListener("finish",(()=>r),{once:!0}),e.cancel()})))))}function t(e,n){return e.map((e=>({...e,height:"auto"===e.height?`${n}px`:e.height})))}export{e as a,t as b,n as c,r as p,o as s};
