"use strict";

/* eslint-disable functional/immutable-data */
import React from "react";
import Animated, { withSpring } from "react-native-reanimated";
import { jsx as _jsx } from "react/jsx-runtime";
const ScaleInOutAnimation = ({
  visible = true,
  springConfig = {
    damping: 500,
    mass: 3,
    stiffness: 1000
  },
  children,
  style
}) => {
  const enteringAnimation = () => {
    "worklet";

    return {
      initialValues: {
        opacity: 0,
        transform: [{
          scale: 0.5
        }]
      },
      animations: {
        opacity: withSpring(1, springConfig),
        transform: [{
          scale: withSpring(1, springConfig)
        }]
      }
    };
  };
  const exitingAnimation = () => {
    "worklet";

    return {
      initialValues: {
        opacity: 1,
        transform: [{
          scale: 1
        }]
      },
      animations: {
        opacity: withSpring(0, springConfig),
        transform: [{
          scale: withSpring(0.5, springConfig)
        }]
      }
    };
  };
  if (!visible) {
    return null;
  }
  return /*#__PURE__*/_jsx(Animated.View, {
    style: style,
    entering: enteringAnimation,
    exiting: exitingAnimation,
    children: children
  });
};
export { ScaleInOutAnimation };
//# sourceMappingURL=ScaleInOutAnimation.js.map