"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.exitTransitionInputIcon = exports.exitTransitionInnerContent = exports.exitTransitionAlertEdgeToEdge = exports.enterTransitionInputIcon = exports.enterTransitionInnerContentSmall = exports.enterTransitionInnerContent = exports.enterTransitionAlertEdgeToEdgeContent = exports.enterTransitionAlertEdgeToEdge = exports.alertEdgeToEdgeInsetTransitionConfig = void 0;
var _reactNativeReanimated = require("react-native-reanimated");
/**
A custom enter transition designed for the average size
inner content of a button or module (e.g. text).
The scaling effect is slight.
*/
const enterTransitionInnerContent = () => {
  "worklet";

  const animations = {
    opacity: (0, _reactNativeReanimated.withTiming)(1, {
      duration: 250,
      easing: _reactNativeReanimated.Easing.in(_reactNativeReanimated.Easing.cubic)
    }),
    transform: [{
      scale: (0, _reactNativeReanimated.withTiming)(1, {
        duration: 250,
        easing: _reactNativeReanimated.Easing.in(_reactNativeReanimated.Easing.cubic)
      })
    }]
  };
  const initialValues = {
    opacity: 0,
    transform: [{
      scale: 1.05
    }]
  };
  return {
    initialValues,
    animations
  };
};

/**
A custom enter transition designed for the small size
inner content of a button or module (e.g. loading spinner).
The scaling effect is accentuated.
*/
exports.enterTransitionInnerContent = enterTransitionInnerContent;
const enterTransitionInnerContentSmall = () => {
  "worklet";

  const animations = {
    opacity: (0, _reactNativeReanimated.withTiming)(1, {
      duration: 250,
      easing: _reactNativeReanimated.Easing.in(_reactNativeReanimated.Easing.cubic)
    }),
    transform: [{
      scale: (0, _reactNativeReanimated.withTiming)(1, {
        duration: 250,
        easing: _reactNativeReanimated.Easing.in(_reactNativeReanimated.Easing.cubic)
      })
    }]
  };
  const initialValues = {
    opacity: 0,
    transform: [{
      scale: 1.25
    }]
  };
  return {
    initialValues,
    animations
  };
};

/**
A custom exit transition designed for both small
and average size inner content of a button or module.
The scaling effect is slight.
*/
exports.enterTransitionInnerContentSmall = enterTransitionInnerContentSmall;
const exitTransitionInnerContent = () => {
  "worklet";

  const animations = {
    opacity: (0, _reactNativeReanimated.withTiming)(0, {
      duration: 350,
      easing: _reactNativeReanimated.Easing.out(_reactNativeReanimated.Easing.cubic)
    }),
    transform: [{
      scale: (0, _reactNativeReanimated.withTiming)(0.9, {
        duration: 350,
        easing: _reactNativeReanimated.Easing.out(_reactNativeReanimated.Easing.cubic)
      })
    }]
  };
  const initialValues = {
    opacity: 1,
    transform: [{
      scale: 1
    }]
  };
  return {
    initialValues,
    animations
  };
};

/**
A custom enter transition designed for the `AlertEdgeToEdge` component.
*/
exports.exitTransitionInnerContent = exitTransitionInnerContent;
const alertEdgeToEdgeEnterTransitionDuration = 500; /* in ms */
const alertEdgeToEdgeExitTransitionDuration = 400; /* in ms */

const alertEdgeToEdgeInsetTransitionConfig = exports.alertEdgeToEdgeInsetTransitionConfig = {
  duration: 400,
  easing: _reactNativeReanimated.Easing.inOut(_reactNativeReanimated.Easing.ease)
};
const enterTransitionAlertEdgeToEdge = values => {
  "worklet";

  const animations = {
    opacity: (0, _reactNativeReanimated.withTiming)(1, {
      duration: alertEdgeToEdgeEnterTransitionDuration,
      easing: _reactNativeReanimated.Easing.out(_reactNativeReanimated.Easing.exp)
    }),
    transform: [{
      translateY: (0, _reactNativeReanimated.withTiming)(0, {
        duration: alertEdgeToEdgeEnterTransitionDuration,
        easing: _reactNativeReanimated.Easing.out(_reactNativeReanimated.Easing.exp)
      })
    }]
  };
  const initialValues = {
    opacity: 0,
    transform: [{
      translateY: -values.targetHeight * 0.5
    }]
  };
  return {
    initialValues,
    animations
  };
};
/**
A custom enter/exit transition designed for icons
in `TextInput`.
*/
exports.enterTransitionAlertEdgeToEdge = enterTransitionAlertEdgeToEdge;
const iconTransitionWithTimingConfig = {
  duration: 250,
  easing: _reactNativeReanimated.Easing.inOut(_reactNativeReanimated.Easing.cubic)
};
const iconTransitionScaleFactor = 0.75;
const enterTransitionInputIcon = () => {
  "worklet";

  const animations = {
    opacity: (0, _reactNativeReanimated.withTiming)(1, iconTransitionWithTimingConfig),
    transform: [{
      scale: (0, _reactNativeReanimated.withTiming)(1, iconTransitionWithTimingConfig)
    }]
  };
  const initialValues = {
    opacity: 0,
    transform: [{
      scale: iconTransitionScaleFactor
    }]
  };
  return {
    initialValues,
    animations
  };
};

/**
A custom enter transition designed for the `AlertEdgeToEdge` content (icon and text).
*/
exports.enterTransitionInputIcon = enterTransitionInputIcon;
const enterTransitionAlertEdgeToEdgeContent = () => {
  "worklet";

  const animations = {
    opacity: (0, _reactNativeReanimated.withDelay)(alertEdgeToEdgeEnterTransitionDuration * 0.2, (0, _reactNativeReanimated.withTiming)(1, {
      duration: alertEdgeToEdgeEnterTransitionDuration * 0.7,
      easing: _reactNativeReanimated.Easing.out(_reactNativeReanimated.Easing.ease)
    })),
    transform: [{
      scaleY: (0, _reactNativeReanimated.withDelay)(alertEdgeToEdgeEnterTransitionDuration * 0.2, (0, _reactNativeReanimated.withTiming)(1, {
        duration: alertEdgeToEdgeEnterTransitionDuration * 0.7,
        easing: _reactNativeReanimated.Easing.out(_reactNativeReanimated.Easing.exp)
      }))
    }]
  };
  const initialValues = {
    opacity: 0,
    transform: [{
      scaleY: 0.7
    }]
  };
  return {
    initialValues,
    animations
  };
};

/**
A custom exit transition designed for the `AlertEdgeToEdge` component.
*/
exports.enterTransitionAlertEdgeToEdgeContent = enterTransitionAlertEdgeToEdgeContent;
const exitTransitionAlertEdgeToEdge = values => {
  "worklet";

  const animations = {
    opacity: (0, _reactNativeReanimated.withTiming)(0, {
      duration: alertEdgeToEdgeExitTransitionDuration,
      easing: _reactNativeReanimated.Easing.in(_reactNativeReanimated.Easing.exp)
    }),
    transform: [{
      translateY: (0, _reactNativeReanimated.withTiming)(-values.currentHeight * 0.5, {
        duration: alertEdgeToEdgeExitTransitionDuration,
        easing: _reactNativeReanimated.Easing.in(_reactNativeReanimated.Easing.exp)
      })
    }]
  };
  const initialValues = {
    opacity: 1,
    transform: [{
      translateY: 0
    }]
  };
  return {
    initialValues,
    animations
  };
};
exports.exitTransitionAlertEdgeToEdge = exitTransitionAlertEdgeToEdge;
const exitTransitionInputIcon = () => {
  "worklet";

  const animations = {
    opacity: (0, _reactNativeReanimated.withTiming)(0, iconTransitionWithTimingConfig),
    transform: [{
      scale: (0, _reactNativeReanimated.withTiming)(iconTransitionScaleFactor, iconTransitionWithTimingConfig)
    }]
  };
  const initialValues = {
    opacity: 1,
    transform: [{
      scale: 1
    }]
  };
  return {
    initialValues,
    animations
  };
};
exports.exitTransitionInputIcon = exitTransitionInputIcon;
//# sourceMappingURL=IOTransitions.js.map