function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
import Lottie from "lottie-react";
import React, { useMemo } from "react";
import { useAsyncLottieData } from "../../../lotties/useAsyncLottieData";
/**
 * BouncingLottie 组件 - Lottie弹跳动画组件
 *
 * 该组件使用Lottie动画库提供流畅的弹跳动画效果，支持自定义尺寸、播放控制等。
 *
 * @component
 * @description Lottie弹跳动画组件，提供流畅的弹跳动画效果
 * @param {BouncingLottieProps} props - 组件属性
 * @param {boolean} [props.autoplay=true] - 是否自动播放动画
 * @param {boolean} [props.loop=true] - 是否循环播放动画
 * @param {string} [props.className] - 动画容器类名
 * @param {React.CSSProperties} [props.style] - 动画容器样式
 * @param {number} [props.size=32] - 动画尺寸
 *
 * @example
 * ```tsx
 * <BouncingLottie
 *   autoplay={true}
 *   loop={true}
 *   size={48}
 *   className="custom-loading"
 * />
 * ```
 *
 * @returns {React.ReactElement} 渲染的Lottie弹跳动画组件
 *
 * @remarks
 * - 使用Lottie动画库
 * - 提供流畅的动画效果
 * - 支持自定义尺寸
 * - 支持播放控制
 * - 支持自定义样式
 */ export var BouncingLottie = function BouncingLottie(param) {
    var _param_autoplay = param.autoplay, autoplay = _param_autoplay === void 0 ? true : _param_autoplay, _param_loop = param.loop, loop = _param_loop === void 0 ? true : _param_loop, className = param.className, style = param.style, _param_size = param.size, size = _param_size === void 0 ? 32 : _param_size;
    var loadJson = useMemo(function() {
        return function() {
            return import("./lottie.json");
        };
    }, []);
    var animationData = useAsyncLottieData(loadJson);
    var containerStyle = _object_spread({
        width: size,
        height: size,
        display: 'flex',
        justifyContent: 'center',
        alignItems: 'center'
    }, style);
    if (animationData === null) {
        return /*#__PURE__*/ React.createElement("div", {
            style: containerStyle,
            className: className,
            "aria-hidden": true
        });
    }
    return /*#__PURE__*/ React.createElement(Lottie, {
        style: containerStyle,
        className: className,
        "aria-hidden": "true",
        animationData: animationData,
        loop: loop,
        autoplay: autoplay
    });
};
export default BouncingLottie;
