import { useLayoutEffect } from "file:///Users/dmail/Documents/dev/core/node_modules/preact/hooks/dist/hooks.module.js";
import appStyleSheet from "file:///Users/dmail/Documents/dev/core/packages/related/cli/template-web-preact/src/app/app.css?as_css_module" ;
import { Counter } from "file:///Users/dmail/Documents/dev/core/packages/related/cli/template-web-preact/src/app/counter.jsx";
import { jsx as _jsx, jsxs as _jsxs } from "file:///Users/dmail/Documents/dev/core/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
const preactLogoUrl = new URL("file:///Users/dmail/Documents/dev/core/packages/related/cli/template-web-preact/src/preact_logo.svg", import.meta.url);
export const App = () => {
  useLayoutEffect(() => {
    document.adoptedStyleSheets = [...document.adoptedStyleSheets, appStyleSheet];
    return () => {
      document.adoptedStyleSheets = document.adoptedStyleSheets.filter(s => s !== appStyleSheet);
    };
  }, []);
  return _jsx("div", {
    className: "app",
    children: _jsxs("header", {
      className: "app_header",
      children: [_jsx("img", {
        src: preactLogoUrl,
        className: "app_logo",
        alt: "logo"
      }), _jsx("p", {
        children: "Hello jsenv + preact!"
      }), _jsx("p", {
        children: _jsx(Counter, {})
      }), _jsxs("p", {
        children: ["Edit", " ", _jsx("a", {
          className: "app_link"
          // eslint-disable-next-line no-script-url
          ,
          href: "javascript:window.fetch('/internal/open_file/app/app.jsx')",
          children: "app.jsx"
        }), " ", "and save to test HMR updates."]
      }), _jsx("p", {
        children: _jsx("a", {
          className: "app_link",
          href: "https://github.com/jsenv/core",
          target: "_blank",
          rel: "noopener noreferrer",
          children: "Jsenv documentation"
        })
      })]
    })
  });
};