import { t as AdminLayout_default } from "./AdminLayout-DcKfAlG1.js";
import { Head, Link, router, useForm } from "@inertiajs/vue3";
import { Fragment, computed, createBlock, createCommentVNode, createTextVNode, createVNode, defineComponent, openBlock, ref, renderList, toDisplayString, unref, useSSRContext, vModelText, watch, withCtx, withDirectives, withModifiers } from "vue";
import { ssrIncludeBooleanAttr, ssrInterpolate, ssrRenderAttr, ssrRenderClass, ssrRenderComponent, ssrRenderList } from "vue/server-renderer";
import { AlertCircle, AlignLeft, Edit2, MapPin, Plus, Search, Store, Trash2, UserCheck, X } from "lucide-vue-next";
//#region resources/js/Pages/CafePOS/Outlets/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: {
		outlets: {},
		availableUsers: {},
		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("outlets.index"), { search: search.value }, {
					preserveState: true,
					replace: true
				});
			}, 400);
		});
		const isFormModalOpen = ref(false);
		const isDeleteModalOpen = ref(false);
		const editingOutlet = ref(null);
		const outletToDelete = ref(null);
		const form = useForm({
			name: "",
			location: "",
			description: "",
			assigned_users: []
		});
		const assignableUsers = computed(() => {
			return props.availableUsers;
		});
		const openCreateModal = () => {
			editingOutlet.value = null;
			form.clearErrors();
			form.reset();
			isFormModalOpen.value = true;
		};
		const openEditModal = (outlet) => {
			editingOutlet.value = outlet;
			form.clearErrors();
			form.name = outlet.name;
			form.location = outlet.location || "";
			form.description = outlet.description || "";
			form.assigned_users = props.availableUsers.filter((u) => u.outlet_id === outlet.id).map((u) => u.id);
			isFormModalOpen.value = true;
		};
		const submitForm = () => {
			if (editingOutlet.value) form.put(route("outlets.update", editingOutlet.value.id), { onSuccess: () => {
				isFormModalOpen.value = false;
				form.reset();
			} });
			else form.post(route("outlets.store"), { onSuccess: () => {
				isFormModalOpen.value = false;
				form.reset();
			} });
		};
		const openDeleteModal = (outlet) => {
			outletToDelete.value = outlet;
			isDeleteModalOpen.value = true;
		};
		const deleteOutlet = () => {
			if (!outletToDelete.value) return;
			router.delete(route("outlets.destroy", outletToDelete.value.id), { onSuccess: () => {
				isDeleteModalOpen.value = false;
				outletToDelete.value = null;
			} });
		};
		const toggleUserAssignment = (userId) => {
			const idx = form.assigned_users.indexOf(userId);
			if (idx > -1) form.assigned_users.splice(idx, 1);
			else form.assigned_users.push(userId);
		};
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<!--[-->`);
			_push(ssrRenderComponent(unref(Head), { title: "Outlet Management" }, 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}>Outlet Management</h1><p class="text-sm text-slate-500 dark:text-slate-400 mt-1"${_scopeId}> Configure your physical coffee shops, check sales channels, and map cashier accounts. </p></div><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}>Create Outlet</span></button></div><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 outlets name or location..." 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}>Outlet Info</th><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400"${_scopeId}>Location</th><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 text-center"${_scopeId}>Cashiers</th><th class="p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 text-center"${_scopeId}>Transactions</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.outlets.data.length === 0) _push(`<tr${_scopeId}><td colspan="5" class="p-8 text-center text-sm text-slate-500 dark:text-slate-400"${_scopeId}> No outlets found. Try creating one! </td></tr>`);
						else _push(`<!---->`);
						_push(`<!--[-->`);
						ssrRenderList(__props.outlets.data, (outlet) => {
							_push(`<tr class="hover:bg-slate-50/50 dark:hover:bg-slate-900/10 transition-colors"${_scopeId}><td class="p-4"${_scopeId}><div class="flex items-center gap-3"${_scopeId}><div class="h-10 w-10 rounded-lg bg-red-50 dark:bg-red-950/30 flex items-center justify-center text-red-600 dark:text-red-400"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Store), { class: "h-5 w-5" }, null, _parent, _scopeId));
							_push(`</div><div${_scopeId}><p class="text-sm font-semibold text-slate-900 dark:text-slate-100"${_scopeId}>${ssrInterpolate(outlet.name)}</p><p class="text-xs text-slate-400 dark:text-slate-500 truncate max-w-xs mt-0.5"${_scopeId}>${ssrInterpolate(outlet.description || "No description")}</p></div></div></td><td class="p-4 text-sm text-slate-600 dark:text-slate-300"${_scopeId}><div class="flex items-center gap-1.5"${_scopeId}>`);
							_push(ssrRenderComponent(unref(MapPin), { class: "h-4 w-4 text-slate-400 flex-shrink-0" }, null, _parent, _scopeId));
							_push(`<span class="truncate max-w-xs"${_scopeId}>${ssrInterpolate(outlet.location || "-")}</span></div></td><td class="p-4 text-sm text-slate-600 dark:text-slate-300 text-center"${_scopeId}><span class="inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-blue-50 dark:bg-blue-950/30 text-blue-700 dark:text-blue-400"${_scopeId}>${ssrInterpolate(outlet.users_count)} Cashier(s) </span></td><td class="p-4 text-sm text-slate-600 dark:text-slate-300 text-center"${_scopeId}><span class="inline-flex items-center px-2.5 py-1 rounded-full text-xs font-semibold bg-emerald-50 dark:bg-emerald-950/30 text-emerald-700 dark:text-emerald-400"${_scopeId}>${ssrInterpolate(outlet.transactions_count)}</span></td><td class="p-4 text-right"${_scopeId}><div class="flex items-center justify-end gap-2"${_scopeId}><button class="p-2 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 transition-colors cursor-pointer" title="Edit Outlet"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Edit2), { class: "h-4 w-4" }, null, _parent, _scopeId));
							_push(`</button><button class="p-2 rounded-lg hover:bg-rose-50 dark:hover:bg-rose-955/20 text-rose-500 hover:text-rose-600 transition-colors cursor-pointer" title="Delete Outlet"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Trash2), { class: "h-4 w-4" }, null, _parent, _scopeId));
							_push(`</button></div></td></tr>`);
						});
						_push(`<!--]--></tbody></table></div>`);
						if (__props.outlets.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.outlets.data.length)} of ${ssrInterpolate(__props.outlets.total)} outlets</p><div class="flex gap-2"${_scopeId}>`);
							if (__props.outlets.prev_page_url) _push(ssrRenderComponent(unref(Link), {
								href: __props.outlets.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.outlets.next_page_url) _push(ssrRenderComponent(unref(Link), {
								href: __props.outlets.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></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-xl 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(editingOutlet.value ? "Edit Outlet" : "Create New Outlet")}</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-6"${_scopeId}><div class="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}>Outlet Name</label><div class="relative"${_scopeId}>`);
							_push(ssrRenderComponent(unref(Store), { class: "absolute left-3 top-2.5 h-4 w-4 text-slate-400" }, null, _parent, _scopeId));
							_push(`<input id="name"${ssrRenderAttr("value", unref(form).name)} type="text" required placeholder="e.g. Outlet Senopati" class="w-full pl-10 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>`);
							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="location" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Location Address</label><div class="relative"${_scopeId}>`);
							_push(ssrRenderComponent(unref(MapPin), { class: "absolute left-3 top-2.5 h-4 w-4 text-slate-400" }, null, _parent, _scopeId));
							_push(`<input id="location"${ssrRenderAttr("value", unref(form).location)} type="text" placeholder="e.g. Jalan Senopati Raya No. 12, Jakarta Selatan" class="w-full pl-10 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>`);
							if (unref(form).errors.location) _push(`<p class="text-xs text-rose-600 mt-1"${_scopeId}>${ssrInterpolate(unref(form).errors.location)}</p>`);
							else _push(`<!---->`);
							_push(`</div><div class="space-y-1"${_scopeId}><label for="description" class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"${_scopeId}>Description</label><div class="relative"${_scopeId}>`);
							_push(ssrRenderComponent(unref(AlignLeft), { class: "absolute left-3 top-2.5 h-4 w-4 text-slate-400" }, null, _parent, _scopeId));
							_push(`<textarea id="description" rows="3" placeholder="Brief details about the outlet operations..." class="w-full pl-10 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 resize-none"${_scopeId}>${ssrInterpolate(unref(form).description)}</textarea></div>`);
							if (unref(form).errors.description) _push(`<p class="text-xs text-rose-600 mt-1"${_scopeId}>${ssrInterpolate(unref(form).errors.description)}</p>`);
							else _push(`<!---->`);
							_push(`</div><div class="space-y-2 border-t border-slate-100 dark:border-slate-900 pt-4"${_scopeId}><label class="text-xs font-semibold uppercase text-slate-500 dark:text-slate-400 block mb-2"${_scopeId}>Assign Staff (Kasir &amp; Kitchen)</label>`);
							if (assignableUsers.value.length === 0) _push(`<div class="p-4 text-center border border-dashed border-slate-200 dark:border-slate-800 rounded-lg text-slate-400 text-xs"${_scopeId}> No available staff found. Assign the &#39;Kasir&#39; or &#39;Kitchen&#39; role in User Management first. </div>`);
							else {
								_push(`<div class="max-h-40 overflow-y-auto space-y-2 pr-2"${_scopeId}><!--[-->`);
								ssrRenderList(assignableUsers.value, (user) => {
									_push(`<div class="${ssrRenderClass(["flex items-center justify-between p-3 rounded-lg border text-sm font-medium cursor-pointer transition-all", unref(form).assigned_users.includes(user.id) ? "border-red-500 bg-red-50/30 dark:bg-red-950/10 text-red-600 dark:text-red-400" : "border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-900/50"])}"${_scopeId}><div class="flex flex-col gap-0.5"${_scopeId}><div class="flex items-center gap-2"${_scopeId}><span${_scopeId}>${ssrInterpolate(user.name)}</span>`);
									if (user.roles && user.roles.length > 0) _push(`<span class="${ssrRenderClass(["px-1.5 py-0.5 rounded text-[9px] font-extrabold uppercase tracking-wider", user.roles[0].name === "Kitchen" ? "bg-orange-500/10 text-orange-600 dark:text-orange-400 border border-orange-500/20" : "bg-[#8c5a3c]/10 text-[#8c5a3c] border border-[#8c5a3c]/20"])}"${_scopeId}>${ssrInterpolate(user.roles[0].name)}</span>`);
									else _push(`<!---->`);
									_push(`</div><span class="text-xs text-slate-400 font-normal"${_scopeId}>${ssrInterpolate(user.email)} `);
									if (user.outlet && (!editingOutlet.value || user.outlet_id !== editingOutlet.value.id)) _push(`<span class="text-amber-600 dark:text-amber-400 font-bold ml-1.5"${_scopeId}> (Assigned to: ${ssrInterpolate(user.outlet.name)}) </span>`);
									else _push(`<!---->`);
									_push(`</span></div>`);
									if (unref(form).assigned_users.includes(user.id)) _push(ssrRenderComponent(unref(UserCheck), { class: "h-4 w-4 text-red-600 dark:text-red-400" }, null, _parent, _scopeId));
									else _push(`<!---->`);
									_push(`</div>`);
								});
								_push(`<!--]--></div>`);
							}
							_push(`</div></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 Changes")}</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 Outlet?</h3></div><p class="text-sm text-slate-500 dark:text-slate-400"${_scopeId}> Are you sure you want to delete outlet <span class="font-bold text-slate-900 dark:text-slate-100"${_scopeId}>&quot;${ssrInterpolate(outletToDelete.value?.name)}&quot;</span>? This will unassign any mapped cashiers and delete outlet transaction ties. 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(`<!---->`);
					} 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" }, "Outlet Management"), createVNode("p", { class: "text-sm text-slate-500 dark:text-slate-400 mt-1" }, " Configure your physical coffee shops, check sales channels, and map cashier accounts. ")]), 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, "Create Outlet")])]), createVNode("div", { 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 outlets name or location...",
								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" }, "Outlet Info"),
								createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400" }, "Location"),
								createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 text-center" }, "Cashiers"),
								createVNode("th", { class: "p-4 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 text-center" }, "Transactions"),
								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.outlets.data.length === 0 ? (openBlock(), createBlock("tr", { key: 0 }, [createVNode("td", {
								colspan: "5",
								class: "p-8 text-center text-sm text-slate-500 dark:text-slate-400"
							}, " No outlets found. Try creating one! ")])) : createCommentVNode("", true), (openBlock(true), createBlock(Fragment, null, renderList(__props.outlets.data, (outlet) => {
								return openBlock(), createBlock("tr", {
									key: outlet.id,
									class: "hover:bg-slate-50/50 dark:hover:bg-slate-900/10 transition-colors"
								}, [
									createVNode("td", { class: "p-4" }, [createVNode("div", { class: "flex items-center gap-3" }, [createVNode("div", { class: "h-10 w-10 rounded-lg bg-red-50 dark:bg-red-950/30 flex items-center justify-center text-red-600 dark:text-red-400" }, [createVNode(unref(Store), { class: "h-5 w-5" })]), createVNode("div", null, [createVNode("p", { class: "text-sm font-semibold text-slate-900 dark:text-slate-100" }, toDisplayString(outlet.name), 1), createVNode("p", { class: "text-xs text-slate-400 dark:text-slate-500 truncate max-w-xs mt-0.5" }, toDisplayString(outlet.description || "No description"), 1)])])]),
									createVNode("td", { class: "p-4 text-sm text-slate-600 dark:text-slate-300" }, [createVNode("div", { class: "flex items-center gap-1.5" }, [createVNode(unref(MapPin), { class: "h-4 w-4 text-slate-400 flex-shrink-0" }), createVNode("span", { class: "truncate max-w-xs" }, toDisplayString(outlet.location || "-"), 1)])]),
									createVNode("td", { class: "p-4 text-sm text-slate-600 dark:text-slate-300 text-center" }, [createVNode("span", { class: "inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-blue-50 dark:bg-blue-950/30 text-blue-700 dark:text-blue-400" }, toDisplayString(outlet.users_count) + " Cashier(s) ", 1)]),
									createVNode("td", { class: "p-4 text-sm text-slate-600 dark:text-slate-300 text-center" }, [createVNode("span", { class: "inline-flex items-center px-2.5 py-1 rounded-full text-xs font-semibold bg-emerald-50 dark:bg-emerald-950/30 text-emerald-700 dark:text-emerald-400" }, toDisplayString(outlet.transactions_count), 1)]),
									createVNode("td", { class: "p-4 text-right" }, [createVNode("div", { class: "flex items-center justify-end gap-2" }, [createVNode("button", {
										onClick: ($event) => openEditModal(outlet),
										class: "p-2 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 transition-colors cursor-pointer",
										title: "Edit Outlet"
									}, [createVNode(unref(Edit2), { class: "h-4 w-4" })], 8, ["onClick"]), createVNode("button", {
										onClick: ($event) => openDeleteModal(outlet),
										class: "p-2 rounded-lg hover:bg-rose-50 dark:hover:bg-rose-955/20 text-rose-500 hover:text-rose-600 transition-colors cursor-pointer",
										title: "Delete Outlet"
									}, [createVNode(unref(Trash2), { class: "h-4 w-4" })], 8, ["onClick"])])])
								]);
							}), 128))])])]),
							__props.outlets.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.outlets.data.length) + " of " + toDisplayString(__props.outlets.total) + " outlets", 1), createVNode("div", { class: "flex gap-2" }, [__props.outlets.prev_page_url ? (openBlock(), createBlock(unref(Link), {
								key: 0,
								href: __props.outlets.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.outlets.next_page_url ? (openBlock(), createBlock(unref(Link), {
								key: 1,
								href: __props.outlets.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)
						])]),
						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-xl 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(editingOutlet.value ? "Edit Outlet" : "Create New Outlet"), 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-6"
						}, [createVNode("div", { class: "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"
								}, "Outlet Name"),
								createVNode("div", { class: "relative" }, [createVNode(unref(Store), { class: "absolute left-3 top-2.5 h-4 w-4 text-slate-400" }), withDirectives(createVNode("input", {
									id: "name",
									"onUpdate:modelValue": ($event) => unref(form).name = $event,
									type: "text",
									required: "",
									placeholder: "e.g. Outlet Senopati",
									class: "w-full pl-10 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, 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: "location",
									class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
								}, "Location Address"),
								createVNode("div", { class: "relative" }, [createVNode(unref(MapPin), { class: "absolute left-3 top-2.5 h-4 w-4 text-slate-400" }), withDirectives(createVNode("input", {
									id: "location",
									"onUpdate:modelValue": ($event) => unref(form).location = $event,
									type: "text",
									placeholder: "e.g. Jalan Senopati Raya No. 12, Jakarta Selatan",
									class: "w-full pl-10 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, unref(form).location]])]),
								unref(form).errors.location ? (openBlock(), createBlock("p", {
									key: 0,
									class: "text-xs text-rose-600 mt-1"
								}, toDisplayString(unref(form).errors.location), 1)) : createCommentVNode("", true)
							]),
							createVNode("div", { class: "space-y-1" }, [
								createVNode("label", {
									for: "description",
									class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400"
								}, "Description"),
								createVNode("div", { class: "relative" }, [createVNode(unref(AlignLeft), { class: "absolute left-3 top-2.5 h-4 w-4 text-slate-400" }), withDirectives(createVNode("textarea", {
									id: "description",
									"onUpdate:modelValue": ($event) => unref(form).description = $event,
									rows: "3",
									placeholder: "Brief details about the outlet operations...",
									class: "w-full pl-10 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 resize-none"
								}, null, 8, ["onUpdate:modelValue"]), [[vModelText, unref(form).description]])]),
								unref(form).errors.description ? (openBlock(), createBlock("p", {
									key: 0,
									class: "text-xs text-rose-600 mt-1"
								}, toDisplayString(unref(form).errors.description), 1)) : createCommentVNode("", true)
							]),
							createVNode("div", { class: "space-y-2 border-t border-slate-100 dark:border-slate-900 pt-4" }, [createVNode("label", { class: "text-xs font-semibold uppercase text-slate-500 dark:text-slate-400 block mb-2" }, "Assign Staff (Kasir & Kitchen)"), assignableUsers.value.length === 0 ? (openBlock(), createBlock("div", {
								key: 0,
								class: "p-4 text-center border border-dashed border-slate-200 dark:border-slate-800 rounded-lg text-slate-400 text-xs"
							}, " No available staff found. Assign the 'Kasir' or 'Kitchen' role in User Management first. ")) : (openBlock(), createBlock("div", {
								key: 1,
								class: "max-h-40 overflow-y-auto space-y-2 pr-2"
							}, [(openBlock(true), createBlock(Fragment, null, renderList(assignableUsers.value, (user) => {
								return openBlock(), createBlock("div", {
									key: user.id,
									onClick: ($event) => toggleUserAssignment(user.id),
									class: ["flex items-center justify-between p-3 rounded-lg border text-sm font-medium cursor-pointer transition-all", unref(form).assigned_users.includes(user.id) ? "border-red-500 bg-red-50/30 dark:bg-red-950/10 text-red-600 dark:text-red-400" : "border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-900/50"]
								}, [createVNode("div", { class: "flex flex-col gap-0.5" }, [createVNode("div", { class: "flex items-center gap-2" }, [createVNode("span", null, toDisplayString(user.name), 1), user.roles && user.roles.length > 0 ? (openBlock(), createBlock("span", {
									key: 0,
									class: ["px-1.5 py-0.5 rounded text-[9px] font-extrabold uppercase tracking-wider", user.roles[0].name === "Kitchen" ? "bg-orange-500/10 text-orange-600 dark:text-orange-400 border border-orange-500/20" : "bg-[#8c5a3c]/10 text-[#8c5a3c] border border-[#8c5a3c]/20"]
								}, toDisplayString(user.roles[0].name), 3)) : createCommentVNode("", true)]), createVNode("span", { class: "text-xs text-slate-400 font-normal" }, [createTextVNode(toDisplayString(user.email) + " ", 1), user.outlet && (!editingOutlet.value || user.outlet_id !== editingOutlet.value.id) ? (openBlock(), createBlock("span", {
									key: 0,
									class: "text-amber-600 dark:text-amber-400 font-bold ml-1.5"
								}, " (Assigned to: " + toDisplayString(user.outlet.name) + ") ", 1)) : createCommentVNode("", true)])]), unref(form).assigned_users.includes(user.id) ? (openBlock(), createBlock(unref(UserCheck), {
									key: 0,
									class: "h-4 w-4 text-red-600 dark:text-red-400"
								})) : createCommentVNode("", true)], 10, ["onClick"]);
							}), 128))]))])
						]), 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 Changes"), 9, ["disabled"])])], 32)])])) : createCommentVNode("", true),
						isDeleteModalOpen.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 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 Outlet?")]),
							createVNode("p", { class: "text-sm text-slate-500 dark:text-slate-400" }, [
								createTextVNode(" Are you sure you want to delete outlet "),
								createVNode("span", { class: "font-bold text-slate-900 dark:text-slate-100" }, "\"" + toDisplayString(outletToDelete.value?.name) + "\"", 1),
								createTextVNode("? This will unassign any mapped cashiers and delete outlet transaction ties. 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: deleteOutlet,
								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/Outlets/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/Outlets/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 };
