import { a as usePage, i as useForm, l as __exportAll, o as vue_exports, r as link_default } from "../ssr.js";
import { n as server_renderer_exports, t } from "./i18n-CXLOYfyq.js";
import { t as toast } from "./toast-DMXj7c3P.js";
import { n as InputError_default, t as TextInput_default } from "./TextInput-PH9DZeo0.js";
import { t as InputLabel_default } from "./InputLabel-snijZdaZ.js";
//#region resources/js/Pages/Profile/Partials/UpdateProfileInformationForm.vue?vue&type=script&setup=true&lang.ts
var UpdateProfileInformationForm_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue_exports.defineComponent)({
	__name: "UpdateProfileInformationForm",
	__ssrInlineRender: true,
	props: {
		mustVerifyEmail: {},
		status: {}
	},
	setup(__props) {
		const user = usePage().props.auth.user;
		const form = useForm({
			name: user.name,
			email: user.email
		});
		let timer = null;
		(0, vue_exports.watch)(() => [form.name, form.email], () => {
			if (timer) clearTimeout(timer);
			timer = setTimeout(() => {
				form.patch(route("profile.update"), {
					preserveScroll: true,
					onSuccess: () => toast(t("Profile saved"))
				});
			}, 800);
		});
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<section${(0, server_renderer_exports.ssrRenderAttrs)(_attrs)}><header><h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Profile Information"))}</h2><p class="mt-1 text-sm text-gray-600 dark:text-gray-400">${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Update your account's profile information and email address."))}</p></header><form class="mt-6 space-y-6"><div>`);
			_push((0, server_renderer_exports.ssrRenderComponent)(InputLabel_default, {
				for: "name",
				value: (0, vue_exports.unref)(t)("Name")
			}, null, _parent));
			_push((0, server_renderer_exports.ssrRenderComponent)(TextInput_default, {
				id: "name",
				type: "text",
				class: "mt-1 block w-full",
				modelValue: (0, vue_exports.unref)(form).name,
				"onUpdate:modelValue": ($event) => (0, vue_exports.unref)(form).name = $event,
				required: "",
				autofocus: "",
				autocomplete: "name"
			}, null, _parent));
			_push((0, server_renderer_exports.ssrRenderComponent)(InputError_default, {
				class: "mt-2",
				message: (0, vue_exports.unref)(form).errors.name
			}, null, _parent));
			_push(`</div><div>`);
			_push((0, server_renderer_exports.ssrRenderComponent)(InputLabel_default, {
				for: "email",
				value: (0, vue_exports.unref)(t)("Email")
			}, null, _parent));
			_push((0, server_renderer_exports.ssrRenderComponent)(TextInput_default, {
				id: "email",
				type: "email",
				class: "mt-1 block w-full",
				modelValue: (0, vue_exports.unref)(form).email,
				"onUpdate:modelValue": ($event) => (0, vue_exports.unref)(form).email = $event,
				required: "",
				autocomplete: "username"
			}, null, _parent));
			_push((0, server_renderer_exports.ssrRenderComponent)(InputError_default, {
				class: "mt-2",
				message: (0, vue_exports.unref)(form).errors.email
			}, null, _parent));
			_push(`</div>`);
			if (__props.mustVerifyEmail && (0, vue_exports.unref)(user).email_verified_at === null) {
				_push(`<div><p class="mt-2 text-sm text-gray-800 dark:text-gray-200">${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Your email address is unverified."))} `);
				_push((0, server_renderer_exports.ssrRenderComponent)((0, vue_exports.unref)(link_default), {
					href: _ctx.route("verification.send"),
					method: "post",
					as: "button",
					class: "rounded-md text-sm text-gray-600 underline hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 dark:text-gray-400 dark:hover:text-gray-100 dark:focus:ring-offset-gray-800"
				}, {
					default: (0, vue_exports.withCtx)((_, _push, _parent, _scopeId) => {
						if (_push) _push(`${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Click here to re-send the verification email."))}`);
						else return [(0, vue_exports.createTextVNode)((0, vue_exports.toDisplayString)((0, vue_exports.unref)(t)("Click here to re-send the verification email.")), 1)];
					}),
					_: 1
				}, _parent));
				_push(`</p><div class="mt-2 text-sm font-medium text-green-600 dark:text-green-400" style="${(0, server_renderer_exports.ssrRenderStyle)(__props.status === "verification-link-sent" ? null : { display: "none" })}">${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("A new verification link has been sent to your email address."))}</div></div>`);
			} else _push(`<!---->`);
			_push(`<p class="text-sm text-gray-500 dark:text-gray-400">`);
			if ((0, vue_exports.unref)(form).processing) _push(`<span>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Saving…"))}</span>`);
			else _push(`<span>${(0, server_renderer_exports.ssrInterpolate)((0, vue_exports.unref)(t)("Changes save automatically."))}</span>`);
			_push(`</p></form></section>`);
		};
	}
});
//#endregion
//#region resources/js/Pages/Profile/Partials/UpdateProfileInformationForm.vue
var UpdateProfileInformationForm_exports = /* @__PURE__ */ __exportAll({ default: () => UpdateProfileInformationForm_default });
var _sfc_setup = UpdateProfileInformationForm_vue_vue_type_script_setup_true_lang_default.setup;
UpdateProfileInformationForm_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/UpdateProfileInformationForm.vue");
	return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
var UpdateProfileInformationForm_default = UpdateProfileInformationForm_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { UpdateProfileInformationForm_exports as n, UpdateProfileInformationForm_default as t };
