function _array_like_to_array(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
    return arr2;
}
function _array_with_holes(arr) {
    if (Array.isArray(arr)) return arr;
}
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 _iterable_to_array_limit(arr, i) {
    var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
    if (_i == null) return;
    var _arr = [];
    var _n = true;
    var _d = false;
    var _s, _e;
    try {
        for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
            _arr.push(_s.value);
            if (i && _arr.length === i) break;
        }
    } catch (err) {
        _d = true;
        _e = err;
    } finally{
        try {
            if (!_n && _i["return"] != null) _i["return"]();
        } finally{
            if (_d) throw _e;
        }
    }
    return _arr;
}
function _non_iterable_rest() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _sliced_to_array(arr, i) {
    return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
}
function _unsupported_iterable_to_array(o, minLen) {
    if (!o) return;
    if (typeof o === "string") return _array_like_to_array(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor) n = o.constructor.name;
    if (n === "Map" || n === "Set") return Array.from(n);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
}
import { Keyframes } from "@ant-design/cssinjs";
import { genStyleHooks } from "../../Hooks/useStyle";
var beforeAnimation = new Keyframes('beforeAnimation', {
    '0%, 100%': {
        transform: 'translate(0, 0)'
    },
    '25%': {
        transform: 'translate(20%, 10%)'
    },
    '50%': {
        transform: 'translate(30%, 20%)'
    },
    '75%': {
        transform: 'translate(15%, 15%)'
    }
});
var afterAnimation = new Keyframes('afterAnimation', {
    '0%, 100%': {
        transform: 'translate(0, 0)'
    },
    '25%': {
        transform: 'translate(-20%, 10%)'
    },
    '50%': {
        transform: 'translate(-30%, -15%)'
    },
    '75%': {
        transform: 'translate(-15%, -10%)'
    }
});
var genStyle = function genStyle(token) {
    var _obj, _obj1, _obj2, _obj3;
    return _obj3 = {}, _define_property(_obj3, token.componentCls, (_obj = {
        position: 'relative',
        display: 'inline-flex',
        alignItems: 'center',
        gap: 4,
        textAlign: 'center',
        verticalAlign: 'middle'
    }, _define_property(_obj, "".concat(token.componentCls, "-with-tip"), {
        alignItems: 'center'
    }), _define_property(_obj, "".concat(token.componentCls, "-with-children"), {
        alignItems: 'center'
    }), _define_property(_obj, "".concat(token.componentCls, "-tip"), {
        color: 'var(--color-gray-text-secondary)',
        font: 'var(--font-text-body-emphasized-base)',
        letterSpacing: 'var(--letter-spacing-body-emphasized-base, normal)'
    }), _obj)), _define_property(_obj3, "".concat(token.componentCls, "-nested-pattern"), (_obj2 = {
        position: 'relative'
    }, _define_property(_obj2, "&".concat(token.componentCls, "-spinning"), _define_property({
        background: 'var(--color-primary-bg-page)',
        borderRadius: 'var(--radius-card-lg, 22px)',
        overflow: 'hidden',
        '&:before, &:after': {
            content: "''",
            position: 'absolute',
            borderRadius: '50%',
            willChange: 'transform',
            pointerEvents: 'none'
        },
        '&::before': {
            width: '120%',
            height: '160%',
            top: '-30%',
            left: '-40%',
            background: 'radial-gradient(ellipse 70% 60% at 50% 50%, var(--color-sub2-2) 0%, transparent 70%)',
            animationName: beforeAnimation,
            animationDuration: '6s',
            animationTimingFunction: 'ease-in-out',
            animationIterationCount: 'infinite'
        },
        '&::after': {
            width: '100%',
            height: '140%',
            top: '-30%',
            right: '-40%',
            background: 'radial-gradient(ellipse 70% 60% at 50% 50%, var(--color-sub1-2) 0%, transparent 60%)',
            filter: 'blur(60px)',
            animationName: afterAnimation,
            animationDuration: '7s',
            animationTimingFunction: 'ease-in-out',
            animationIterationCount: 'infinite'
        }
    }, "& > ".concat(token.componentCls), {
        position: 'absolute',
        top: 0,
        left: 0,
        zIndex: 4,
        display: 'flex',
        flexDirection: 'column',
        alignItems: 'center',
        justifyContent: 'center',
        gap: 4,
        width: '100%',
        height: '100%'
    })), _define_property(_obj2, // Dark theme
    '&-dark', (_obj1 = {}, _define_property(_obj1, "&".concat(token.componentCls, "-spinning"), {
        background: 'var(--color-gray-bg-page-dark)',
        '&::before': {
            background: 'radial-gradient(ellipse 70% 60% at 50% 50%, rgba(22, 96, 255, 0.15) 0%, transparent 70%)'
        },
        '&::after': {
            background: 'radial-gradient(ellipse 70% 60% at 50% 50%, rgba(135, 87, 255, 0.15) 0%, transparent 60%)'
        }
    }), _define_property(_obj1, "".concat(token.componentCls, "-tip"), {
        color: 'var(--color-gray-text-light)'
    }), _obj1)), _obj2)), _obj3;
};
export var prefixCls = 'loading';
var useGenStyle = genStyleHooks('Loading', genStyle);
export function useStyle(prefixCls) {
    var _useGenStyle = _sliced_to_array(useGenStyle(prefixCls !== null && prefixCls !== void 0 ? prefixCls : 'loading'), 2), wrapSSR = _useGenStyle[0], hashId = _useGenStyle[1];
    return {
        wrapSSR: wrapSSR,
        hashId: hashId
    };
}
