import { jsx } from "react/jsx-runtime";
import { isServer } from "@tanstack/router-core/isServer";
import { useRouter } from "./useRouter.js";
function ScriptOnce({ children }) {
  const router = useRouter();
  if (!(isServer ?? router.isServer)) {
    return null;
  }
  return /* @__PURE__ */ jsx(
    "script",
    {
      nonce: router.options.ssr?.nonce,
      dangerouslySetInnerHTML: {
        __html: children + ";document.currentScript.remove()"
      }
    }
  );
}
export {
  ScriptOnce
};//# sourceMappingURL=https://main.vscode-cdn.net/sourcemaps/e0b7a2bcf575cfba10528c4e7c10bd3ce2d7769a/node_modules/@tanstack/react-router/dist/esm/ScriptOnce.js.map
