import { LayoutUnit } from "../../layout/LayoutUnit.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { makeStyles } from "@material-ui/core";
import Skeleton from "@material-ui/lab/Skeleton";
//#region src/UI/feedback/NodeLoader.jsx
const useStyles = makeStyles((theme) => ({
	root: {},
	nodeWrapper: { display: "flex" }
}));
const NodeLoader = (t0) => {
	const $ = c(14);
	const { loading, nodesRequested: t1 } = t0;
	let t2;
	if ($[0] !== t1) {
		t2 = t1 === void 0 ? [1] : t1;
		$[0] = t1;
		$[1] = t2;
	} else t2 = $[1];
	const nodesRequested = t2;
	const classes = useStyles();
	let t3;
	if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
		t3 = [
			1,
			2,
			3,
			4
		];
		$[2] = t3;
	} else t3 = $[2];
	const singleNode = t3;
	let t4;
	if ($[3] !== classes) {
		const NodeElement = () => /* @__PURE__ */ React.createElement("div", { className: classes.nodeWrapper }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Skeleton, {
			variant: "circle",
			width: 20,
			height: 20
		})), /* @__PURE__ */ React.createElement("div", { style: {
			marginLeft: 8,
			width: "100%"
		} }, /* @__PURE__ */ React.createElement(Skeleton, {
			height: 20,
			variant: "rect",
			width: "100%"
		})));
		t4 = (t5) => {
			const { indent } = t5;
			return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { style: { marginLeft: indent } }, /* @__PURE__ */ React.createElement(NodeElement, null)), /* @__PURE__ */ React.createElement(LayoutUnit, { unit: "xxs" }));
		};
		$[3] = classes;
		$[4] = t4;
	} else t4 = $[4];
	const NodeGroup = t4;
	let t5;
	if ($[5] !== NodeGroup || $[6] !== loading) {
		t5 = loading && /* @__PURE__ */ React.createElement("div", null, singleNode.map((item, index) => /* @__PURE__ */ React.createElement(NodeGroup, { indent: index * 8 })));
		$[5] = NodeGroup;
		$[6] = loading;
		$[7] = t5;
	} else t5 = $[7];
	const singleNodeGroup = t5;
	let t6;
	if ($[8] !== classes || $[9] !== nodesRequested || $[10] !== singleNodeGroup) {
		t6 = nodesRequested && nodesRequested.map((item_0) => /* @__PURE__ */ React.createElement("div", { className: classes.root }, singleNodeGroup, " ", /* @__PURE__ */ React.createElement(LayoutUnit, { unit: "xxs" })));
		$[8] = classes;
		$[9] = nodesRequested;
		$[10] = singleNodeGroup;
		$[11] = t6;
	} else t6 = $[11];
	let t7;
	if ($[12] !== t6) {
		t7 = /* @__PURE__ */ React.createElement("div", null, t6);
		$[12] = t6;
		$[13] = t7;
	} else t7 = $[13];
	return t7;
};
//#endregion
export { NodeLoader };

//# sourceMappingURL=NodeLoader.mjs.map