frappe.pages["custom-ui"].on_page_load = async (wrapper) => {
	const page = frappe.ui.make_app_page({
		parent: wrapper,
		title: "Custom UI",
		single_column: true,
	});

	const $main = $(wrapper).find(".layout-main-section");
	$main.empty();

	const manifestUrl = "/assets/custom_ui/dist/.vite/manifest.json";
	const manifest = await (await fetch(manifestUrl)).json();

	const mainJs = `/assets/custom_ui/dist/${manifest["src/main.js"]["file"]}`;

	const script = document.createElement("script");
	script.type = "module";
	script.src = mainJs;
	document.body.appendChild(script);
};
