import { t as AdminLayout_default } from "./AdminLayout-DcKfAlG1.js";
import { Head, Link, router, useForm } from "@inertiajs/vue3";
import { Fragment, createBlock, createCommentVNode, createTextVNode, createVNode, defineComponent, openBlock, ref, renderList, toDisplayString, unref, useSSRContext, vModelSelect, vModelText, watch, withCtx, withDirectives, withModifiers } from "vue";
import { ssrIncludeBooleanAttr, ssrInterpolate, ssrLooseContain, ssrLooseEqual, ssrRenderAttr, ssrRenderClass, ssrRenderComponent, ssrRenderList } from "vue/server-renderer";
import { AlertCircle, Edit2, History, Package, Plus, PlusCircle, Scale, Search, Trash2, X } from "lucide-vue-next";
//#region resources/js/Pages/CafePOS/Ingredients/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: {
		ingredients: {},
		outlets: {},
		suppliers: {},
		history: {},
		filters: {}
	},
	setup(__props) {
		const props = __props;
		const search = ref(props.filters.search || "");
		let timeoutId = null;
		watch(search, () => {
			if (timeoutId) clearTimeout(timeoutId);
			timeoutId = setTimeout(() => {
				router.get(route("ingredients.index"), { search: search.value }, {
					preserveState: true,
					replace: true
				});
			}, 400);
		});
		const activeTab = ref(typeof window !== "undefined" && new URLSearchParams(window.location.search).has("history_page") ? "history" : "ingredients");
		const isFormModalOpen = ref(false);
		const isDeleteModalOpen = ref(false);
		const isAdjustModalOpen = ref(false);
		const isDeleteTransactionModalOpen = ref(false);
		const editingIngredient = ref(null);
		const ingredientToDelete = ref(null);
		const transactionToDelete = ref(null);
		const form = useForm({
			name: "",
			unit: ""
		});
		const adjustForm = useForm({
			outlet_id: "",
			ingredient_id: "",
			stock_qty: 0,
			threshold_qty: 0,
			action_type: "add",
			supplier_id: "",
			notes: ""
		});
		const openCreateModal = () => {
			editingIngredient.value = null;
			form.clearErrors();
			form.reset();
			isFormModalOpen.value = true;
		};
		const openEditModal = (ing) => {
			editingIngredient.value = ing;
			form.clearErrors();
			form.name = ing.name;
			form.unit = ing.unit;
			isFormModalOpen.value = true;
		};
		const submitForm = () => {
			if (editingIngredient.value) form.put(route("ingredients.update", editingIngredient.value.id), { onSuccess: () => {
				isFormModalOpen.value = false;
				form.reset();
			} });
			else form.post(route("ingredients.store"), { onSuccess: () => {
				isFormModalOpen.value = false;
				form.reset();
			} });
		};
		const openDeleteModal = (ing) => {
			ingredientToDelete.value = ing;
			isDeleteModalOpen.value = true;
		};
		const deleteIngredient = () => {
			if (!ingredientToDelete.value) return;
			router.delete(route("ingredients.destroy", ingredientToDelete.value.id), { onSuccess: () => {
				isDeleteModalOpen.value = false;
				ingredientToDelete.value = null;
			} });
		};
		const openDeleteTransactionModal = (item) => {
			transactionToDelete.value = item;
			isDeleteTransactionModalOpen.value = true;
		};
		const deleteTransaction = () => {
			if (!transactionToDelete.value) return;
			router.delete(route("ingredients.transactions.destroy", transactionToDelete.value.id), { onSuccess: () => {
				isDeleteTransactionModalOpen.value = false;
				transactionToDelete.value = null;
			} });
		};
		const openAdjustModal = (ing, outletStock) => {
			adjustForm.clearErrors();
			adjustForm.ingredient_id = String(ing.id);
			adjustForm.supplier_id = outletStock && outletStock.last_supplier_id ? String(outletStock.last_supplier_id) : "";
			adjustForm.notes = "";
			if (outletStock) {
				adjustForm.outlet_id = String(outletStock.outlet_id);
				adjustForm.stock_qty = 0;
				adjustForm.threshold_qty = Number(outletStock.threshold_qty);
				adjustForm.action_type = "add";
			} else {
				adjustForm.outlet_id = props.outlets[0] ? String(props.outlets[0].id) : "";
				adjustForm.stock_qty = 0;
				adjustForm.threshold_qty = 0;
				adjustForm.action_type = "add";
			}
			isAdjustModalOpen.value = true;
		};
		const submitAdjustForm = () => {
			adjustForm.post(route("ingredients.adjust"), { onSuccess: () => {
				isAdjustModalOpen.value = false;
				adjustForm.reset();
			} });
		};
		const getIngredientName = (id) => {
			const ing = props.ingredients.data.find((i) => i.id === Number(id));
			return ing ? ing.name : "Ingredient";
		};
		const isLowStock = (stock, threshold) => {
			return Number(stock) <= Number(threshold);
		};
		const formatDateTime = (dateStr) => {
			return new Date(dateStr).toLocaleString("id-ID", {
				dateStyle: "medium",
				timeStyle: "short"
			});
		};
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<!--[-->`);
			_push(ssrRenderComponent(unref(Head), { title: "Stock Inventory" }, 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 gap-4 md:flex-row md:items-center md:justify-between"${_scopeId}><div${_scopeId}><h1 class="text-2xl font-bold tracking-tight text-slate-900 dark:text-slate-50"${_scopeId}>Stock Inventory</h1><p class="text-sm text-slate-500 dark:text-slate-400 mt-1"${_scopeId}> Manage raw coffee beans, milk, syrups, cups, and track their stock levels across all outlets. </p></div><div class="flex items-center gap-3"${_scopeId}><button class="inline-flex items-center justify-center gap-2 px-4 py-2.5 border border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer bg-white dark:bg-slate-950"${_scopeId}>`);
						_push(ssrRenderComponent(unref(PlusCircle), { class: "h-4 w-4 text-red-500" }, null, _parent, _scopeId));
						_push(`<span${_scopeId}>Restock Stock</span></button><button class="inline-flex items-center justify-center gap-2 px-4 py-2.5 bg-red-600 hover:bg-red-500 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 transition-all cursor-pointer"${_scopeId}>`);
						_push(ssrRenderComponent(unref(Plus), { class: "h-4 w-4" }, null, _parent, _scopeId));
						_push(`<span${_scopeId}>Add Ingredient</span></button></div></div><div class="border-b border-slate-200 dark:border-slate-800"${_scopeId}><nav class="flex gap-6 -mb-px" aria-label="Tabs"${_scopeId}><button class="${ssrRenderClass(["pb-4 text-sm font-bold border-b-2 transition-all cursor-pointer bg-transparent border-0 flex items-center gap-2 px-1", activeTab.value === "ingredients" ? "border-red-600 text-red-600 dark:text-red-500" : "border-transparent text-slate-500 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-250 hover:border-slate-300 dark:hover:border-slate-700"])}"${_scopeId}>`);
						_push(ssrRenderComponent(unref(Package), { class: "h-4 w-4" }, null, _parent, _scopeId));
						_push(`<span${_scopeId}>Bahan Baku (Ingredients)</span></button><button class="${ssrRenderClass(["pb-4 text-sm font-bold border-b-2 transition-all cursor-pointer bg-transparent border-0 flex items-center gap-2 px-1", activeTab.value === "history" ? "border-red-600 text-red-600 dark:text-red-500" : "border-transparent text-slate-500 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-250 hover:border-slate-300 dark:hover:border-slate-700"])}"${_scopeId}>`);
						_push(ssrRenderComponent(unref(History), { class: "h-4 w-4" }, null, _parent, _scopeId));
						_push(`<span${_scopeId}>Riwayat Restock &amp; Penyesuaian</span></button></nav></div>`);
						if (activeTab.value === "ingredients") {
							_push(`<div class="bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl shadow-sm overflow-hidden"${_scopeId}><div class="p-5 border-b border-slate-200 dark:border-slate-800 flex flex-col md:flex-row md:items-center md:justify-between gap-4"${_scopeId}><div class="relative max-w-md w-full"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Search), { class: "absolute left-3 top-2.5 h-4 w-4 text-slate-400" }, null, _parent, _scopeId));
							_push(`<input${ssrRenderAttr("value", search.value)} type="text" placeholder="Search ingredients..." class="w-full pl-9 pr-4 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"${_scopeId}></div></div><div class="overflow-x-auto"${_scopeId}><table class="w-full border-collapse text-left"${_scopeId}><thead${_scopeId}><tr class="border-b border-slate-200 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/30"${_scopeId}><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400"${_scopeId}>Ingredient Name</th><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400"${_scopeId}>Measure Unit</th><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400"${_scopeId}>Outlet Stock Levels</th><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 text-right"${_scopeId}>Actions</th></tr></thead><tbody class="divide-y divide-slate-200 dark:divide-slate-800"${_scopeId}>`);
							if (__props.ingredients.data.length === 0) _push(`<tr${_scopeId}><td colspan="4" class="p-8 text-center text-sm text-slate-500 dark:text-slate-400"${_scopeId}> No ingredients registered. Create one to begin. </td></tr>`);
							else _push(`<!---->`);
							_push(`<!--[-->`);
							ssrRenderList(__props.ingredients.data, (ing) => {
								_push(`<tr class="hover:bg-slate-50/50 dark:hover:bg-slate-900/10 transition-colors align-top"${_scopeId}><td class="p-4 font-semibold text-sm text-slate-900 dark:text-slate-100"${_scopeId}><div class="flex items-center gap-2.5"${_scopeId}><div class="h-8 w-8 rounded-lg bg-red-50 dark:bg-red-950/20 flex items-center justify-center text-red-600 dark:text-red-400"${_scopeId}>`);
								_push(ssrRenderComponent(unref(Package), { class: "h-4.5 w-4.5" }, null, _parent, _scopeId));
								_push(`</div><span${_scopeId}>${ssrInterpolate(ing.name)}</span></div></td><td class="p-4 text-sm text-slate-600 dark:text-slate-400 font-medium"${_scopeId}><div class="flex items-center gap-1"${_scopeId}>`);
								_push(ssrRenderComponent(unref(Scale), { class: "h-4 w-4 text-slate-400" }, null, _parent, _scopeId));
								_push(`<span${_scopeId}>${ssrInterpolate(ing.unit)}</span></div></td><td class="p-4 text-sm"${_scopeId}>`);
								if (ing.outlet_ingredients.length === 0) _push(`<div class="text-xs text-slate-400 italic"${_scopeId}> No stock levels configured. Restock this ingredient. </div>`);
								else {
									_push(`<div class="grid grid-cols-1 sm:grid-cols-2 gap-3 max-w-lg"${_scopeId}><!--[-->`);
									ssrRenderList(ing.outlet_ingredients, (stock) => {
										_push(`<div class="p-2.5 rounded-lg border border-slate-100 dark:border-slate-900 bg-slate-50/30 dark:bg-slate-900/10 hover:border-red-500/40 hover:bg-slate-100/50 dark:hover:bg-slate-900/40 transition-all cursor-pointer flex flex-col"${_scopeId}><div class="flex items-center justify-between gap-2"${_scopeId}><span class="font-medium text-xs text-slate-800 dark:text-slate-200 truncate"${_scopeId}>${ssrInterpolate(stock.outlet.name)}</span>`);
										if (isLowStock(Number(stock.stock_qty), Number(stock.threshold_qty))) _push(`<span class="inline-flex px-1.5 py-0.5 rounded text-[9px] font-bold uppercase bg-amber-50 dark:bg-amber-950/30 text-amber-700 dark:text-amber-400 flex-shrink-0"${_scopeId}> Low </span>`);
										else _push(`<!---->`);
										_push(`</div><div class="flex items-baseline gap-1 mt-1.5"${_scopeId}><span class="${ssrRenderClass([isLowStock(Number(stock.stock_qty), Number(stock.threshold_qty)) ? "text-amber-600 dark:text-amber-400" : "text-slate-900 dark:text-slate-100", "text-sm font-bold"])}"${_scopeId}>${ssrInterpolate(Number(stock.stock_qty).toLocaleString("id-ID"))}</span><span class="text-[10px] text-slate-400"${_scopeId}>${ssrInterpolate(ing.unit)}</span><span class="text-[10px] text-slate-400 dark:text-slate-500 ml-auto"${_scopeId}>(min: ${ssrInterpolate(Number(stock.threshold_qty).toLocaleString("id-ID"))})</span></div></div>`);
									});
									_push(`<!--]--></div>`);
								}
								_push(`</td><td class="p-4 text-right"${_scopeId}><div class="flex items-center justify-end gap-1"${_scopeId}><button class="p-1.5 rounded-lg hover:bg-slate-100 dark:hover:bg-slate-950 text-slate-500 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-100 cursor-pointer" title="Edit Item"${_scopeId}>`);
								_push(ssrRenderComponent(unref(Edit2), { class: "h-4 w-4" }, null, _parent, _scopeId));
								_push(`</button><button class="p-1.5 rounded-lg hover:bg-rose-50 dark:hover:bg-rose-955/20 text-rose-500 hover:text-rose-600 cursor-pointer" title="Delete Item"${_scopeId}>`);
								_push(ssrRenderComponent(unref(Trash2), { class: "h-4 w-4" }, null, _parent, _scopeId));
								_push(`</button></div></td></tr>`);
							});
							_push(`<!--]--></tbody></table></div>`);
							if (__props.ingredients.last_page > 1) {
								_push(`<div class="p-4 border-t border-slate-200 dark:border-slate-800 flex items-center justify-between"${_scopeId}><p class="text-xs text-slate-500"${_scopeId}>Showing ${ssrInterpolate(__props.ingredients.data.length)} of ${ssrInterpolate(__props.ingredients.total)} ingredients</p><div class="flex gap-2"${_scopeId}>`);
								if (__props.ingredients.prev_page_url) _push(ssrRenderComponent(unref(Link), {
									href: __props.ingredients.prev_page_url,
									class: "px-3 py-1.5 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-xs font-semibold hover:bg-slate-50 dark:hover:bg-slate-800 transition-all text-slate-700 dark:text-slate-300 cursor-pointer"
								}, {
									default: withCtx((_, _push, _parent, _scopeId) => {
										if (_push) _push(` Previous `);
										else return [createTextVNode(" Previous ")];
									}),
									_: 1
								}, _parent, _scopeId));
								else _push(`<!---->`);
								if (__props.ingredients.next_page_url) _push(ssrRenderComponent(unref(Link), {
									href: __props.ingredients.next_page_url,
									class: "px-3 py-1.5 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-xs font-semibold hover:bg-slate-50 dark:hover:bg-slate-800 transition-all text-slate-700 dark:text-slate-300 cursor-pointer"
								}, {
									default: withCtx((_, _push, _parent, _scopeId) => {
										if (_push) _push(` Next `);
										else return [createTextVNode(" Next ")];
									}),
									_: 1
								}, _parent, _scopeId));
								else _push(`<!---->`);
								_push(`</div></div>`);
							} else _push(`<!---->`);
							_push(`</div>`);
						} else _push(`<!---->`);
						if (activeTab.value === "history") {
							_push(`<div class="bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl shadow-sm overflow-hidden"${_scopeId}><div class="p-5 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between"${_scopeId}><div${_scopeId}><h2 class="text-base font-bold text-slate-900 dark:text-slate-50 flex items-center gap-2"${_scopeId}>`);
							_push(ssrRenderComponent(unref(History), { class: "h-4.5 w-4.5 text-red-500" }, null, _parent, _scopeId));
							_push(`<span${_scopeId}>Restock &amp; Adjustment History</span></h2><p class="text-xs text-slate-500 dark:text-slate-400 mt-1"${_scopeId}> A list of raw material restocking and inventory adjustment activities across all outlets. </p></div></div><div class="overflow-x-auto"${_scopeId}><table class="w-full border-collapse text-left text-sm"${_scopeId}><thead${_scopeId}><tr class="border-b border-slate-200 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/30"${_scopeId}><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 whitespace-nowrap"${_scopeId}>Date &amp; Time</th><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 whitespace-nowrap"${_scopeId}>Ingredient</th><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 whitespace-nowrap"${_scopeId}>Outlet</th><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 whitespace-nowrap"${_scopeId}>Type</th><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 whitespace-nowrap"${_scopeId}>Quantity</th><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 whitespace-nowrap"${_scopeId}>Supplier</th><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 whitespace-nowrap"${_scopeId}>Operator</th><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 whitespace-nowrap"${_scopeId}>Notes</th><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 text-right whitespace-nowrap"${_scopeId}>Actions</th></tr></thead><tbody class="divide-y divide-slate-200 dark:divide-slate-800"${_scopeId}>`);
							if (__props.history.data.length === 0) _push(`<tr${_scopeId}><td colspan="9" class="p-8 text-center text-sm text-slate-500 dark:text-slate-400"${_scopeId}> No restock history recorded yet. </td></tr>`);
							else _push(`<!---->`);
							_push(`<!--[-->`);
							ssrRenderList(__props.history.data, (item) => {
								_push(`<tr class="hover:bg-slate-50/50 dark:hover:bg-slate-900/10 transition-colors"${_scopeId}><td class="p-4 text-slate-500 dark:text-slate-400 whitespace-nowrap text-xs"${_scopeId}>${ssrInterpolate(formatDateTime(item.created_at))}</td><td class="p-4 font-semibold text-slate-900 dark:text-slate-100 text-sm whitespace-nowrap"${_scopeId}>${ssrInterpolate(item.ingredient?.name || "Deleted Ingredient")}</td><td class="p-4 text-slate-700 dark:text-slate-300 text-sm whitespace-nowrap"${_scopeId}>${ssrInterpolate(item.outlet?.name)}</td><td class="p-4 whitespace-nowrap"${_scopeId}>`);
								if (item.type === "add") _push(`<span class="inline-flex px-2 py-0.5 rounded text-[10px] font-semibold bg-emerald-50 dark:bg-emerald-950/30 text-emerald-700 dark:text-emerald-400 border border-emerald-500/20 whitespace-nowrap"${_scopeId}> Restock (+Qty) </span>`);
								else _push(`<span class="inline-flex px-2 py-0.5 rounded text-[10px] font-semibold bg-blue-50 dark:bg-blue-950/30 text-blue-700 dark:text-blue-400 border border-blue-500/20 whitespace-nowrap"${_scopeId}> Override (=Qty) </span>`);
								_push(`</td><td class="p-4 font-bold text-slate-900 dark:text-slate-100 text-sm whitespace-nowrap"${_scopeId}>${ssrInterpolate(Number(item.qty).toLocaleString("id-ID"))} <span class="text-xs font-normal text-slate-400 ml-1"${_scopeId}>${ssrInterpolate(item.ingredient?.unit)}</span></td><td class="p-4 text-slate-600 dark:text-slate-400 text-xs whitespace-nowrap"${_scopeId}>${ssrInterpolate(item.supplier?.name || "-")}</td><td class="p-4 text-slate-600 dark:text-slate-400 text-xs whitespace-nowrap"${_scopeId}>${ssrInterpolate(item.user?.name)}</td><td class="p-4 text-xs text-slate-500 dark:text-slate-400 max-w-[200px] truncate whitespace-nowrap"${ssrRenderAttr("title", item.notes || void 0)}${_scopeId}>${ssrInterpolate(item.notes || "-")}</td><td class="p-4 text-right"${_scopeId}><button class="p-1.5 rounded-lg hover:bg-rose-50 dark:hover:bg-rose-955/20 text-rose-500 hover:text-rose-600 cursor-pointer animate-all" title="Delete Log &amp; Revert Stock"${_scopeId}>`);
								_push(ssrRenderComponent(unref(Trash2), { class: "h-4 w-4" }, null, _parent, _scopeId));
								_push(`</button></td></tr>`);
							});
							_push(`<!--]--></tbody></table></div>`);
							if (__props.history.last_page > 1) {
								_push(`<div class="p-4 border-t border-slate-200 dark:border-slate-800 flex items-center justify-between"${_scopeId}><p class="text-xs text-slate-500"${_scopeId}>Showing ${ssrInterpolate(__props.history.data.length)} of ${ssrInterpolate(__props.history.total)} items</p><div class="flex gap-2"${_scopeId}>`);
								if (__props.history.prev_page_url) _push(ssrRenderComponent(unref(Link), {
									href: __props.history.prev_page_url,
									"preserve-scroll": true,
									class: "px-3 py-1.5 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-xs font-semibold hover:bg-slate-50 dark:hover:bg-slate-800 transition-all text-slate-700 dark:text-slate-300 cursor-pointer"
								}, {
									default: withCtx((_, _push, _parent, _scopeId) => {
										if (_push) _push(` Previous `);
										else return [createTextVNode(" Previous ")];
									}),
									_: 1
								}, _parent, _scopeId));
								else _push(`<!---->`);
								if (__props.history.next_page_url) _push(ssrRenderComponent(unref(Link), {
									href: __props.history.next_page_url,
									"preserve-scroll": true,
									class: "px-3 py-1.5 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-xs font-semibold hover:bg-slate-50 dark:hover:bg-slate-800 transition-all text-slate-700 dark:text-slate-300 cursor-pointer"
								}, {
									default: withCtx((_, _push, _parent, _scopeId) => {
										if (_push) _push(` Next `);
										else return [createTextVNode(" Next ")];
									}),
									_: 1
								}, _parent, _scopeId));
								else _push(`<!---->`);
								_push(`</div></div>`);
							} else _push(`<!---->`);
							_push(`</div>`);
						} else _push(`<!---->`);
						_push(`</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="w-full max-w-md bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl overflow-hidden animate-in zoom-in-95 duration-200"${_scopeId}><div class="p-6 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between"${_scopeId}><h3 class="text-lg font-bold text-slate-900 dark:text-slate-50"${_scopeId}>${ssrInterpolate(editingIngredient.value ? "Edit Ingredient" : "Add New Ingredient")}</h3><button class="p-1.5 hover:bg-slate-100 dark:hover:bg-slate-900 rounded-lg text-slate-500 cursor-pointer"${_scopeId}>`);
							_push(ssrRenderComponent(unref(X), { class: "h-5 w-5" }, null, _parent, _scopeId));
							_push(`</button></div><form class="p-6 space-y-4"${_scopeId}><div class="space-y-1"${_scopeId}><label for="name" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Ingredient Name</label><input id="name"${ssrRenderAttr("value", unref(form).name)} type="text" required placeholder="e.g. Biji Kopi Arabika" class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"${_scopeId}>`);
							if (unref(form).errors.name) _push(`<p class="text-xs text-rose-600 mt-1"${_scopeId}>${ssrInterpolate(unref(form).errors.name)}</p>`);
							else _push(`<!---->`);
							_push(`</div><div class="space-y-1"${_scopeId}><label for="unit" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Measurement Unit</label><input id="unit"${ssrRenderAttr("value", unref(form).unit)} type="text" required placeholder="e.g. g, ml, pcs, kg" class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"${_scopeId}>`);
							if (unref(form).errors.unit) _push(`<p class="text-xs text-rose-600 mt-1"${_scopeId}>${ssrInterpolate(unref(form).errors.unit)}</p>`);
							else _push(`<!---->`);
							_push(`</div><div class="flex items-center justify-end gap-3 pt-4 border-t border-slate-200 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-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer"${_scopeId}> Cancel </button><button type="submit"${ssrIncludeBooleanAttr(unref(form).processing) ? " disabled" : ""} class="px-4 py-2 bg-red-600 hover:bg-red-500 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 disabled:opacity-50 transition-all cursor-pointer"${_scopeId}>${ssrInterpolate(unref(form).processing ? "Saving..." : "Save Ingredient")}</button></div></form></div></div>`);
						} else _push(`<!---->`);
						if (isAdjustModalOpen.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="w-full max-w-md bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl flex flex-col max-h-[90vh] animate-in zoom-in-95 duration-200"${_scopeId}><div class="p-6 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between flex-shrink-0"${_scopeId}><div${_scopeId}><h3 class="text-lg font-bold text-slate-900 dark:text-slate-50"${_scopeId}>Restock Stock Level</h3>`);
							if (unref(adjustForm).ingredient_id) _push(`<p class="text-xs text-slate-400 mt-0.5"${_scopeId}> Setting inventory for: <span class="font-bold text-slate-700 dark:text-slate-200"${_scopeId}>${ssrInterpolate(getIngredientName(unref(adjustForm).ingredient_id))}</span></p>`);
							else _push(`<!---->`);
							_push(`</div><button class="p-1.5 hover:bg-slate-100 dark:hover:bg-slate-900 rounded-lg text-slate-500 cursor-pointer"${_scopeId}>`);
							_push(ssrRenderComponent(unref(X), { class: "h-5 w-5" }, null, _parent, _scopeId));
							_push(`</button></div><form class="flex flex-col flex-1 min-h-0"${_scopeId}><div class="p-6 space-y-4 overflow-y-auto flex-1"${_scopeId}>`);
							if (!unref(adjustForm).ingredient_id) {
								_push(`<div class="space-y-1"${_scopeId}><label for="adjust_ing" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Ingredient</label><select id="adjust_ing" required class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"${_scopeId}><option value=""${ssrIncludeBooleanAttr(Array.isArray(unref(adjustForm).ingredient_id) ? ssrLooseContain(unref(adjustForm).ingredient_id, "") : ssrLooseEqual(unref(adjustForm).ingredient_id, "")) ? " selected" : ""}${_scopeId}>Select Ingredient</option><!--[-->`);
								ssrRenderList(__props.ingredients.data, (ing) => {
									_push(`<option${ssrRenderAttr("value", String(ing.id))}${ssrIncludeBooleanAttr(Array.isArray(unref(adjustForm).ingredient_id) ? ssrLooseContain(unref(adjustForm).ingredient_id, String(ing.id)) : ssrLooseEqual(unref(adjustForm).ingredient_id, String(ing.id))) ? " selected" : ""}${_scopeId}>${ssrInterpolate(ing.name)} (${ssrInterpolate(ing.unit)})</option>`);
								});
								_push(`<!--]--></select>`);
								if (unref(adjustForm).errors.ingredient_id) _push(`<p class="text-xs text-rose-600 mt-1"${_scopeId}>${ssrInterpolate(unref(adjustForm).errors.ingredient_id)}</p>`);
								else _push(`<!---->`);
								_push(`</div>`);
							} else _push(`<!---->`);
							_push(`<div class="space-y-1"${_scopeId}><label for="adjust_outlet" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Target Outlet</label><select id="adjust_outlet" required class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"${_scopeId}><option value=""${ssrIncludeBooleanAttr(Array.isArray(unref(adjustForm).outlet_id) ? ssrLooseContain(unref(adjustForm).outlet_id, "") : ssrLooseEqual(unref(adjustForm).outlet_id, "")) ? " selected" : ""}${_scopeId}>Select Outlet</option><!--[-->`);
							ssrRenderList(__props.outlets, (ot) => {
								_push(`<option${ssrRenderAttr("value", String(ot.id))}${ssrIncludeBooleanAttr(Array.isArray(unref(adjustForm).outlet_id) ? ssrLooseContain(unref(adjustForm).outlet_id, String(ot.id)) : ssrLooseEqual(unref(adjustForm).outlet_id, String(ot.id))) ? " selected" : ""}${_scopeId}>${ssrInterpolate(ot.name)}</option>`);
							});
							_push(`<!--]--></select>`);
							if (unref(adjustForm).errors.outlet_id) _push(`<p class="text-xs text-rose-600 mt-1"${_scopeId}>${ssrInterpolate(unref(adjustForm).errors.outlet_id)}</p>`);
							else _push(`<!---->`);
							_push(`</div><div class="space-y-1"${_scopeId}><label class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400 block mb-1"${_scopeId}>Adjustment Action</label><div class="grid grid-cols-2 gap-2"${_scopeId}><button type="button" class="${ssrRenderClass(["py-2 text-xs font-semibold rounded-lg border transition-all cursor-pointer", unref(adjustForm).action_type === "add" ? "bg-red-50 dark:bg-red-95/10 border-red-500 text-red-600 dark:text-red-400" : "border-slate-200 dark:border-slate-800 text-slate-600 dark:text-slate-400"])}"${_scopeId}> Add Stock (+Qty) </button><button type="button" class="${ssrRenderClass(["py-2 text-xs font-semibold rounded-lg border transition-all cursor-pointer", unref(adjustForm).action_type === "set" ? "bg-red-50 dark:bg-red-95/10 border-red-500 text-red-600 dark:text-red-400" : "border-slate-200 dark:border-slate-800 text-slate-600 dark:text-slate-400"])}"${_scopeId}> Set Absolute Stock (=Qty) </button></div></div><div class="space-y-1"${_scopeId}><label for="adjust_qty" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Quantity</label><input id="adjust_qty"${ssrRenderAttr("value", unref(adjustForm).stock_qty)} type="number" step="0.0001" min="0" required class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"${_scopeId}>`);
							if (unref(adjustForm).errors.stock_qty) _push(`<p class="text-xs text-rose-600 mt-1"${_scopeId}>${ssrInterpolate(unref(adjustForm).errors.stock_qty)}</p>`);
							else _push(`<!---->`);
							_push(`</div><div class="space-y-1"${_scopeId}><label for="adjust_threshold" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Safety Threshold (Minimum Stock Alert)</label><input id="adjust_threshold"${ssrRenderAttr("value", unref(adjustForm).threshold_qty)} type="number" step="0.0001" min="0" required class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"${_scopeId}>`);
							if (unref(adjustForm).errors.threshold_qty) _push(`<p class="text-xs text-rose-600 mt-1"${_scopeId}>${ssrInterpolate(unref(adjustForm).errors.threshold_qty)}</p>`);
							else _push(`<!---->`);
							_push(`</div><div class="space-y-1"${_scopeId}><label for="adjust_supplier" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Supplier</label><select id="adjust_supplier" class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"${_scopeId}><option value=""${ssrIncludeBooleanAttr(Array.isArray(unref(adjustForm).supplier_id) ? ssrLooseContain(unref(adjustForm).supplier_id, "") : ssrLooseEqual(unref(adjustForm).supplier_id, "")) ? " selected" : ""}${_scopeId}>Select Supplier</option><!--[-->`);
							ssrRenderList(__props.suppliers, (sp) => {
								_push(`<option${ssrRenderAttr("value", String(sp.id))}${ssrIncludeBooleanAttr(Array.isArray(unref(adjustForm).supplier_id) ? ssrLooseContain(unref(adjustForm).supplier_id, String(sp.id)) : ssrLooseEqual(unref(adjustForm).supplier_id, String(sp.id))) ? " selected" : ""}${_scopeId}>${ssrInterpolate(sp.name)}</option>`);
							});
							_push(`<!--]--></select>`);
							if (unref(adjustForm).errors.supplier_id) _push(`<p class="text-xs text-rose-600 mt-1"${_scopeId}>${ssrInterpolate(unref(adjustForm).errors.supplier_id)}</p>`);
							else _push(`<!---->`);
							_push(`</div><div class="space-y-1"${_scopeId}><label for="adjust_notes" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Adjustment Notes</label><textarea id="adjust_notes" rows="2" placeholder="e.g. Purchase order invoice number, batch code, expiry notes..." class="w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"${_scopeId}>${ssrInterpolate(unref(adjustForm).notes)}</textarea>`);
							if (unref(adjustForm).errors.notes) _push(`<p class="text-xs text-rose-600 mt-1"${_scopeId}>${ssrInterpolate(unref(adjustForm).errors.notes)}</p>`);
							else _push(`<!---->`);
							_push(`</div></div><div class="flex items-center justify-end gap-3 p-6 border-t border-slate-200 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/10 flex-shrink-0"${_scopeId}><button type="button" class="px-4 py-2 border border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer"${_scopeId}> Cancel </button><button type="submit"${ssrIncludeBooleanAttr(unref(adjustForm).processing) ? " disabled" : ""} class="px-4 py-2 bg-red-600 hover:bg-red-500 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 disabled:opacity-50 transition-all cursor-pointer"${_scopeId}>${ssrInterpolate(unref(adjustForm).processing ? "Saving..." : "Save Stock")}</button></div></form></div></div>`);
						} else _push(`<!---->`);
						if (isDeleteModalOpen.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="w-full max-w-md bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl p-6 animate-in zoom-in-95 duration-200 space-y-6"${_scopeId}><div class="flex items-center gap-3 text-rose-600 dark:text-rose-400"${_scopeId}>`);
							_push(ssrRenderComponent(unref(AlertCircle), { class: "h-6 w-6 flex-shrink-0" }, null, _parent, _scopeId));
							_push(`<h3 class="text-lg font-bold"${_scopeId}>Delete Ingredient?</h3></div><p class="text-sm text-slate-500 dark:text-slate-400"${_scopeId}> Are you sure you want to delete ingredient <span class="font-bold text-slate-900 dark:text-slate-100"${_scopeId}>&quot;${ssrInterpolate(ingredientToDelete.value?.name)}&quot;</span>? This will remove all associated recipes and stock records globally. This action is irreversible. </p><div class="flex items-center justify-end gap-3"${_scopeId}><button class="px-4 py-2 border border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer"${_scopeId}> Cancel </button><button class="px-4 py-2 bg-rose-600 hover:bg-rose-500 text-white rounded-lg text-sm font-semibold transition-all cursor-pointer"${_scopeId}> Confirm Delete </button></div></div></div>`);
						} else _push(`<!---->`);
						if (isDeleteTransactionModalOpen.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="w-full max-w-md bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl p-6 animate-in zoom-in-95 duration-200 space-y-6"${_scopeId}><div class="flex items-center gap-3 text-rose-600 dark:text-rose-400"${_scopeId}>`);
							_push(ssrRenderComponent(unref(AlertCircle), { class: "h-6 w-6 flex-shrink-0" }, null, _parent, _scopeId));
							_push(`<h3 class="text-lg font-bold"${_scopeId}>Delete History Log?</h3></div><p class="text-sm text-slate-500 dark:text-slate-400 leading-relaxed"${_scopeId}> Are you sure you want to delete this stock transaction entry? `);
							if (transactionToDelete.value?.type === "add") _push(`<span class="block mt-2 font-bold text-amber-600 dark:text-amber-400"${_scopeId}> ⚠️ WARNING: Since this was a Restock (+Qty) transaction, the added quantity of ${ssrInterpolate(Number(transactionToDelete.value?.qty).toLocaleString("id-ID"))} will be automatically subtracted/reverted from the outlet&#39;s current inventory balance. </span>`);
							else _push(`<!---->`);
							_push(`</p><div class="flex items-center justify-end gap-3 pt-2"${_scopeId}><button class="px-4 py-2 border border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer"${_scopeId}> Cancel </button><button class="px-4 py-2 bg-rose-600 hover:bg-rose-500 text-white rounded-lg text-sm font-semibold transition-all cursor-pointer"${_scopeId}> Confirm Delete </button></div></div></div>`);
						} else _push(`<!---->`);
					} else return [
						createVNode("div", { class: "space-y-6" }, [
							createVNode("div", { class: "flex flex-col gap-4 md:flex-row md:items-center md:justify-between" }, [createVNode("div", null, [createVNode("h1", { class: "text-2xl font-bold tracking-tight text-slate-900 dark:text-slate-50" }, "Stock Inventory"), createVNode("p", { class: "text-sm text-slate-500 dark:text-slate-400 mt-1" }, " Manage raw coffee beans, milk, syrups, cups, and track their stock levels across all outlets. ")]), createVNode("div", { class: "flex items-center gap-3" }, [createVNode("button", {
								onClick: ($event) => {
									isAdjustModalOpen.value = true;
									unref(adjustForm).reset();
								},
								class: "inline-flex items-center justify-center gap-2 px-4 py-2.5 border border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer bg-white dark:bg-slate-950"
							}, [createVNode(unref(PlusCircle), { class: "h-4 w-4 text-red-500" }), createVNode("span", null, "Restock Stock")], 8, ["onClick"]), createVNode("button", {
								onClick: openCreateModal,
								class: "inline-flex items-center justify-center gap-2 px-4 py-2.5 bg-red-600 hover:bg-red-500 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 transition-all cursor-pointer"
							}, [createVNode(unref(Plus), { class: "h-4 w-4" }), createVNode("span", null, "Add Ingredient")])])]),
							createVNode("div", { class: "border-b border-slate-200 dark:border-slate-800" }, [createVNode("nav", {
								class: "flex gap-6 -mb-px",
								"aria-label": "Tabs"
							}, [createVNode("button", {
								onClick: ($event) => activeTab.value = "ingredients",
								class: ["pb-4 text-sm font-bold border-b-2 transition-all cursor-pointer bg-transparent border-0 flex items-center gap-2 px-1", activeTab.value === "ingredients" ? "border-red-600 text-red-600 dark:text-red-500" : "border-transparent text-slate-500 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-250 hover:border-slate-300 dark:hover:border-slate-700"]
							}, [createVNode(unref(Package), { class: "h-4 w-4" }), createVNode("span", null, "Bahan Baku (Ingredients)")], 10, ["onClick"]), createVNode("button", {
								onClick: ($event) => activeTab.value = "history",
								class: ["pb-4 text-sm font-bold border-b-2 transition-all cursor-pointer bg-transparent border-0 flex items-center gap-2 px-1", activeTab.value === "history" ? "border-red-600 text-red-600 dark:text-red-500" : "border-transparent text-slate-500 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-250 hover:border-slate-300 dark:hover:border-slate-700"]
							}, [createVNode(unref(History), { class: "h-4 w-4" }), createVNode("span", null, "Riwayat Restock & Penyesuaian")], 10, ["onClick"])])]),
							activeTab.value === "ingredients" ? (openBlock(), createBlock("div", {
								key: 0,
								class: "bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl shadow-sm overflow-hidden"
							}, [
								createVNode("div", { class: "p-5 border-b border-slate-200 dark:border-slate-800 flex flex-col md:flex-row md:items-center md:justify-between gap-4" }, [createVNode("div", { class: "relative max-w-md w-full" }, [createVNode(unref(Search), { class: "absolute left-3 top-2.5 h-4 w-4 text-slate-400" }), withDirectives(createVNode("input", {
									"onUpdate:modelValue": ($event) => search.value = $event,
									type: "text",
									placeholder: "Search ingredients...",
									class: "w-full pl-9 pr-4 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"
								}, null, 8, ["onUpdate:modelValue"]), [[vModelText, search.value]])])]),
								createVNode("div", { class: "overflow-x-auto" }, [createVNode("table", { class: "w-full border-collapse text-left" }, [createVNode("thead", null, [createVNode("tr", { class: "border-b border-slate-200 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/30" }, [
									createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400" }, "Ingredient Name"),
									createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400" }, "Measure Unit"),
									createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400" }, "Outlet Stock Levels"),
									createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 text-right" }, "Actions")
								])]), createVNode("tbody", { class: "divide-y divide-slate-200 dark:divide-slate-800" }, [__props.ingredients.data.length === 0 ? (openBlock(), createBlock("tr", { key: 0 }, [createVNode("td", {
									colspan: "4",
									class: "p-8 text-center text-sm text-slate-500 dark:text-slate-400"
								}, " No ingredients registered. Create one to begin. ")])) : createCommentVNode("", true), (openBlock(true), createBlock(Fragment, null, renderList(__props.ingredients.data, (ing) => {
									return openBlock(), createBlock("tr", {
										key: ing.id,
										class: "hover:bg-slate-50/50 dark:hover:bg-slate-900/10 transition-colors align-top"
									}, [
										createVNode("td", { class: "p-4 font-semibold text-sm text-slate-900 dark:text-slate-100" }, [createVNode("div", { class: "flex items-center gap-2.5" }, [createVNode("div", { class: "h-8 w-8 rounded-lg bg-red-50 dark:bg-red-950/20 flex items-center justify-center text-red-600 dark:text-red-400" }, [createVNode(unref(Package), { class: "h-4.5 w-4.5" })]), createVNode("span", null, toDisplayString(ing.name), 1)])]),
										createVNode("td", { class: "p-4 text-sm text-slate-600 dark:text-slate-400 font-medium" }, [createVNode("div", { class: "flex items-center gap-1" }, [createVNode(unref(Scale), { class: "h-4 w-4 text-slate-400" }), createVNode("span", null, toDisplayString(ing.unit), 1)])]),
										createVNode("td", { class: "p-4 text-sm" }, [ing.outlet_ingredients.length === 0 ? (openBlock(), createBlock("div", {
											key: 0,
											class: "text-xs text-slate-400 italic"
										}, " No stock levels configured. Restock this ingredient. ")) : (openBlock(), createBlock("div", {
											key: 1,
											class: "grid grid-cols-1 sm:grid-cols-2 gap-3 max-w-lg"
										}, [(openBlock(true), createBlock(Fragment, null, renderList(ing.outlet_ingredients, (stock) => {
											return openBlock(), createBlock("div", {
												key: stock.id,
												onClick: ($event) => openAdjustModal(ing, stock),
												class: "p-2.5 rounded-lg border border-slate-100 dark:border-slate-900 bg-slate-50/30 dark:bg-slate-900/10 hover:border-red-500/40 hover:bg-slate-100/50 dark:hover:bg-slate-900/40 transition-all cursor-pointer flex flex-col"
											}, [createVNode("div", { class: "flex items-center justify-between gap-2" }, [createVNode("span", { class: "font-medium text-xs text-slate-800 dark:text-slate-200 truncate" }, toDisplayString(stock.outlet.name), 1), isLowStock(Number(stock.stock_qty), Number(stock.threshold_qty)) ? (openBlock(), createBlock("span", {
												key: 0,
												class: "inline-flex px-1.5 py-0.5 rounded text-[9px] font-bold uppercase bg-amber-50 dark:bg-amber-950/30 text-amber-700 dark:text-amber-400 flex-shrink-0"
											}, " Low ")) : createCommentVNode("", true)]), createVNode("div", { class: "flex items-baseline gap-1 mt-1.5" }, [
												createVNode("span", { class: ["text-sm font-bold", isLowStock(Number(stock.stock_qty), Number(stock.threshold_qty)) ? "text-amber-600 dark:text-amber-400" : "text-slate-900 dark:text-slate-100"] }, toDisplayString(Number(stock.stock_qty).toLocaleString("id-ID")), 3),
												createVNode("span", { class: "text-[10px] text-slate-400" }, toDisplayString(ing.unit), 1),
												createVNode("span", { class: "text-[10px] text-slate-400 dark:text-slate-500 ml-auto" }, "(min: " + toDisplayString(Number(stock.threshold_qty).toLocaleString("id-ID")) + ")", 1)
											])], 8, ["onClick"]);
										}), 128))]))]),
										createVNode("td", { class: "p-4 text-right" }, [createVNode("div", { class: "flex items-center justify-end gap-1" }, [createVNode("button", {
											onClick: ($event) => openEditModal(ing),
											class: "p-1.5 rounded-lg hover:bg-slate-100 dark:hover:bg-slate-950 text-slate-500 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-100 cursor-pointer",
											title: "Edit Item"
										}, [createVNode(unref(Edit2), { class: "h-4 w-4" })], 8, ["onClick"]), createVNode("button", {
											onClick: ($event) => openDeleteModal(ing),
											class: "p-1.5 rounded-lg hover:bg-rose-50 dark:hover:bg-rose-955/20 text-rose-500 hover:text-rose-600 cursor-pointer",
											title: "Delete Item"
										}, [createVNode(unref(Trash2), { class: "h-4 w-4" })], 8, ["onClick"])])])
									]);
								}), 128))])])]),
								__props.ingredients.last_page > 1 ? (openBlock(), createBlock("div", {
									key: 0,
									class: "p-4 border-t border-slate-200 dark:border-slate-800 flex items-center justify-between"
								}, [createVNode("p", { class: "text-xs text-slate-500" }, "Showing " + toDisplayString(__props.ingredients.data.length) + " of " + toDisplayString(__props.ingredients.total) + " ingredients", 1), createVNode("div", { class: "flex gap-2" }, [__props.ingredients.prev_page_url ? (openBlock(), createBlock(unref(Link), {
									key: 0,
									href: __props.ingredients.prev_page_url,
									class: "px-3 py-1.5 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-xs font-semibold hover:bg-slate-50 dark:hover:bg-slate-800 transition-all text-slate-700 dark:text-slate-300 cursor-pointer"
								}, {
									default: withCtx(() => [createTextVNode(" Previous ")]),
									_: 1
								}, 8, ["href"])) : createCommentVNode("", true), __props.ingredients.next_page_url ? (openBlock(), createBlock(unref(Link), {
									key: 1,
									href: __props.ingredients.next_page_url,
									class: "px-3 py-1.5 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-xs font-semibold hover:bg-slate-50 dark:hover:bg-slate-800 transition-all text-slate-700 dark:text-slate-300 cursor-pointer"
								}, {
									default: withCtx(() => [createTextVNode(" Next ")]),
									_: 1
								}, 8, ["href"])) : createCommentVNode("", true)])])) : createCommentVNode("", true)
							])) : createCommentVNode("", true),
							activeTab.value === "history" ? (openBlock(), createBlock("div", {
								key: 1,
								class: "bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-xl shadow-sm overflow-hidden"
							}, [
								createVNode("div", { class: "p-5 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between" }, [createVNode("div", null, [createVNode("h2", { class: "text-base font-bold text-slate-900 dark:text-slate-50 flex items-center gap-2" }, [createVNode(unref(History), { class: "h-4.5 w-4.5 text-red-500" }), createVNode("span", null, "Restock & Adjustment History")]), createVNode("p", { class: "text-xs text-slate-500 dark:text-slate-400 mt-1" }, " A list of raw material restocking and inventory adjustment activities across all outlets. ")])]),
								createVNode("div", { class: "overflow-x-auto" }, [createVNode("table", { class: "w-full border-collapse text-left text-sm" }, [createVNode("thead", null, [createVNode("tr", { class: "border-b border-slate-200 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/30" }, [
									createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 whitespace-nowrap" }, "Date & Time"),
									createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 whitespace-nowrap" }, "Ingredient"),
									createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 whitespace-nowrap" }, "Outlet"),
									createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 whitespace-nowrap" }, "Type"),
									createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 whitespace-nowrap" }, "Quantity"),
									createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 whitespace-nowrap" }, "Supplier"),
									createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 whitespace-nowrap" }, "Operator"),
									createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 whitespace-nowrap" }, "Notes"),
									createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 text-right whitespace-nowrap" }, "Actions")
								])]), createVNode("tbody", { class: "divide-y divide-slate-200 dark:divide-slate-800" }, [__props.history.data.length === 0 ? (openBlock(), createBlock("tr", { key: 0 }, [createVNode("td", {
									colspan: "9",
									class: "p-8 text-center text-sm text-slate-500 dark:text-slate-400"
								}, " No restock history recorded yet. ")])) : createCommentVNode("", true), (openBlock(true), createBlock(Fragment, null, renderList(__props.history.data, (item) => {
									return openBlock(), createBlock("tr", {
										key: item.id,
										class: "hover:bg-slate-50/50 dark:hover:bg-slate-900/10 transition-colors"
									}, [
										createVNode("td", { class: "p-4 text-slate-500 dark:text-slate-400 whitespace-nowrap text-xs" }, toDisplayString(formatDateTime(item.created_at)), 1),
										createVNode("td", { class: "p-4 font-semibold text-slate-900 dark:text-slate-100 text-sm whitespace-nowrap" }, toDisplayString(item.ingredient?.name || "Deleted Ingredient"), 1),
										createVNode("td", { class: "p-4 text-slate-700 dark:text-slate-300 text-sm whitespace-nowrap" }, toDisplayString(item.outlet?.name), 1),
										createVNode("td", { class: "p-4 whitespace-nowrap" }, [item.type === "add" ? (openBlock(), createBlock("span", {
											key: 0,
											class: "inline-flex px-2 py-0.5 rounded text-[10px] font-semibold bg-emerald-50 dark:bg-emerald-950/30 text-emerald-700 dark:text-emerald-400 border border-emerald-500/20 whitespace-nowrap"
										}, " Restock (+Qty) ")) : (openBlock(), createBlock("span", {
											key: 1,
											class: "inline-flex px-2 py-0.5 rounded text-[10px] font-semibold bg-blue-50 dark:bg-blue-950/30 text-blue-700 dark:text-blue-400 border border-blue-500/20 whitespace-nowrap"
										}, " Override (=Qty) "))]),
										createVNode("td", { class: "p-4 font-bold text-slate-900 dark:text-slate-100 text-sm whitespace-nowrap" }, [createTextVNode(toDisplayString(Number(item.qty).toLocaleString("id-ID")) + " ", 1), createVNode("span", { class: "text-xs font-normal text-slate-400 ml-1" }, toDisplayString(item.ingredient?.unit), 1)]),
										createVNode("td", { class: "p-4 text-slate-600 dark:text-slate-400 text-xs whitespace-nowrap" }, toDisplayString(item.supplier?.name || "-"), 1),
										createVNode("td", { class: "p-4 text-slate-600 dark:text-slate-400 text-xs whitespace-nowrap" }, toDisplayString(item.user?.name), 1),
										createVNode("td", {
											class: "p-4 text-xs text-slate-500 dark:text-slate-400 max-w-[200px] truncate whitespace-nowrap",
											title: item.notes || void 0
										}, toDisplayString(item.notes || "-"), 9, ["title"]),
										createVNode("td", { class: "p-4 text-right" }, [createVNode("button", {
											onClick: ($event) => openDeleteTransactionModal(item),
											class: "p-1.5 rounded-lg hover:bg-rose-50 dark:hover:bg-rose-955/20 text-rose-500 hover:text-rose-600 cursor-pointer animate-all",
											title: "Delete Log & Revert Stock"
										}, [createVNode(unref(Trash2), { class: "h-4 w-4" })], 8, ["onClick"])])
									]);
								}), 128))])])]),
								__props.history.last_page > 1 ? (openBlock(), createBlock("div", {
									key: 0,
									class: "p-4 border-t border-slate-200 dark:border-slate-800 flex items-center justify-between"
								}, [createVNode("p", { class: "text-xs text-slate-500" }, "Showing " + toDisplayString(__props.history.data.length) + " of " + toDisplayString(__props.history.total) + " items", 1), createVNode("div", { class: "flex gap-2" }, [__props.history.prev_page_url ? (openBlock(), createBlock(unref(Link), {
									key: 0,
									href: __props.history.prev_page_url,
									"preserve-scroll": true,
									class: "px-3 py-1.5 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-xs font-semibold hover:bg-slate-50 dark:hover:bg-slate-800 transition-all text-slate-700 dark:text-slate-300 cursor-pointer"
								}, {
									default: withCtx(() => [createTextVNode(" Previous ")]),
									_: 1
								}, 8, ["href"])) : createCommentVNode("", true), __props.history.next_page_url ? (openBlock(), createBlock(unref(Link), {
									key: 1,
									href: __props.history.next_page_url,
									"preserve-scroll": true,
									class: "px-3 py-1.5 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg text-xs font-semibold hover:bg-slate-50 dark:hover:bg-slate-800 transition-all text-slate-700 dark:text-slate-300 cursor-pointer"
								}, {
									default: withCtx(() => [createTextVNode(" Next ")]),
									_: 1
								}, 8, ["href"])) : createCommentVNode("", true)])])) : createCommentVNode("", true)
							])) : createCommentVNode("", true)
						]),
						isFormModalOpen.value ? (openBlock(), createBlock("div", {
							key: 0,
							class: "fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/60 backdrop-blur-sm"
						}, [createVNode("div", { class: "w-full max-w-md bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl overflow-hidden animate-in zoom-in-95 duration-200" }, [createVNode("div", { class: "p-6 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between" }, [createVNode("h3", { class: "text-lg font-bold text-slate-900 dark:text-slate-50" }, toDisplayString(editingIngredient.value ? "Edit Ingredient" : "Add New Ingredient"), 1), createVNode("button", {
							onClick: ($event) => isFormModalOpen.value = false,
							class: "p-1.5 hover:bg-slate-100 dark:hover:bg-slate-900 rounded-lg text-slate-500 cursor-pointer"
						}, [createVNode(unref(X), { class: "h-5 w-5" })], 8, ["onClick"])]), createVNode("form", {
							onSubmit: withModifiers(submitForm, ["prevent"]),
							class: "p-6 space-y-4"
						}, [
							createVNode("div", { class: "space-y-1" }, [
								createVNode("label", {
									for: "name",
									class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
								}, "Ingredient Name"),
								withDirectives(createVNode("input", {
									id: "name",
									"onUpdate:modelValue": ($event) => unref(form).name = $event,
									type: "text",
									required: "",
									placeholder: "e.g. Biji Kopi Arabika",
									class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"
								}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(form).name]]),
								unref(form).errors.name ? (openBlock(), createBlock("p", {
									key: 0,
									class: "text-xs text-rose-600 mt-1"
								}, toDisplayString(unref(form).errors.name), 1)) : createCommentVNode("", true)
							]),
							createVNode("div", { class: "space-y-1" }, [
								createVNode("label", {
									for: "unit",
									class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
								}, "Measurement Unit"),
								withDirectives(createVNode("input", {
									id: "unit",
									"onUpdate:modelValue": ($event) => unref(form).unit = $event,
									type: "text",
									required: "",
									placeholder: "e.g. g, ml, pcs, kg",
									class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"
								}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(form).unit]]),
								unref(form).errors.unit ? (openBlock(), createBlock("p", {
									key: 0,
									class: "text-xs text-rose-600 mt-1"
								}, toDisplayString(unref(form).errors.unit), 1)) : createCommentVNode("", true)
							]),
							createVNode("div", { class: "flex items-center justify-end gap-3 pt-4 border-t border-slate-200 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-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer"
							}, " Cancel ", 8, ["onClick"]), createVNode("button", {
								type: "submit",
								disabled: unref(form).processing,
								class: "px-4 py-2 bg-red-600 hover:bg-red-500 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 disabled:opacity-50 transition-all cursor-pointer"
							}, toDisplayString(unref(form).processing ? "Saving..." : "Save Ingredient"), 9, ["disabled"])])
						], 32)])])) : createCommentVNode("", true),
						isAdjustModalOpen.value ? (openBlock(), createBlock("div", {
							key: 1,
							class: "fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/60 backdrop-blur-sm"
						}, [createVNode("div", { class: "w-full max-w-md bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl flex flex-col max-h-[90vh] animate-in zoom-in-95 duration-200" }, [createVNode("div", { class: "p-6 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between flex-shrink-0" }, [createVNode("div", null, [createVNode("h3", { class: "text-lg font-bold text-slate-900 dark:text-slate-50" }, "Restock Stock Level"), unref(adjustForm).ingredient_id ? (openBlock(), createBlock("p", {
							key: 0,
							class: "text-xs text-slate-400 mt-0.5"
						}, [createTextVNode(" Setting inventory for: "), createVNode("span", { class: "font-bold text-slate-700 dark:text-slate-200" }, toDisplayString(getIngredientName(unref(adjustForm).ingredient_id)), 1)])) : createCommentVNode("", true)]), createVNode("button", {
							onClick: ($event) => isAdjustModalOpen.value = false,
							class: "p-1.5 hover:bg-slate-100 dark:hover:bg-slate-900 rounded-lg text-slate-500 cursor-pointer"
						}, [createVNode(unref(X), { class: "h-5 w-5" })], 8, ["onClick"])]), createVNode("form", {
							onSubmit: withModifiers(submitAdjustForm, ["prevent"]),
							class: "flex flex-col flex-1 min-h-0"
						}, [createVNode("div", { class: "p-6 space-y-4 overflow-y-auto flex-1" }, [
							!unref(adjustForm).ingredient_id ? (openBlock(), createBlock("div", {
								key: 0,
								class: "space-y-1"
							}, [
								createVNode("label", {
									for: "adjust_ing",
									class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
								}, "Ingredient"),
								withDirectives(createVNode("select", {
									id: "adjust_ing",
									"onUpdate:modelValue": ($event) => unref(adjustForm).ingredient_id = $event,
									required: "",
									class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"
								}, [createVNode("option", { value: "" }, "Select Ingredient"), (openBlock(true), createBlock(Fragment, null, renderList(__props.ingredients.data, (ing) => {
									return openBlock(), createBlock("option", {
										key: ing.id,
										value: String(ing.id)
									}, toDisplayString(ing.name) + " (" + toDisplayString(ing.unit) + ")", 9, ["value"]);
								}), 128))], 8, ["onUpdate:modelValue"]), [[vModelSelect, unref(adjustForm).ingredient_id]]),
								unref(adjustForm).errors.ingredient_id ? (openBlock(), createBlock("p", {
									key: 0,
									class: "text-xs text-rose-600 mt-1"
								}, toDisplayString(unref(adjustForm).errors.ingredient_id), 1)) : createCommentVNode("", true)
							])) : createCommentVNode("", true),
							createVNode("div", { class: "space-y-1" }, [
								createVNode("label", {
									for: "adjust_outlet",
									class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
								}, "Target Outlet"),
								withDirectives(createVNode("select", {
									id: "adjust_outlet",
									"onUpdate:modelValue": ($event) => unref(adjustForm).outlet_id = $event,
									required: "",
									class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"
								}, [createVNode("option", { value: "" }, "Select Outlet"), (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, unref(adjustForm).outlet_id]]),
								unref(adjustForm).errors.outlet_id ? (openBlock(), createBlock("p", {
									key: 0,
									class: "text-xs text-rose-600 mt-1"
								}, toDisplayString(unref(adjustForm).errors.outlet_id), 1)) : createCommentVNode("", true)
							]),
							createVNode("div", { class: "space-y-1" }, [createVNode("label", { class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400 block mb-1" }, "Adjustment Action"), createVNode("div", { class: "grid grid-cols-2 gap-2" }, [createVNode("button", {
								type: "button",
								onClick: ($event) => unref(adjustForm).action_type = "add",
								class: ["py-2 text-xs font-semibold rounded-lg border transition-all cursor-pointer", unref(adjustForm).action_type === "add" ? "bg-red-50 dark:bg-red-95/10 border-red-500 text-red-600 dark:text-red-400" : "border-slate-200 dark:border-slate-800 text-slate-600 dark:text-slate-400"]
							}, " Add Stock (+Qty) ", 10, ["onClick"]), createVNode("button", {
								type: "button",
								onClick: ($event) => unref(adjustForm).action_type = "set",
								class: ["py-2 text-xs font-semibold rounded-lg border transition-all cursor-pointer", unref(adjustForm).action_type === "set" ? "bg-red-50 dark:bg-red-95/10 border-red-500 text-red-600 dark:text-red-400" : "border-slate-200 dark:border-slate-800 text-slate-600 dark:text-slate-400"]
							}, " Set Absolute Stock (=Qty) ", 10, ["onClick"])])]),
							createVNode("div", { class: "space-y-1" }, [
								createVNode("label", {
									for: "adjust_qty",
									class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
								}, "Quantity"),
								withDirectives(createVNode("input", {
									id: "adjust_qty",
									"onUpdate:modelValue": ($event) => unref(adjustForm).stock_qty = $event,
									type: "number",
									step: "0.0001",
									min: "0",
									required: "",
									class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"
								}, null, 8, ["onUpdate:modelValue"]), [[
									vModelText,
									unref(adjustForm).stock_qty,
									void 0,
									{ number: true }
								]]),
								unref(adjustForm).errors.stock_qty ? (openBlock(), createBlock("p", {
									key: 0,
									class: "text-xs text-rose-600 mt-1"
								}, toDisplayString(unref(adjustForm).errors.stock_qty), 1)) : createCommentVNode("", true)
							]),
							createVNode("div", { class: "space-y-1" }, [
								createVNode("label", {
									for: "adjust_threshold",
									class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
								}, "Safety Threshold (Minimum Stock Alert)"),
								withDirectives(createVNode("input", {
									id: "adjust_threshold",
									"onUpdate:modelValue": ($event) => unref(adjustForm).threshold_qty = $event,
									type: "number",
									step: "0.0001",
									min: "0",
									required: "",
									class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"
								}, null, 8, ["onUpdate:modelValue"]), [[
									vModelText,
									unref(adjustForm).threshold_qty,
									void 0,
									{ number: true }
								]]),
								unref(adjustForm).errors.threshold_qty ? (openBlock(), createBlock("p", {
									key: 0,
									class: "text-xs text-rose-600 mt-1"
								}, toDisplayString(unref(adjustForm).errors.threshold_qty), 1)) : createCommentVNode("", true)
							]),
							createVNode("div", { class: "space-y-1" }, [
								createVNode("label", {
									for: "adjust_supplier",
									class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
								}, "Supplier"),
								withDirectives(createVNode("select", {
									id: "adjust_supplier",
									"onUpdate:modelValue": ($event) => unref(adjustForm).supplier_id = $event,
									class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"
								}, [createVNode("option", { value: "" }, "Select Supplier"), (openBlock(true), createBlock(Fragment, null, renderList(__props.suppliers, (sp) => {
									return openBlock(), createBlock("option", {
										key: sp.id,
										value: String(sp.id)
									}, toDisplayString(sp.name), 9, ["value"]);
								}), 128))], 8, ["onUpdate:modelValue"]), [[vModelSelect, unref(adjustForm).supplier_id]]),
								unref(adjustForm).errors.supplier_id ? (openBlock(), createBlock("p", {
									key: 0,
									class: "text-xs text-rose-600 mt-1"
								}, toDisplayString(unref(adjustForm).errors.supplier_id), 1)) : createCommentVNode("", true)
							]),
							createVNode("div", { class: "space-y-1" }, [
								createVNode("label", {
									for: "adjust_notes",
									class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
								}, "Adjustment Notes"),
								withDirectives(createVNode("textarea", {
									id: "adjust_notes",
									"onUpdate:modelValue": ($event) => unref(adjustForm).notes = $event,
									rows: "2",
									placeholder: "e.g. Purchase order invoice number, batch code, expiry notes...",
									class: "w-full px-3.5 py-2 border border-slate-200 dark:border-slate-800 rounded-lg bg-transparent text-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all text-slate-900 dark:text-slate-100"
								}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(adjustForm).notes]]),
								unref(adjustForm).errors.notes ? (openBlock(), createBlock("p", {
									key: 0,
									class: "text-xs text-rose-600 mt-1"
								}, toDisplayString(unref(adjustForm).errors.notes), 1)) : createCommentVNode("", true)
							])
						]), createVNode("div", { class: "flex items-center justify-end gap-3 p-6 border-t border-slate-200 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/10 flex-shrink-0" }, [createVNode("button", {
							type: "button",
							onClick: ($event) => isAdjustModalOpen.value = false,
							class: "px-4 py-2 border border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer"
						}, " Cancel ", 8, ["onClick"]), createVNode("button", {
							type: "submit",
							disabled: unref(adjustForm).processing,
							class: "px-4 py-2 bg-red-600 hover:bg-red-500 text-white rounded-lg text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-red-500/20 disabled:opacity-50 transition-all cursor-pointer"
						}, toDisplayString(unref(adjustForm).processing ? "Saving..." : "Save Stock"), 9, ["disabled"])])], 32)])])) : createCommentVNode("", true),
						isDeleteModalOpen.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: "w-full max-w-md bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl p-6 animate-in zoom-in-95 duration-200 space-y-6" }, [
							createVNode("div", { class: "flex items-center gap-3 text-rose-600 dark:text-rose-400" }, [createVNode(unref(AlertCircle), { class: "h-6 w-6 flex-shrink-0" }), createVNode("h3", { class: "text-lg font-bold" }, "Delete Ingredient?")]),
							createVNode("p", { class: "text-sm text-slate-500 dark:text-slate-400" }, [
								createTextVNode(" Are you sure you want to delete ingredient "),
								createVNode("span", { class: "font-bold text-slate-900 dark:text-slate-100" }, "\"" + toDisplayString(ingredientToDelete.value?.name) + "\"", 1),
								createTextVNode("? This will remove all associated recipes and stock records globally. This action is irreversible. ")
							]),
							createVNode("div", { class: "flex items-center justify-end gap-3" }, [createVNode("button", {
								onClick: ($event) => isDeleteModalOpen.value = false,
								class: "px-4 py-2 border border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer"
							}, " Cancel ", 8, ["onClick"]), createVNode("button", {
								onClick: deleteIngredient,
								class: "px-4 py-2 bg-rose-600 hover:bg-rose-500 text-white rounded-lg text-sm font-semibold transition-all cursor-pointer"
							}, " Confirm Delete ")])
						])])) : createCommentVNode("", true),
						isDeleteTransactionModalOpen.value ? (openBlock(), createBlock("div", {
							key: 3,
							class: "fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/60 backdrop-blur-sm"
						}, [createVNode("div", { class: "w-full max-w-md bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-2xl p-6 animate-in zoom-in-95 duration-200 space-y-6" }, [
							createVNode("div", { class: "flex items-center gap-3 text-rose-600 dark:text-rose-400" }, [createVNode(unref(AlertCircle), { class: "h-6 w-6 flex-shrink-0" }), createVNode("h3", { class: "text-lg font-bold" }, "Delete History Log?")]),
							createVNode("p", { class: "text-sm text-slate-500 dark:text-slate-400 leading-relaxed" }, [createTextVNode(" Are you sure you want to delete this stock transaction entry? "), transactionToDelete.value?.type === "add" ? (openBlock(), createBlock("span", {
								key: 0,
								class: "block mt-2 font-bold text-amber-600 dark:text-amber-400"
							}, " ⚠️ WARNING: Since this was a Restock (+Qty) transaction, the added quantity of " + toDisplayString(Number(transactionToDelete.value?.qty).toLocaleString("id-ID")) + " will be automatically subtracted/reverted from the outlet's current inventory balance. ", 1)) : createCommentVNode("", true)]),
							createVNode("div", { class: "flex items-center justify-end gap-3 pt-2" }, [createVNode("button", {
								onClick: ($event) => isDeleteTransactionModalOpen.value = false,
								class: "px-4 py-2 border border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-900 rounded-lg text-sm font-semibold transition-all cursor-pointer"
							}, " Cancel ", 8, ["onClick"]), createVNode("button", {
								onClick: deleteTransaction,
								class: "px-4 py-2 bg-rose-600 hover:bg-rose-500 text-white rounded-lg text-sm font-semibold transition-all cursor-pointer"
							}, " Confirm Delete ")])
						])])) : createCommentVNode("", true)
					];
				}),
				_: 1
			}, _parent));
			_push(`<!--]-->`);
		};
	}
});
//#endregion
//#region resources/js/Pages/CafePOS/Ingredients/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/Ingredients/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 };
