const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_index = require("../iconfont/index.js");
const require_index$1 = require("../../utils/index.js");
const require_useCssVariables = require("../../hooks/useCssVariables.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
require("./index.less");
//#region src/components/pisellLoading/index.tsx
const PisellLoading = (props) => {
	const { children, fullscreen, mask, loading, delay } = props;
	const ref = (0, react.useRef)(null);
	const { backgroundColor = "#fff", width = "100%", height = "100%" } = mask || {};
	require_useCssVariables.default({
		variables: {
			"--pisell-loading-mask-opacity": mask ? "1" : "0",
			"--pisell-loading-bg-color": fullscreen && !mask ? "transparent" : backgroundColor,
			"--pisell-loading-bg-width": require_index$1.getCssNumber(width) || "100%",
			"--pisell-loading-bg-height": require_index$1.getCssNumber(height) || "100%",
			"--pisell-loading-bg-border-radius": width !== "100%" || height !== "100%" ? "12px" : "0px"
		},
		ref
	});
	return /* @__PURE__ */ react.default.createElement("div", {
		ref,
		className: "pisell-loading-wrapper"
	}, /* @__PURE__ */ react.default.createElement(antd.Spin, {
		fullscreen,
		delay,
		spinning: loading,
		indicator: /* @__PURE__ */ react.default.createElement(require_index.default, {
			type: "pisell2-loader2",
			style: { fontSize: 40 },
			spin: true
		})
	}, children));
};
//#endregion
exports.default = PisellLoading;
