import { a as usePage, i as useForm, l as __exportAll, o as vue_exports } from "../ssr.js";
import { n as server_renderer_exports, t } from "./i18n-CXLOYfyq.js";
//#region resources/js/Pages/Profile/Partials/NotificationPreferencesForm.vue?vue&type=script&setup=true&lang.ts
var NotificationPreferencesForm_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue_exports.defineComponent)({
	__name: "NotificationPreferencesForm",
	__ssrInlineRender: true,
	setup(__props) {
		const initial = usePage().props.notificationPrefs ?? {};
		const TYPES = [
			{
				key: "reply",
				label: t("Replies to your topics & posts")
			},
			{
				key: "mention",
				label: t("Mentions (@you)")
			},
			{
				key: "message",
				label: t("Direct messages")
			},
			{
				key: "reaction",
				label: t("Reactions to your posts")
			},
			{
				key: "wall",
				label: t("Posts on your profile")
			},
			{
				key: "badge",
				label: t("Badges you earn")
			},
			{
				key: "event",
				label: t("Event reminders")
			}
		];
		const seed = {};
		for (const row of TYPES) seed[row.key] = {
			email: !!initial[row.key]?.email,
			push: initial[row.key]?.push ?? true
		};
		const form = useForm({ prefs: seed });
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<section${(0, server_renderer_exports.ssrRenderAttrs)(_attrs)}><header><h2 class="text-lg font-medium text-ink">${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Notifications"))}</h2><p class="mt-1 text-sm text-ink-2">${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Choose what you get notified about, and how. In-app alerts (the bell) are always on."))}</p></header><form class="mt-6"><div class="grid grid-cols-[1fr_4rem_4rem] items-center gap-y-3"><span></span><span class="text-center text-xs font-semibold uppercase tracking-wide text-ink-muted">${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Email"))}</span><span class="text-center text-xs font-semibold uppercase tracking-wide text-ink-muted">${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Push"))}</span><!--[-->`);
			(0, server_renderer_exports.ssrRenderList)(TYPES, (row) => {
				_push(`<!--[--><span class="border-t border-line py-2.5 text-sm text-ink-2">${(0, server_renderer_exports.ssrInterpolate)(row.label)}</span><label class="flex justify-center border-t border-line py-2.5"><input${(0, server_renderer_exports.ssrIncludeBooleanAttr)(Array.isArray((0, vue_exports.unref)(form).prefs[row.key].email) ? (0, server_renderer_exports.ssrLooseContain)((0, vue_exports.unref)(form).prefs[row.key].email, null) : (0, vue_exports.unref)(form).prefs[row.key].email) ? " checked" : ""} type="checkbox" class="h-4 w-4 rounded border-line bg-appbg text-primary focus:ring-primary"></label><label class="flex justify-center border-t border-line py-2.5"><input${(0, server_renderer_exports.ssrIncludeBooleanAttr)(Array.isArray((0, vue_exports.unref)(form).prefs[row.key].push) ? (0, server_renderer_exports.ssrLooseContain)((0, vue_exports.unref)(form).prefs[row.key].push, null) : (0, vue_exports.unref)(form).prefs[row.key].push) ? " checked" : ""} type="checkbox" class="h-4 w-4 rounded border-line bg-appbg text-primary focus:ring-primary"></label><!--]-->`);
			});
			_push(`<!--]--></div><div class="mt-5 flex items-center gap-3"><button type="submit"${(0, server_renderer_exports.ssrIncludeBooleanAttr)((0, vue_exports.unref)(form).processing) ? " disabled" : ""} class="rounded-lg bg-primary px-4 py-2 text-sm font-semibold text-white hover:bg-primary-600 disabled:opacity-60">${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Save preferences"))}</button>`);
			if ((0, vue_exports.unref)(form).recentlySuccessful) _push(`<span class="text-sm text-emerald-500">${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Saved."))}</span>`);
			else _push(`<!---->`);
			_push(`</div></form></section>`);
		};
	}
});
//#endregion
//#region resources/js/Pages/Profile/Partials/NotificationPreferencesForm.vue
var NotificationPreferencesForm_exports = /* @__PURE__ */ __exportAll({ default: () => NotificationPreferencesForm_default });
var _sfc_setup = NotificationPreferencesForm_vue_vue_type_script_setup_true_lang_default.setup;
NotificationPreferencesForm_vue_vue_type_script_setup_true_lang_default.setup = (props, ctx) => {
	const ssrContext = (0, vue_exports.useSSRContext)();
	(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("resources/js/Pages/Profile/Partials/NotificationPreferencesForm.vue");
	return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
var NotificationPreferencesForm_default = NotificationPreferencesForm_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { NotificationPreferencesForm_exports as n, NotificationPreferencesForm_default as t };
