import { t as _sfc_main$1 } from "./SecondaryButton-ub85RH3e.js";
import { A as _sfc_main$6, M as _sfc_main$2, S as _sfc_main$3, f as _sfc_main$5, w as _sfc_main$4 } from "../ssr.js";
import { useForm } from "@inertiajs/vue3";
import { createTextVNode, toDisplayString, unref, useSSRContext, withCtx } from "vue";
import { ssrInterpolate, ssrRenderAttrs, ssrRenderComponent } from "vue/server-renderer";
//#region resources/js/Pages/Sma/Hr/Employee/Form.vue
var _sfc_main = {
	__name: "Form",
	__ssrInlineRender: true,
	props: [
		"current",
		"stores",
		"users"
	],
	emits: ["close", "done"],
	setup(__props, { emit: __emit }) {
		const props = __props;
		const form = useForm({
			_method: props.current?.id ? "put" : "post",
			user_id: props.current?.user_id || null,
			store_id: props.current?.store_id || null,
			department: props.current?.department || "",
			job_title: props.current?.job_title || "",
			hire_date: props.current?.hire_date || "",
			basic_salary: props.current?.basic_salary ?? 0,
			working_days_per_month: props.current?.working_days_per_month ?? 26,
			working_hours_per_day: props.current?.working_hours_per_day ?? 8,
			notes: props.current?.notes || ""
		});
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<form${ssrRenderAttrs(_attrs)}><div class="border-b border-gray-200 px-6 py-4 dark:border-gray-700"><div class="sm:flex sm:items-baseline sm:justify-between"><div class="sm:w-0 sm:flex-1"><h1 class="text-focus text-base font-semibold">${ssrInterpolate(__props.current?.id ? _ctx.$t("Edit {x}", { x: _ctx.$t("Employee") }) : _ctx.$t("Add {x}", { x: _ctx.$t("Employee") }))}</h1><p class="text-mute mt-1 truncate text-sm">${ssrInterpolate(_ctx.$t("Please fill the form below to {action} {record}.", {
				record: _ctx.$t("employee"),
				action: __props.current?.id ? _ctx.$t("edit") : _ctx.$t("add")
			}))}</p></div></div></div><div class="grid grid-cols-6 gap-6 p-6"><div class="col-span-6 sm:col-span-3">`);
			_push(ssrRenderComponent(unref(_sfc_main$2), {
				json: true,
				label: _ctx.$t("Store"),
				suggestions: __props.stores,
				modelValue: unref(form).store_id,
				"onUpdate:modelValue": ($event) => unref(form).store_id = $event,
				error: unref(form).errors.store_id,
				placeholder: _ctx.$t("Select store")
			}, null, _parent));
			_push(`</div><div class="col-span-6 sm:col-span-3">`);
			_push(ssrRenderComponent(unref(_sfc_main$2), {
				json: true,
				label: _ctx.$t("User"),
				suggestions: __props.users,
				modelValue: unref(form).user_id,
				"onUpdate:modelValue": ($event) => unref(form).user_id = $event,
				error: unref(form).errors.user_id,
				placeholder: _ctx.$t("Select employee user")
			}, null, _parent));
			_push(`</div><div class="col-span-6 sm:col-span-3">`);
			_push(ssrRenderComponent(unref(_sfc_main$3), {
				label: _ctx.$t("Department"),
				modelValue: unref(form).department,
				"onUpdate:modelValue": ($event) => unref(form).department = $event,
				error: unref(form).errors.department
			}, null, _parent));
			_push(`</div><div class="col-span-6 sm:col-span-3">`);
			_push(ssrRenderComponent(unref(_sfc_main$3), {
				label: _ctx.$t("Job Title"),
				modelValue: unref(form).job_title,
				"onUpdate:modelValue": ($event) => unref(form).job_title = $event,
				error: unref(form).errors.job_title
			}, null, _parent));
			_push(`</div><div class="col-span-6 sm:col-span-3">`);
			_push(ssrRenderComponent(unref(_sfc_main$4), {
				type: "date",
				label: _ctx.$t("Hire Date"),
				modelValue: unref(form).hire_date,
				"onUpdate:modelValue": ($event) => unref(form).hire_date = $event,
				error: unref(form).errors.hire_date
			}, null, _parent));
			_push(`</div><div class="col-span-6 sm:col-span-3">`);
			_push(ssrRenderComponent(unref(_sfc_main$3), {
				type: "number",
				label: _ctx.$t("Basic Salary"),
				modelValue: unref(form).basic_salary,
				"onUpdate:modelValue": ($event) => unref(form).basic_salary = $event,
				error: unref(form).errors.basic_salary
			}, null, _parent));
			_push(`</div><div class="col-span-6 sm:col-span-3">`);
			_push(ssrRenderComponent(unref(_sfc_main$3), {
				type: "number",
				required: true,
				label: _ctx.$t("Working Days/Month"),
				modelValue: unref(form).working_days_per_month,
				"onUpdate:modelValue": ($event) => unref(form).working_days_per_month = $event,
				error: unref(form).errors.working_days_per_month
			}, null, _parent));
			_push(`</div><div class="col-span-6 sm:col-span-3">`);
			_push(ssrRenderComponent(unref(_sfc_main$3), {
				type: "number",
				required: true,
				label: _ctx.$t("Working Hours/Day"),
				modelValue: unref(form).working_hours_per_day,
				"onUpdate:modelValue": ($event) => unref(form).working_hours_per_day = $event,
				error: unref(form).errors.working_hours_per_day
			}, null, _parent));
			_push(`</div><div class="col-span-6">`);
			_push(ssrRenderComponent(unref(_sfc_main$5), {
				rows: "2",
				label: _ctx.$t("Notes"),
				modelValue: unref(form).notes,
				"onUpdate:modelValue": ($event) => unref(form).notes = $event,
				error: unref(form).errors.notes
			}, null, _parent));
			_push(`</div></div><div class="flex flex-row justify-end bg-gray-100 px-6 py-4 text-end dark:bg-gray-950">`);
			_push(ssrRenderComponent(unref(_sfc_main$1), { onClick: ($event) => _ctx.$emit("close") }, {
				default: withCtx((_, _push, _parent, _scopeId) => {
					if (_push) _push(`${ssrInterpolate(_ctx.$t("Cancel"))}`);
					else return [createTextVNode(toDisplayString(_ctx.$t("Cancel")), 1)];
				}),
				_: 1
			}, _parent));
			_push(ssrRenderComponent(unref(_sfc_main$6), {
				class: "ms-3",
				loading: unref(form).processing
			}, {
				default: withCtx((_, _push, _parent, _scopeId) => {
					if (_push) _push(`${ssrInterpolate(_ctx.$t("Save"))}`);
					else return [createTextVNode(toDisplayString(_ctx.$t("Save")), 1)];
				}),
				_: 1
			}, _parent));
			_push(`</div></form>`);
		};
	}
};
var _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
	const ssrContext = useSSRContext();
	(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("resources/js/Pages/Sma/Hr/Employee/Form.vue");
	return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
//#endregion
export { _sfc_main as default };
