import { jsx as o, Fragment as d } from "react/jsx-runtime";
import { useState as p, useEffect as u } from "react";
import { a as x } from "./index-react-spring_web.modern.js";
import { useTransition as y } from "./index-react-spring_core.modern.js";
const k = ({
  children: e,
  waitBetweenComponents: s = 2100,
  duration: i = 350,
  cycle: l = !1
}) => {
  const [n, f] = p(0);
  u(() => {
    const t = setInterval(() => {
      f((r) => {
        const a = r + 1;
        return a < e.length ? a : (clearInterval(t), r);
      });
    }, s);
    return () => clearInterval(t);
  }, [e.length, l, s]);
  const m = y(n, {
    key: n,
    // from: { opacity: 0, transform: "translateY(100px)", position: "absolute" },
    // enter: { opacity: 1, transform: "translateY(0)" },
    // leave: { opacity: 0, transform: "translateY(100px)" },
    from: {
      opacity: 0,
      transform: "translate3d(0,80px,0)",
      position: "absolute",
      width: "100%"
    },
    enter: {
      opacity: 1,
      transform: "translate3d(0,0%,0)"
    },
    leave: {
      opacity: 0,
      transform: "translate3d(0,-80px,0)",
      width: "100%"
    },
    keys: n,
    config: {
      duration: i
    }
  });
  return o(d, {
    children: m((t, r, a, c) => o(x.div, {
      style: {
        ...t
      },
      children: e[r]
    }, c))
  });
};
export {
  k as SlideTransition
};
