globalThis.process ??= {};
globalThis.process.env ??= {};
import { r as __exportAll } from "./rolldown-runtime_-UtK6b3T.mjs";
import { d as renderTemplate, f as maybeRenderHead, i as renderComponent, m as addAttribute, w as createAstro } from "./server_DAChoow1.mjs";
import { t as createComponent } from "./compiler_CLrjY88v.mjs";
import { h as issueRenderToken } from "./db_DZJ1iBSP.mjs";
import { c as Field, h as require_jsx_runtime, o as Textarea, s as Input } from "./registry_DRVlp37W.mjs";
import { t as $$Base } from "./Base_v-SXQCuU.mjs";
import { i as renderSecret, t as CONTACT_FORM } from "./forms_B0iuHQPP.mjs";
import { r as parseContactFlash, t as contactFlashClearHeader } from "./contact-flash_Cpum3OBD.mjs";
import { env } from "cloudflare:workers";
//#region src/components/islands/ContactFormFields.tsx
var import_jsx_runtime = require_jsx_runtime();
function ContactFormFields({ initialValues = {}, errors = [] }) {
	const errorsByField = new Map(errors.map((e) => [e.field, e.message]));
	return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
		/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
			label: "Name",
			htmlFor: "contact-name",
			required: true,
			error: errorsByField.get("name"),
			children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
				id: "contact-name",
				name: "name",
				type: "text",
				required: true,
				minLength: 1,
				maxLength: 120,
				defaultValue: initialValues.name ?? ""
			})
		}),
		/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
			label: "Email",
			htmlFor: "contact-email",
			required: true,
			error: errorsByField.get("email"),
			children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
				id: "contact-email",
				name: "email",
				type: "email",
				required: true,
				maxLength: 254,
				defaultValue: initialValues.email ?? ""
			})
		}),
		/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
			label: "Message",
			htmlFor: "contact-message",
			required: true,
			error: errorsByField.get("message"),
			children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Textarea, {
				id: "contact-message",
				name: "message",
				rows: 6,
				required: true,
				minLength: 1,
				maxLength: 5e3,
				defaultValue: initialValues.message ?? ""
			})
		})
	] });
}
//#endregion
//#region src/pages/contact.astro
var contact_exports = /* @__PURE__ */ __exportAll({
	default: () => $$Contact,
	file: () => $$file,
	prerender: () => false,
	url: () => $$url
});
createAstro("https://astro.build");
var $$Contact = createComponent(async ($$result, $$props, $$slots) => {
	const Astro = $$result.createAstro($$props, $$slots);
	Astro.self = $$Contact;
	const sent = Astro.url.searchParams.get("sent") === "1";
	const flash = parseContactFlash(Astro.request.headers.get("cookie"));
	if (flash) Astro.response.headers.set("Set-Cookie", contactFlashClearHeader());
	const renderToken = await issueRenderToken(renderSecret(env), Date.now());
	const honeypot = CONTACT_FORM.antispam?.honeypot ?? "website";
	return renderTemplate`${renderComponent($$result, "Base", $$Base, {
		"title": "Contact",
		"description": "Send a message to the site team",
		"data-astro-cid-6bfsojfh": true
	}, { "default": ($$result) => renderTemplate`${maybeRenderHead($$result)}<section class="contact-section" aria-labelledby="contact-heading" data-astro-cid-6bfsojfh><div class="contact-grid" data-astro-cid-6bfsojfh><div class="contact-grid__main" data-astro-cid-6bfsojfh><h1 id="contact-heading" class="contact-heading" data-astro-cid-6bfsojfh>Contact</h1><p class="contact-lead" data-astro-cid-6bfsojfh>Send a message and we will reply by email.</p>${sent ? renderTemplate`<div class="contact-success" role="status" data-astro-cid-6bfsojfh><p data-astro-cid-6bfsojfh>Your message was sent.</p></div>` : renderTemplate`<form class="contact-form" method="post" action="/api/contact" data-astro-cid-6bfsojfh><input type="hidden" name="render_token"${addAttribute(renderToken, "value")} data-astro-cid-6bfsojfh><div class="contact-form__hp" aria-hidden="true" data-astro-cid-6bfsojfh><label for="website" data-astro-cid-6bfsojfh>Website</label><input id="website"${addAttribute(honeypot, "name")} type="text" tabindex="-1" autocomplete="off" data-astro-cid-6bfsojfh></div>${renderComponent($$result, "ContactFormFields", ContactFormFields, {
		"client:load": true,
		"initialValues": flash?.values,
		"errors": flash?.errors,
		"data-astro-cid-6bfsojfh": true,
		"client:component-hydration": "load",
		"client:component-path": "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/components/islands/ContactFormFields.tsx",
		"client:component-export": "default"
	})}<button type="submit" class="action action--primary" data-astro-cid-6bfsojfh>Send message</button></form>`}</div></div></section>` })}`;
}, "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/pages/contact.astro", void 0);
var $$file = "/home/user/runs/run-20260823T161930Z-rcdg0v/repo/apps/mod-cms/src/pages/contact.astro";
var $$url = "/contact";
//#endregion
//#region \0virtual:astro:page:src/pages/contact@_@astro
var page = () => contact_exports;
//#endregion
export { page };
