import { t as AdminLayout_default } from "./AdminLayout-CFTJa237.js";
import { Head, router, useForm } from "@inertiajs/vue3";
import { Fragment, computed, createBlock, createCommentVNode, createTextVNode, createVNode, defineComponent, openBlock, ref, renderList, resolveComponent, toDisplayString, unref, useSSRContext, vModelSelect, vModelText, watch, withCtx, withDirectives, withModifiers } from "vue";
import { ssrIncludeBooleanAttr, ssrInterpolate, ssrLooseContain, ssrLooseEqual, ssrRenderAttr, ssrRenderComponent, ssrRenderList } from "vue/server-renderer";
import { Calendar, Plus, Store, Trash, Trash2, User, X } from "lucide-vue-next";
//#region resources/js/Pages/CafePOS/Wastes/Index.vue?vue&type=script&setup=true&lang.ts
var Index_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
	__name: "Index",
	__ssrInlineRender: true,
	props: {
		wastes: {},
		outlets: {},
		ingredients: {},
		products: {},
		filters: {}
	},
	setup(__props) {
		const props = __props;
		const selectedOutletId = ref(props.filters.outlet_id || (props.outlets[0] ? String(props.outlets[0].id) : ""));
		watch(selectedOutletId, (newVal) => {
			router.get(route("wastes.index"), { outlet_id: newVal }, {
				preserveState: true,
				replace: true
			});
		});
		const isFormModalOpen = ref(false);
		const form = useForm({
			outlet_id: selectedOutletId.value ? Number(selectedOutletId.value) : 0,
			item_type: "Ingredient",
			item_id: "",
			qty: 0,
			notes: ""
		});
		const openCreateModal = () => {
			form.clearErrors();
			form.reset();
			form.outlet_id = selectedOutletId.value ? Number(selectedOutletId.value) : 0;
			isFormModalOpen.value = true;
		};
		const submitForm = () => {
			form.post(route("wastes.store"), { onSuccess: () => {
				isFormModalOpen.value = false;
				form.reset();
			} });
		};
		const deleteWaste = (waste) => {
			if (confirm("Apakah Anda yakin ingin menghapus catatan waste ini? Tindakan ini akan mengembalikan jumlah stok.")) router.delete(route("wastes.destroy", waste.id));
		};
		const activeItemsList = computed(() => {
			if (form.item_type === "Ingredient") return props.ingredients;
			return props.products;
		});
		const getItemUnit = (itemType, itemId) => {
			if (!itemId) return "";
			if (itemType === "Ingredient") return props.ingredients.find((i) => String(i.id) === itemId)?.unit || "";
			return "pcs";
		};
		return (_ctx, _push, _parent, _attrs) => {
			const _component_Link = resolveComponent("Link");
			_push(`<!--[-->`);
			_push(ssrRenderComponent(unref(Head), { title: "Waste Management (Stok Terbuang)" }, null, _parent));
			_push(ssrRenderComponent(AdminLayout_default, null, {
				default: withCtx((_, _push, _parent, _scopeId) => {
					if (_push) {
						_push(`<div class="space-y-6"${_scopeId}><div class="flex flex-col sm:flex-row sm:items-center justify-between gap-4"${_scopeId}><div${_scopeId}><h1 class="text-2xl font-extrabold text-slate-900 dark:text-slate-50 tracking-tight"${_scopeId}> Waste Management </h1><p class="text-sm text-slate-500 dark:text-slate-400 mt-1"${_scopeId}> Pencatatan barang yang kedaluwarsa, tumpah, atau rusak untuk pemantauan akurasi stok dan biaya terbuang. </p></div><button class="flex items-center justify-center gap-2 px-4 py-2 bg-[#8c5a3c] hover:bg-[#734a31] text-white text-sm font-bold rounded-xl transition-all cursor-pointer shadow-lg shadow-[#8c5a3c]/10"${_scopeId}>`);
						_push(ssrRenderComponent(unref(Plus), { class: "h-4 w-4" }, null, _parent, _scopeId));
						_push(` Catat Waste Baru </button></div><div class="flex flex-wrap items-center justify-between gap-4 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl px-5 py-4 shadow-sm"${_scopeId}><div class="flex items-center gap-3"${_scopeId}>`);
						_push(ssrRenderComponent(unref(Store), { class: "h-5 w-5 text-slate-400" }, null, _parent, _scopeId));
						_push(`<span class="text-xs font-bold text-slate-500 uppercase tracking-wide"${_scopeId}>Cabang Outlet:</span><select class="h-9 px-3 border border-slate-200 dark:border-slate-700 rounded-lg bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 text-slate-900 dark:text-slate-100 cursor-pointer"${_scopeId}><!--[-->`);
						ssrRenderList(__props.outlets, (ot) => {
							_push(`<option${ssrRenderAttr("value", String(ot.id))}${ssrIncludeBooleanAttr(Array.isArray(selectedOutletId.value) ? ssrLooseContain(selectedOutletId.value, String(ot.id)) : ssrLooseEqual(selectedOutletId.value, String(ot.id))) ? " selected" : ""}${_scopeId}>${ssrInterpolate(ot.name)}</option>`);
						});
						_push(`<!--]--></select></div></div>`);
						if (__props.wastes.data.length > 0) {
							_push(`<div class="bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-sm overflow-hidden"${_scopeId}><div class="overflow-x-auto"${_scopeId}><table class="w-full text-left border-collapse"${_scopeId}><thead${_scopeId}><tr class="border-b border-slate-100 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/50"${_scopeId}><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider"${_scopeId}>Item Wasted</th><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider"${_scopeId}>Tipe</th><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider text-right"${_scopeId}>Jumlah (Qty)</th><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider"${_scopeId}>Keterangan / Alasan</th><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider"${_scopeId}>Petugas</th><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider"${_scopeId}>Tanggal</th><th class="px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider text-right"${_scopeId}>Aksi</th></tr></thead><tbody class="divide-y divide-slate-100 dark:divide-slate-800"${_scopeId}><!--[-->`);
							ssrRenderList(__props.wastes.data, (w) => {
								_push(`<tr class="hover:bg-slate-50/30 dark:hover:bg-slate-800/10"${_scopeId}><td class="px-6 py-4"${_scopeId}><span class="font-extrabold text-xs text-slate-800 dark:text-slate-100"${_scopeId}>${ssrInterpolate(w.name)}</span></td><td class="px-6 py-4"${_scopeId}>`);
								if (w.item_type === "Ingredient") _push(`<span class="px-2 py-0.5 border border-[#8c5a3c]/20 bg-[#8c5a3c]/10 text-[#8c5a3c] rounded text-[9px] font-extrabold uppercase"${_scopeId}> Bahan Baku </span>`);
								else _push(`<span class="px-2 py-0.5 border border-indigo-500/20 bg-indigo-500/10 text-indigo-500 rounded text-[9px] font-extrabold uppercase"${_scopeId}> Retail </span>`);
								_push(`</td><td class="px-6 py-4 text-xs font-bold text-slate-700 dark:text-slate-300 text-right"${_scopeId}>${ssrInterpolate(w.qty)} ${ssrInterpolate(w.item_type === "Ingredient" ? "g/ml/pcs" : "pcs")}</td><td class="px-6 py-4 text-xs text-slate-500"${_scopeId}>${ssrInterpolate(w.notes || "-")}</td><td class="px-6 py-4 text-xs text-slate-655 dark:text-slate-350"${_scopeId}><div class="flex items-center gap-1.5"${_scopeId}>`);
								_push(ssrRenderComponent(unref(User), { class: "h-3.5 w-3.5 text-slate-400" }, null, _parent, _scopeId));
								_push(`<span${_scopeId}>${ssrInterpolate(w.user_name)}</span></div></td><td class="px-6 py-4 text-[11px] text-slate-400"${_scopeId}><div class="flex items-center gap-1.5"${_scopeId}>`);
								_push(ssrRenderComponent(unref(Calendar), { class: "h-3.5 w-3.5 text-slate-450" }, null, _parent, _scopeId));
								_push(`<span${_scopeId}>${ssrInterpolate(new Date(w.created_at).toLocaleString("id-ID", {
									dateStyle: "medium",
									timeStyle: "short"
								}))}</span></div></td><td class="px-6 py-4 text-right"${_scopeId}><button class="p-1.5 hover:bg-slate-100 dark:hover:bg-slate-800 text-slate-500 hover:text-rose-600 rounded-lg cursor-pointer"${_scopeId}>`);
								_push(ssrRenderComponent(unref(Trash2), { class: "h-3.5 w-3.5" }, null, _parent, _scopeId));
								_push(`</button></td></tr>`);
							});
							_push(`<!--]--></tbody></table></div>`);
							if (__props.wastes.last_page > 1) {
								_push(`<div class="px-6 py-4 border-t border-slate-105 dark:border-slate-800 flex items-center justify-between gap-4"${_scopeId}><span class="text-xs text-slate-500"${_scopeId}>Total ${ssrInterpolate(__props.wastes.total)} catatan waste</span><div class="flex items-center gap-2"${_scopeId}><!--[-->`);
								ssrRenderList(__props.wastes.links, (link) => {
									_push(ssrRenderComponent(_component_Link, {
										key: link.label,
										href: link.url || "#",
										class: [
											"px-3 py-1.5 border rounded-lg text-xs font-semibold cursor-pointer",
											link.active ? "bg-[#8c5a3c] text-white border-[#8c5a3c]" : "border-slate-200 dark:border-slate-800 hover:bg-slate-50 dark:hover:bg-slate-800 text-slate-700 dark:text-slate-350",
											!link.url ? "opacity-50 pointer-events-none" : ""
										]
									}, null, _parent, _scopeId));
								});
								_push(`<!--]--></div></div>`);
							} else _push(`<!---->`);
							_push(`</div>`);
						} else {
							_push(`<div class="text-center py-16 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-sm"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Trash), { class: "h-10 w-10 text-slate-350 dark:text-slate-655 mx-auto mb-3" }, null, _parent, _scopeId));
							_push(`<h3 class="text-sm font-bold text-slate-800 dark:text-slate-200"${_scopeId}>Belum ada catatan waste</h3><p class="text-xs text-slate-400 mt-1"${_scopeId}>Gunakan tombol di atas untuk mendaftarkan bahan terbuang baru.</p></div>`);
						}
						if (isFormModalOpen.value) {
							_push(`<div class="fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/60 backdrop-blur-sm"${_scopeId}><div class="bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl w-full max-w-md overflow-hidden transform transition-all"${_scopeId}><div class="px-6 py-4 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between"${_scopeId}><h3 class="text-sm font-extrabold text-slate-900 dark:text-slate-100"${_scopeId}> Catat Barang Wasted (Terbuang) </h3><button class="p-1.5 hover:bg-slate-100 dark:hover:bg-slate-900 rounded-lg text-slate-400 cursor-pointer"${_scopeId}>`);
							_push(ssrRenderComponent(unref(X), { class: "h-4 w-4" }, null, _parent, _scopeId));
							_push(`</button></div><form class="p-6 space-y-4"${_scopeId}><div${_scopeId}><label class="block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5"${_scopeId}>Cabang Outlet</label><select required class="w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c] cursor-pointer"${_scopeId}><!--[-->`);
							ssrRenderList(__props.outlets, (ot) => {
								_push(`<option${ssrRenderAttr("value", ot.id)}${ssrIncludeBooleanAttr(Array.isArray(unref(form).outlet_id) ? ssrLooseContain(unref(form).outlet_id, ot.id) : ssrLooseEqual(unref(form).outlet_id, ot.id)) ? " selected" : ""}${_scopeId}>${ssrInterpolate(ot.name)}</option>`);
							});
							_push(`<!--]--></select></div><div class="grid grid-cols-2 gap-4"${_scopeId}><div${_scopeId}><label class="block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5"${_scopeId}>Tipe Item</label><select required class="w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c] cursor-pointer"${_scopeId}><option value="Ingredient"${ssrIncludeBooleanAttr(Array.isArray(unref(form).item_type) ? ssrLooseContain(unref(form).item_type, "Ingredient") : ssrLooseEqual(unref(form).item_type, "Ingredient")) ? " selected" : ""}${_scopeId}>Bahan Baku</option><option value="Product"${ssrIncludeBooleanAttr(Array.isArray(unref(form).item_type) ? ssrLooseContain(unref(form).item_type, "Product") : ssrLooseEqual(unref(form).item_type, "Product")) ? " selected" : ""}${_scopeId}>Produk Retail</option></select></div><div${_scopeId}><label class="block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5"${_scopeId}>Jumlah Terbuang (Qty)</label><div class="relative flex items-center"${_scopeId}><input type="number" step="0.0001"${ssrRenderAttr("value", unref(form).qty)} required min="0.0001" class="w-full h-10 pl-3 pr-10 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c]"${_scopeId}><span class="absolute right-3 text-[10px] font-bold text-slate-400 uppercase"${_scopeId}>${ssrInterpolate(getItemUnit(unref(form).item_type, unref(form).item_id))}</span></div></div></div><div${_scopeId}><label class="block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5"${_scopeId}>Pilih Item</label><select required class="w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c] cursor-pointer"${_scopeId}><option value=""${ssrIncludeBooleanAttr(Array.isArray(unref(form).item_id) ? ssrLooseContain(unref(form).item_id, "") : ssrLooseEqual(unref(form).item_id, "")) ? " selected" : ""}${_scopeId}>Pilih barang...</option><!--[-->`);
							ssrRenderList(activeItemsList.value, (item) => {
								_push(`<option${ssrRenderAttr("value", String(item.id))}${ssrIncludeBooleanAttr(Array.isArray(unref(form).item_id) ? ssrLooseContain(unref(form).item_id, String(item.id)) : ssrLooseEqual(unref(form).item_id, String(item.id))) ? " selected" : ""}${_scopeId}>${ssrInterpolate(item.name)}</option>`);
							});
							_push(`<!--]--></select></div><div${_scopeId}><label class="block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5"${_scopeId}>Alasan / Catatan</label><textarea placeholder="Contoh: Expired 28 Juni, Tumpah di bar, Rusak saji..." rows="3" class="w-full p-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c]"${_scopeId}>${ssrInterpolate(unref(form).notes)}</textarea></div><div class="flex items-center justify-end gap-3 pt-4 border-t border-slate-100 dark:border-slate-800"${_scopeId}><button type="button" class="px-4 py-2 border border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-350 text-xs font-bold rounded-xl hover:bg-slate-50 dark:hover:bg-slate-800 cursor-pointer"${_scopeId}> Batal </button><button type="submit"${ssrIncludeBooleanAttr(unref(form).processing) ? " disabled" : ""} class="px-4 py-2 bg-[#8c5a3c] hover:bg-[#734a31] text-white text-xs font-bold rounded-xl cursor-pointer disabled:opacity-50"${_scopeId}>${ssrInterpolate(unref(form).processing ? "Menyimpan..." : "Simpan")}</button></div></form></div></div>`);
						} else _push(`<!---->`);
						_push(`</div>`);
					} else return [createVNode("div", { class: "space-y-6" }, [
						createVNode("div", { class: "flex flex-col sm:flex-row sm:items-center justify-between gap-4" }, [createVNode("div", null, [createVNode("h1", { class: "text-2xl font-extrabold text-slate-900 dark:text-slate-50 tracking-tight" }, " Waste Management "), createVNode("p", { class: "text-sm text-slate-500 dark:text-slate-400 mt-1" }, " Pencatatan barang yang kedaluwarsa, tumpah, atau rusak untuk pemantauan akurasi stok dan biaya terbuang. ")]), createVNode("button", {
							onClick: openCreateModal,
							class: "flex items-center justify-center gap-2 px-4 py-2 bg-[#8c5a3c] hover:bg-[#734a31] text-white text-sm font-bold rounded-xl transition-all cursor-pointer shadow-lg shadow-[#8c5a3c]/10"
						}, [createVNode(unref(Plus), { class: "h-4 w-4" }), createTextVNode(" Catat Waste Baru ")])]),
						createVNode("div", { class: "flex flex-wrap items-center justify-between gap-4 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl px-5 py-4 shadow-sm" }, [createVNode("div", { class: "flex items-center gap-3" }, [
							createVNode(unref(Store), { class: "h-5 w-5 text-slate-400" }),
							createVNode("span", { class: "text-xs font-bold text-slate-500 uppercase tracking-wide" }, "Cabang Outlet:"),
							withDirectives(createVNode("select", {
								"onUpdate:modelValue": ($event) => selectedOutletId.value = $event,
								class: "h-9 px-3 border border-slate-200 dark:border-slate-700 rounded-lg bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 text-slate-900 dark:text-slate-100 cursor-pointer"
							}, [(openBlock(true), createBlock(Fragment, null, renderList(__props.outlets, (ot) => {
								return openBlock(), createBlock("option", {
									key: ot.id,
									value: String(ot.id)
								}, toDisplayString(ot.name), 9, ["value"]);
							}), 128))], 8, ["onUpdate:modelValue"]), [[vModelSelect, selectedOutletId.value]])
						])]),
						__props.wastes.data.length > 0 ? (openBlock(), createBlock("div", {
							key: 0,
							class: "bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-sm overflow-hidden"
						}, [createVNode("div", { class: "overflow-x-auto" }, [createVNode("table", { class: "w-full text-left border-collapse" }, [createVNode("thead", null, [createVNode("tr", { class: "border-b border-slate-100 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/50" }, [
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider" }, "Item Wasted"),
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider" }, "Tipe"),
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider text-right" }, "Jumlah (Qty)"),
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider" }, "Keterangan / Alasan"),
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider" }, "Petugas"),
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider" }, "Tanggal"),
							createVNode("th", { class: "px-6 py-3.5 text-[11px] font-bold text-slate-400 uppercase tracking-wider text-right" }, "Aksi")
						])]), createVNode("tbody", { class: "divide-y divide-slate-100 dark:divide-slate-800" }, [(openBlock(true), createBlock(Fragment, null, renderList(__props.wastes.data, (w) => {
							return openBlock(), createBlock("tr", {
								key: w.id,
								class: "hover:bg-slate-50/30 dark:hover:bg-slate-800/10"
							}, [
								createVNode("td", { class: "px-6 py-4" }, [createVNode("span", { class: "font-extrabold text-xs text-slate-800 dark:text-slate-100" }, toDisplayString(w.name), 1)]),
								createVNode("td", { class: "px-6 py-4" }, [w.item_type === "Ingredient" ? (openBlock(), createBlock("span", {
									key: 0,
									class: "px-2 py-0.5 border border-[#8c5a3c]/20 bg-[#8c5a3c]/10 text-[#8c5a3c] rounded text-[9px] font-extrabold uppercase"
								}, " Bahan Baku ")) : (openBlock(), createBlock("span", {
									key: 1,
									class: "px-2 py-0.5 border border-indigo-500/20 bg-indigo-500/10 text-indigo-500 rounded text-[9px] font-extrabold uppercase"
								}, " Retail "))]),
								createVNode("td", { class: "px-6 py-4 text-xs font-bold text-slate-700 dark:text-slate-300 text-right" }, toDisplayString(w.qty) + " " + toDisplayString(w.item_type === "Ingredient" ? "g/ml/pcs" : "pcs"), 1),
								createVNode("td", { class: "px-6 py-4 text-xs text-slate-500" }, toDisplayString(w.notes || "-"), 1),
								createVNode("td", { class: "px-6 py-4 text-xs text-slate-655 dark:text-slate-350" }, [createVNode("div", { class: "flex items-center gap-1.5" }, [createVNode(unref(User), { class: "h-3.5 w-3.5 text-slate-400" }), createVNode("span", null, toDisplayString(w.user_name), 1)])]),
								createVNode("td", { class: "px-6 py-4 text-[11px] text-slate-400" }, [createVNode("div", { class: "flex items-center gap-1.5" }, [createVNode(unref(Calendar), { class: "h-3.5 w-3.5 text-slate-450" }), createVNode("span", null, toDisplayString(new Date(w.created_at).toLocaleString("id-ID", {
									dateStyle: "medium",
									timeStyle: "short"
								})), 1)])]),
								createVNode("td", { class: "px-6 py-4 text-right" }, [createVNode("button", {
									onClick: ($event) => deleteWaste(w),
									class: "p-1.5 hover:bg-slate-100 dark:hover:bg-slate-800 text-slate-500 hover:text-rose-600 rounded-lg cursor-pointer"
								}, [createVNode(unref(Trash2), { class: "h-3.5 w-3.5" })], 8, ["onClick"])])
							]);
						}), 128))])])]), __props.wastes.last_page > 1 ? (openBlock(), createBlock("div", {
							key: 0,
							class: "px-6 py-4 border-t border-slate-105 dark:border-slate-800 flex items-center justify-between gap-4"
						}, [createVNode("span", { class: "text-xs text-slate-500" }, "Total " + toDisplayString(__props.wastes.total) + " catatan waste", 1), createVNode("div", { class: "flex items-center gap-2" }, [(openBlock(true), createBlock(Fragment, null, renderList(__props.wastes.links, (link) => {
							return openBlock(), createBlock(_component_Link, {
								key: link.label,
								href: link.url || "#",
								class: [
									"px-3 py-1.5 border rounded-lg text-xs font-semibold cursor-pointer",
									link.active ? "bg-[#8c5a3c] text-white border-[#8c5a3c]" : "border-slate-200 dark:border-slate-800 hover:bg-slate-50 dark:hover:bg-slate-800 text-slate-700 dark:text-slate-350",
									!link.url ? "opacity-50 pointer-events-none" : ""
								],
								innerHTML: link.label
							}, null, 8, [
								"href",
								"class",
								"innerHTML"
							]);
						}), 128))])])) : createCommentVNode("", true)])) : (openBlock(), createBlock("div", {
							key: 1,
							class: "text-center py-16 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-sm"
						}, [
							createVNode(unref(Trash), { class: "h-10 w-10 text-slate-350 dark:text-slate-655 mx-auto mb-3" }),
							createVNode("h3", { class: "text-sm font-bold text-slate-800 dark:text-slate-200" }, "Belum ada catatan waste"),
							createVNode("p", { class: "text-xs text-slate-400 mt-1" }, "Gunakan tombol di atas untuk mendaftarkan bahan terbuang baru.")
						])),
						isFormModalOpen.value ? (openBlock(), createBlock("div", {
							key: 2,
							class: "fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/60 backdrop-blur-sm"
						}, [createVNode("div", { class: "bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl w-full max-w-md overflow-hidden transform transition-all" }, [createVNode("div", { class: "px-6 py-4 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between" }, [createVNode("h3", { class: "text-sm font-extrabold text-slate-900 dark:text-slate-100" }, " Catat Barang Wasted (Terbuang) "), createVNode("button", {
							onClick: ($event) => isFormModalOpen.value = false,
							class: "p-1.5 hover:bg-slate-100 dark:hover:bg-slate-900 rounded-lg text-slate-400 cursor-pointer"
						}, [createVNode(unref(X), { class: "h-4 w-4" })], 8, ["onClick"])]), createVNode("form", {
							onSubmit: withModifiers(submitForm, ["prevent"]),
							class: "p-6 space-y-4"
						}, [
							createVNode("div", null, [createVNode("label", { class: "block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5" }, "Cabang Outlet"), withDirectives(createVNode("select", {
								"onUpdate:modelValue": ($event) => unref(form).outlet_id = $event,
								required: "",
								class: "w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c] cursor-pointer"
							}, [(openBlock(true), createBlock(Fragment, null, renderList(__props.outlets, (ot) => {
								return openBlock(), createBlock("option", {
									key: ot.id,
									value: ot.id
								}, toDisplayString(ot.name), 9, ["value"]);
							}), 128))], 8, ["onUpdate:modelValue"]), [[vModelSelect, unref(form).outlet_id]])]),
							createVNode("div", { class: "grid grid-cols-2 gap-4" }, [createVNode("div", null, [createVNode("label", { class: "block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5" }, "Tipe Item"), withDirectives(createVNode("select", {
								"onUpdate:modelValue": ($event) => unref(form).item_type = $event,
								required: "",
								class: "w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c] cursor-pointer"
							}, [createVNode("option", { value: "Ingredient" }, "Bahan Baku"), createVNode("option", { value: "Product" }, "Produk Retail")], 8, ["onUpdate:modelValue"]), [[vModelSelect, unref(form).item_type]])]), createVNode("div", null, [createVNode("label", { class: "block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5" }, "Jumlah Terbuang (Qty)"), createVNode("div", { class: "relative flex items-center" }, [withDirectives(createVNode("input", {
								type: "number",
								step: "0.0001",
								"onUpdate:modelValue": ($event) => unref(form).qty = $event,
								required: "",
								min: "0.0001",
								class: "w-full h-10 pl-3 pr-10 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c]"
							}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(form).qty]]), createVNode("span", { class: "absolute right-3 text-[10px] font-bold text-slate-400 uppercase" }, toDisplayString(getItemUnit(unref(form).item_type, unref(form).item_id)), 1)])])]),
							createVNode("div", null, [createVNode("label", { class: "block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5" }, "Pilih Item"), withDirectives(createVNode("select", {
								"onUpdate:modelValue": ($event) => unref(form).item_id = $event,
								required: "",
								class: "w-full h-10 px-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c] cursor-pointer"
							}, [createVNode("option", { value: "" }, "Pilih barang..."), (openBlock(true), createBlock(Fragment, null, renderList(activeItemsList.value, (item) => {
								return openBlock(), createBlock("option", {
									key: item.id,
									value: String(item.id)
								}, toDisplayString(item.name), 9, ["value"]);
							}), 128))], 8, ["onUpdate:modelValue"]), [[vModelSelect, unref(form).item_id]])]),
							createVNode("div", null, [createVNode("label", { class: "block text-[11px] font-bold text-slate-450 dark:text-slate-500 uppercase tracking-wider mb-1.5" }, "Alasan / Catatan"), withDirectives(createVNode("textarea", {
								"onUpdate:modelValue": ($event) => unref(form).notes = $event,
								placeholder: "Contoh: Expired 28 Juni, Tumpah di bar, Rusak saji...",
								rows: "3",
								class: "w-full p-3 border border-slate-200 dark:border-slate-700 rounded-xl bg-slate-50 dark:bg-slate-800 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-[#8c5a3c]/20 focus:border-[#8c5a3c]"
							}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(form).notes]])]),
							createVNode("div", { class: "flex items-center justify-end gap-3 pt-4 border-t border-slate-100 dark:border-slate-800" }, [createVNode("button", {
								type: "button",
								onClick: ($event) => isFormModalOpen.value = false,
								class: "px-4 py-2 border border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-350 text-xs font-bold rounded-xl hover:bg-slate-50 dark:hover:bg-slate-800 cursor-pointer"
							}, " Batal ", 8, ["onClick"]), createVNode("button", {
								type: "submit",
								disabled: unref(form).processing,
								class: "px-4 py-2 bg-[#8c5a3c] hover:bg-[#734a31] text-white text-xs font-bold rounded-xl cursor-pointer disabled:opacity-50"
							}, toDisplayString(unref(form).processing ? "Menyimpan..." : "Simpan"), 9, ["disabled"])])
						], 32)])])) : createCommentVNode("", true)
					])];
				}),
				_: 1
			}, _parent));
			_push(`<!--]-->`);
		};
	}
});
//#endregion
//#region resources/js/Pages/CafePOS/Wastes/Index.vue
var _sfc_setup = Index_vue_vue_type_script_setup_true_lang_default.setup;
Index_vue_vue_type_script_setup_true_lang_default.setup = (props, ctx) => {
	const ssrContext = useSSRContext();
	(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("resources/js/Pages/CafePOS/Wastes/Index.vue");
	return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
var Index_default = Index_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { Index_default as default };
