import { U as reactExports, L as jsxRuntimeExports, O as Outlet } from "./server-DSC_YmUp.js";
import { G as useAuth, S as useNavigate, d as Logo } from "./router-CEZm8MTA.js";
import "node:async_hooks";
import "node:stream/web";
import "node:stream";
function AuthenticatedLayout() {
  const {
    user,
    loading
  } = useAuth();
  const navigate = useNavigate();
  reactExports.useEffect(() => {
    if (!loading && !user) navigate({
      to: "/auth"
    });
  }, [user, loading, navigate]);
  if (loading) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex min-h-[calc(100svh-4rem)] items-center justify-center", style: {
      background: "var(--gradient-soft)"
    }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Logo, { variant: "mark", size: 56, className: "mx-auto mb-4 drop-shadow-md animate-[pulse-soft_2s_ease-in-out_infinite]" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground", children: "Se încarcă..." })
    ] }) });
  }
  if (!user) return null;
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Outlet, {});
}
export {
  AuthenticatedLayout as component
};
