var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { Center, theme } from "../../..";
var Puff = function (_a) {
    var speed = _a.speed, rest = __rest(_a, ["speed"]);
    return (_jsxs("g", __assign({ fill: "none", fillRule: "evenodd" }, __assign({}, rest), { children: [_jsxs("circle", __assign({ cx: 22, cy: 22, r: 1 }, { children: [_jsx("animate", { attributeName: "r", begin: "0s", dur: "".concat(1.8 / speed, "s"), values: "1; 20", calcMode: "spline", keyTimes: "0; 1", keySplines: "0.165, 0.84, 0.44, 1", repeatCount: "indefinite" }), _jsx("animate", { attributeName: "stroke-opacity", begin: "0s", dur: "".concat(1.8 / speed, "s"), values: "1; 0", calcMode: "spline", keyTimes: "0; 1", keySplines: "0.3, 0.61, 0.355, 1", repeatCount: "indefinite" })] })), _jsxs("circle", __assign({ cx: 22, cy: 22, r: 1 }, { children: [_jsx("animate", { attributeName: "r", begin: "-0.9s", dur: "".concat(1.8 / speed, "s"), values: "1; 20", calcMode: "spline", keyTimes: "0; 1", keySplines: "0.165, 0.84, 0.44, 1", repeatCount: "indefinite" }), _jsx("animate", { attributeName: "stroke-opacity", begin: "-0.9s", dur: "".concat(1.8 / speed, "s"), values: "1; 0", calcMode: "spline", keyTimes: "0; 1", keySplines: "0.3, 0.61, 0.355, 1", repeatCount: "indefinite" })] }))] })));
};
var Oval = function (_a) {
    var speed = _a.speed, rest = __rest(_a, ["speed"]);
    return (_jsxs("g", __assign({ transform: "translate(1 1)", fill: "none", fillRule: "evenodd" }, __assign({}, rest), { children: [_jsx("circle", { strokeOpacity: 0.5, cx: 18, cy: 18, r: 18 }), _jsx("path", __assign({ d: "M36 18c0-9.94-8.06-18-18-18" }, { children: _jsx("animateTransform", { attributeName: "transform", type: "rotate", from: "0 18 18", to: "360 18 18", dur: "".concat(1 / speed, "s"), repeatCount: "indefinite" }) }))] })));
};
var Grid = function (_a) {
    var speed = _a.speed, _b = _a.fill, fill = _b === void 0 ? theme.color.primary[500] : _b, rest = __rest(_a, ["speed", "fill"]);
    return (_jsxs(_Fragment, { children: [_jsx("circle", __assign({ cx: 12.5, cy: 12.5, r: 12.5 }, __assign({ fill: fill }, rest), { children: _jsx("animate", { attributeName: "fill-opacity", begin: "0s", dur: "".concat(1 / speed, "s"), values: "1;.2;1", calcMode: "linear", repeatCount: "indefinite" }) })), _jsx("circle", __assign({ cx: 12.5, cy: 52.5, r: 12.5 }, __assign({ fill: fill }, rest), { children: _jsx("animate", { attributeName: "fill-opacity", begin: "100ms", dur: "".concat(1 / speed, "s"), values: "1;.2;1", calcMode: "linear", repeatCount: "indefinite" }) })), _jsx("circle", __assign({ cx: 52.5, cy: 12.5, r: 12.5 }, __assign({ fill: fill }, rest), { children: _jsx("animate", { attributeName: "fill-opacity", begin: "300ms", dur: "".concat(1 / speed, "s"), values: "1;.2;1", calcMode: "linear", repeatCount: "indefinite" }) })), _jsx("circle", __assign({ cx: 52.5, cy: 52.5, r: 12.5 }, __assign({ fill: fill }, rest), { children: _jsx("animate", { attributeName: "fill-opacity", begin: "600ms", dur: "".concat(1 / speed, "s"), values: "1;.2;1", calcMode: "linear", repeatCount: "indefinite" }) })), _jsx("circle", __assign({ cx: 92.5, cy: 12.5, r: 12.5 }, __assign({ fill: fill }, rest), { children: _jsx("animate", { attributeName: "fill-opacity", begin: "800ms", dur: "".concat(1 / speed, "s"), values: "1;.2;1", calcMode: "linear", repeatCount: "indefinite" }) })), _jsx("circle", __assign({ cx: 92.5, cy: 52.5, r: 12.5 }, __assign({ fill: fill }, rest), { children: _jsx("animate", { attributeName: "fill-opacity", begin: "400ms", dur: "".concat(1 / speed, "s"), values: "1;.2;1", calcMode: "linear", repeatCount: "indefinite" }) })), _jsx("circle", __assign({ cx: 12.5, cy: 92.5, r: 12.5 }, __assign({ fill: fill }, rest), { children: _jsx("animate", { attributeName: "fill-opacity", begin: "700ms", dur: "".concat(1 / speed, "s"), values: "1;.2;1", calcMode: "linear", repeatCount: "indefinite" }) })), _jsx("circle", __assign({ cx: 52.5, cy: 92.5, r: 12.5 }, __assign({ fill: fill }, rest), { children: _jsx("animate", { attributeName: "fill-opacity", begin: "500ms", dur: "".concat(1 / speed, "s"), values: "1;.2;1", calcMode: "linear", repeatCount: "indefinite" }) })), _jsx("circle", __assign({ cx: 92.5, cy: 92.5, r: 12.5 }, __assign({ fill: fill }, rest), { children: _jsx("animate", { attributeName: "fill-opacity", begin: "200ms", dur: "".concat(1 / speed, "s"), values: "1;.2;1", calcMode: "linear", repeatCount: "indefinite" }) }))] }));
};
export var Spinner = function (_a) {
    var _b = _a.size, size = _b === void 0 ? 40 : _b, color = _a.color, _c = _a.speed, speed = _c === void 0 ? 1 : _c, _d = _a.strokeWidth, strokeWidth = _d === void 0 ? 2 : _d, strokeOpacity = _a.strokeOpacity, _e = _a.variant, variant = _e === void 0 ? "oval" : _e, props = __rest(_a, ["size", "color", "speed", "strokeWidth", "strokeOpacity", "variant"]);
    return (_jsx(Center, __assign({ h: size, w: size || "fit-content" }, { children: _jsxs("svg", __assign({}, __assign(__assign({}, props), { fill: undefined, fillOpacity: undefined, height: "inherit", speed: undefined, stroke: undefined, strokeOpacity: undefined, strokeWidth: undefined, width: "inherit" }), { viewBox: variant === "grid" ? "0 0 105 105" : "0 0 38 38", overflow: "visible" }, { children: [variant === "grid" && (_jsx(Grid, { speed: speed, stroke: color, strokeWidth: strokeWidth, strokeOpacity: strokeOpacity })), variant === "puff" && (_jsx(Puff, { speed: speed, stroke: color || theme.color.primary[500], strokeWidth: strokeWidth, strokeOpacity: strokeOpacity })), variant === "oval" && (_jsx(Oval, { speed: speed, stroke: color || theme.color.primary[500], strokeWidth: strokeWidth, strokeOpacity: strokeOpacity }))] })) })));
};
//# sourceMappingURL=index.js.map