import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BOaGB7Aw.js";
import { t as AdminLayout_default } from "./AdminLayout-CFTJa237.js";
import { Head, router } from "@inertiajs/vue3";
import { Fragment, Transition, computed, createBlock, createCommentVNode, createTextVNode, createVNode, defineComponent, onMounted, openBlock, ref, renderList, resolveDynamicComponent, toDisplayString, unref, useSSRContext, vModelSelect, vModelText, withCtx, withDirectives } from "vue";
import { ssrIncludeBooleanAttr, ssrInterpolate, ssrLooseContain, ssrLooseEqual, ssrRenderAttr, ssrRenderClass, ssrRenderComponent, ssrRenderList, ssrRenderStyle, ssrRenderVNode } from "vue/server-renderer";
import { AlertTriangle, ArrowRight, Banknote, BarChart3, Clock, CreditCard, Filter, Minus, Package, QrCode, ReceiptText, RefreshCw, ShoppingBag, Store, TrendingDown, TrendingUp, Truck, X } from "lucide-vue-next";
import VueApexCharts from "vue3-apexcharts";
//#region resources/js/Pages/Dashboard.vue?vue&type=script&setup=true&lang.ts
var Dashboard_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
	__name: "Dashboard",
	__ssrInlineRender: true,
	props: {
		kpi: {},
		salesTrend: {},
		topProducts: {},
		paymentSplit: {},
		revenueByOutlet: {},
		recentTransactions: {},
		lowStockAlerts: {},
		outlets: {},
		filters: {},
		appName: {}
	},
	setup(__props) {
		const props = __props;
		const filterMonth = ref(props.filters.month);
		const filterOutletId = ref(props.filters.outlet_id ? String(props.filters.outlet_id) : "");
		const applyFilters = () => {
			router.get(route("dashboard"), {
				month: filterMonth.value || void 0,
				outlet_id: filterOutletId.value || void 0
			}, {
				preserveScroll: true,
				replace: true
			});
		};
		const resetFilters = () => {
			filterMonth.value = (/* @__PURE__ */ new Date()).toISOString().slice(0, 7);
			filterOutletId.value = "";
			applyFilters();
		};
		const hasActiveFilters = computed(() => filterMonth.value !== (/* @__PURE__ */ new Date()).toISOString().slice(0, 7) || filterOutletId.value !== "");
		const formatCurrency = (val) => "Rp " + new Intl.NumberFormat("id-ID").format(Math.round(val));
		const formatNumber = (val) => new Intl.NumberFormat("id-ID").format(val);
		const formatDate = (str) => {
			return new Date(str).toLocaleDateString("id-ID", {
				day: "2-digit",
				month: "short"
			});
		};
		const isDark = ref(document.documentElement.classList.contains("dark"));
		const chartKey = ref(0);
		onMounted(() => {
			new MutationObserver(() => {
				isDark.value = document.documentElement.classList.contains("dark");
			}).observe(document.documentElement, {
				attributes: true,
				attributeFilter: ["class"]
			});
			setTimeout(() => {
				chartKey.value++;
			}, 100);
		});
		const chartTextColor = computed(() => isDark.value ? "#94a3b8" : "#64748b");
		const chartGridColor = computed(() => isDark.value ? "#1e293b" : "#f1f5f9");
		computed(() => isDark.value ? "#0f172a" : "#ffffff");
		const paymentLabel = (method) => {
			return {
				cash: "Cash",
				transfer: "Transfer",
				qris: "QRIS"
			}[method] ?? method;
		};
		const paymentIcon = (method) => {
			return {
				cash: Banknote,
				transfer: CreditCard,
				qris: QrCode
			}[method] ?? CreditCard;
		};
		const paymentColor = (method) => {
			return {
				cash: "text-emerald-500",
				transfer: "text-blue-500",
				qris: "text-violet-500"
			}[method] ?? "text-slate-400";
		};
		const paymentBg = (method) => {
			return {
				cash: "bg-emerald-500/10",
				transfer: "bg-blue-500/10",
				qris: "bg-violet-500/10"
			}[method] ?? "bg-slate-500/10";
		};
		const salesTrendOptions = computed(() => ({
			chart: {
				type: "area",
				height: "100%",
				background: "transparent",
				toolbar: { show: false },
				sparkline: { enabled: false },
				animations: {
					enabled: true,
					speed: 800
				}
			},
			dataLabels: { enabled: false },
			stroke: {
				curve: "smooth",
				width: 2.5
			},
			fill: {
				type: "gradient",
				gradient: {
					shadeIntensity: 1,
					opacityFrom: .35,
					opacityTo: .02,
					stops: [0, 100]
				}
			},
			colors: ["#8c5a3c"],
			xaxis: {
				categories: props.salesTrend.map((d) => formatDate(d.date)),
				labels: { style: {
					colors: chartTextColor.value,
					fontSize: "11px"
				} },
				axisBorder: { show: false },
				axisTicks: { show: false }
			},
			yaxis: { labels: {
				style: {
					colors: chartTextColor.value,
					fontSize: "11px"
				},
				formatter: (val) => "Rp " + new Intl.NumberFormat("id-ID", {
					notation: "compact",
					maximumFractionDigits: 1
				}).format(val)
			} },
			grid: {
				borderColor: chartGridColor.value,
				strokeDashArray: 4,
				xaxis: { lines: { show: false } }
			},
			tooltip: {
				theme: isDark.value ? "dark" : "light",
				y: { formatter: (val) => formatCurrency(val) }
			}
		}));
		const salesTrendSeries = computed(() => [{
			name: "Revenue",
			data: props.salesTrend.map((d) => d.total)
		}]);
		const paymentDonutOptions = computed(() => ({
			chart: {
				type: "donut",
				background: "transparent",
				animations: {
					enabled: true,
					speed: 800
				}
			},
			labels: props.paymentSplit.map((p) => paymentLabel(p.method)),
			colors: [
				"#10b981",
				"#3b82f6",
				"#8b5cf6"
			],
			dataLabels: { enabled: false },
			legend: {
				position: "bottom",
				labels: { colors: chartTextColor.value },
				fontSize: "12px"
			},
			plotOptions: { pie: { donut: {
				size: "68%",
				labels: {
					show: true,
					total: {
						show: true,
						label: "Transactions",
						color: chartTextColor.value,
						formatter: (w) => formatNumber(w.globals.seriesTotals.reduce((a, b) => a + b, 0))
					},
					value: {
						color: isDark.value ? "#f1f5f9" : "#0f172a",
						fontSize: "20px",
						fontWeight: "700"
					}
				}
			} } },
			stroke: { show: false },
			tooltip: {
				theme: isDark.value ? "dark" : "light",
				y: { formatter: (val) => `${val} transactions` }
			}
		}));
		const paymentDonutSeries = computed(() => props.paymentSplit.map((p) => p.count));
		const topProductsOptions = computed(() => ({
			chart: {
				type: "bar",
				background: "transparent",
				toolbar: { show: false },
				animations: {
					enabled: true,
					speed: 800
				}
			},
			plotOptions: { bar: {
				horizontal: true,
				borderRadius: 6,
				barHeight: "55%",
				distributed: true
			} },
			colors: [
				"#8c5a3c",
				"#a17050",
				"#b48057",
				"#c79b7b",
				"#ebd5c5"
			],
			dataLabels: { enabled: false },
			xaxis: {
				labels: {
					style: {
						colors: chartTextColor.value,
						fontSize: "11px"
					},
					formatter: (val) => formatNumber(val) + " pcs"
				},
				axisBorder: { show: false },
				axisTicks: { show: false }
			},
			yaxis: { labels: { style: {
				colors: isDark.value ? "#f1f5f9" : "#0f172a",
				fontSize: "12px",
				fontWeight: "600"
			} } },
			grid: {
				borderColor: chartGridColor.value,
				strokeDashArray: 4
			},
			legend: { show: false },
			tooltip: {
				theme: isDark.value ? "dark" : "light",
				y: { formatter: (val) => `${formatNumber(val)} sold` }
			}
		}));
		const topProductsSeries = computed(() => [{
			name: "Qty Sold",
			data: props.topProducts.map((p) => ({
				x: p.name,
				y: p.qty
			}))
		}]);
		const outletRevenueOptions = computed(() => ({
			chart: {
				type: "bar",
				background: "transparent",
				toolbar: { show: false },
				animations: {
					enabled: true,
					speed: 800
				}
			},
			plotOptions: { bar: {
				borderRadius: 6,
				columnWidth: "45%",
				distributed: true
			} },
			colors: [
				"#8c5a3c",
				"#f59e0b",
				"#3b82f6",
				"#10b981",
				"#8b5cf6"
			],
			dataLabels: { enabled: false },
			xaxis: {
				categories: props.revenueByOutlet.map((o) => o.outlet),
				labels: { style: {
					colors: chartTextColor.value,
					fontSize: "11px"
				} },
				axisBorder: { show: false },
				axisTicks: { show: false }
			},
			yaxis: { labels: {
				style: {
					colors: chartTextColor.value,
					fontSize: "11px"
				},
				formatter: (val) => "Rp " + new Intl.NumberFormat("id-ID", {
					notation: "compact",
					maximumFractionDigits: 1
				}).format(val)
			} },
			grid: {
				borderColor: chartGridColor.value,
				strokeDashArray: 4
			},
			legend: { show: false },
			tooltip: {
				theme: isDark.value ? "dark" : "light",
				y: { formatter: (val) => formatCurrency(val) }
			}
		}));
		const outletRevenueSeries = computed(() => [{
			name: "Revenue",
			data: props.revenueByOutlet.map((o) => o.total)
		}]);
		const trendClass = (pct) => pct > 0 ? "text-emerald-500" : pct < 0 ? "text-rose-500" : "text-slate-400";
		const trendBg = (pct) => pct > 0 ? "bg-emerald-500/10" : pct < 0 ? "bg-rose-500/10" : "bg-slate-500/10";
		const trendIcon = (pct) => pct > 0 ? TrendingUp : pct < 0 ? TrendingDown : Minus;
		const stockPct = (item) => {
			if (item.threshold_qty <= 0) return 0;
			return Math.min(100, Math.round(item.stock_qty / item.threshold_qty * 100));
		};
		const nowStr = ref((/* @__PURE__ */ new Date()).toLocaleString("id-ID", {
			dateStyle: "long",
			timeStyle: "short"
		}));
		const refresh = () => router.reload();
		return (_ctx, _push, _parent, _attrs) => {
			_push(`<!--[-->`);
			_push(ssrRenderComponent(unref(Head), { title: "Dashboard" }, null, _parent));
			_push(ssrRenderComponent(AdminLayout_default, null, {
				default: withCtx((_, _push, _parent, _scopeId) => {
					if (_push) {
						_push(`<div class="mb-6" data-v-857e1ba5${_scopeId}><div class="flex flex-col sm:flex-row sm:items-start justify-between gap-3 mb-4" data-v-857e1ba5${_scopeId}><div data-v-857e1ba5${_scopeId}><h1 class="text-2xl font-extrabold text-slate-900 dark:text-slate-50 tracking-tight" data-v-857e1ba5${_scopeId}> Business Overview </h1><p class="text-sm text-slate-500 dark:text-slate-400 mt-0.5 flex items-center gap-1.5" data-v-857e1ba5${_scopeId}>`);
						_push(ssrRenderComponent(unref(Clock), { class: "h-3.5 w-3.5" }, null, _parent, _scopeId));
						_push(` ${ssrInterpolate(nowStr.value)}</p></div><div class="flex items-center gap-2 self-start flex-shrink-0" data-v-857e1ba5${_scopeId}><button class="flex items-center gap-2 px-4 py-2 rounded-xl bg-slate-100 dark:bg-slate-800 hover:bg-slate-200 dark:hover:bg-slate-700 text-slate-700 dark:text-slate-300 text-sm font-semibold transition-all cursor-pointer border-0 flex-shrink-0" data-v-857e1ba5${_scopeId}>`);
						_push(ssrRenderComponent(unref(RefreshCw), { class: "h-4 w-4" }, null, _parent, _scopeId));
						_push(` Refresh </button></div></div><div class="flex flex-wrap items-center gap-3 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl px-4 py-3 shadow-sm" data-v-857e1ba5${_scopeId}><div class="flex items-center gap-2 pr-3 border-r border-slate-200 dark:border-slate-700 flex-shrink-0" data-v-857e1ba5${_scopeId}><div class="p-1.5 rounded-lg bg-red-500/10" data-v-857e1ba5${_scopeId}>`);
						_push(ssrRenderComponent(unref(Filter), { class: "h-3.5 w-3.5 text-red-500" }, null, _parent, _scopeId));
						_push(`</div><span class="text-xs font-bold text-slate-700 dark:text-slate-300 uppercase tracking-wider" data-v-857e1ba5${_scopeId}>Filter</span></div><div class="flex items-center gap-2" data-v-857e1ba5${_scopeId}><span class="text-xs font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-wide flex-shrink-0" data-v-857e1ba5${_scopeId}>Bulan</span><input type="month"${ssrRenderAttr("value", filterMonth.value)} class="h-8 px-2.5 text-xs font-semibold border border-slate-200 dark:border-slate-700 rounded-lg bg-slate-50 dark:bg-slate-800 text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all cursor-pointer" data-v-857e1ba5${_scopeId}></div><div class="h-5 w-px bg-slate-200 dark:bg-slate-700 flex-shrink-0" data-v-857e1ba5${_scopeId}></div><div class="flex items-center gap-2" data-v-857e1ba5${_scopeId}><span class="text-xs font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-wide flex-shrink-0" data-v-857e1ba5${_scopeId}>Outlet</span><select class="h-8 px-2.5 pr-7 text-xs font-semibold border border-slate-200 dark:border-slate-700 rounded-lg bg-slate-50 dark:bg-slate-800 text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all cursor-pointer appearance-none" data-v-857e1ba5${_scopeId}><option value="" data-v-857e1ba5${ssrIncludeBooleanAttr(Array.isArray(filterOutletId.value) ? ssrLooseContain(filterOutletId.value, "") : ssrLooseEqual(filterOutletId.value, "")) ? " selected" : ""}${_scopeId}>Semua Outlet</option><!--[-->`);
						ssrRenderList(__props.outlets, (o) => {
							_push(`<option${ssrRenderAttr("value", String(o.id))} data-v-857e1ba5${ssrIncludeBooleanAttr(Array.isArray(filterOutletId.value) ? ssrLooseContain(filterOutletId.value, String(o.id)) : ssrLooseEqual(filterOutletId.value, String(o.id))) ? " selected" : ""}${_scopeId}>${ssrInterpolate(o.name)}</option>`);
						});
						_push(`<!--]--></select></div><div class="flex items-center gap-2 ml-auto" data-v-857e1ba5${_scopeId}><div class="hidden sm:flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-slate-100 dark:bg-slate-800 text-xs font-semibold text-slate-600 dark:text-slate-300" data-v-857e1ba5${_scopeId}><span class="text-slate-400" data-v-857e1ba5${_scopeId}>📅</span> ${ssrInterpolate((/* @__PURE__ */ new Date(filterMonth.value + "-01")).toLocaleDateString("id-ID", {
							month: "short",
							year: "numeric"
						}))} `);
						if (filterOutletId.value) _push(`<!--[--><span class="text-slate-300 dark:text-slate-600" data-v-857e1ba5${_scopeId}>·</span><span data-v-857e1ba5${_scopeId}>${ssrInterpolate(__props.outlets.find((o) => String(o.id) === filterOutletId.value)?.name)}</span><!--]-->`);
						else _push(`<!---->`);
						_push(`</div>`);
						if (hasActiveFilters.value) {
							_push(`<button class="flex items-center gap-1 h-8 px-3 text-xs font-bold rounded-lg text-rose-600 dark:text-rose-400 bg-rose-50 dark:bg-rose-500/10 hover:bg-rose-100 dark:hover:bg-rose-500/20 transition-colors cursor-pointer border-0 flex-shrink-0" data-v-857e1ba5${_scopeId}>`);
							_push(ssrRenderComponent(unref(X), { class: "h-3 w-3" }, null, _parent, _scopeId));
							_push(` Reset </button>`);
						} else _push(`<!---->`);
						_push(`</div></div></div><div class="grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4 mb-6" data-v-857e1ba5${_scopeId}><div class="relative overflow-hidden bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl p-5 shadow-sm group hover:shadow-md transition-shadow" data-v-857e1ba5${_scopeId}><div class="absolute inset-x-0 top-0 h-0.5 bg-gradient-to-r from-rose-500 via-red-500 to-orange-400 rounded-t-2xl" data-v-857e1ba5${_scopeId}></div><div class="flex items-start justify-between mb-3" data-v-857e1ba5${_scopeId}><div class="p-2.5 rounded-xl bg-rose-500/10" data-v-857e1ba5${_scopeId}>`);
						_push(ssrRenderComponent(unref(ShoppingBag), { class: "h-5 w-5 text-rose-500" }, null, _parent, _scopeId));
						_push(`</div><span class="${ssrRenderClass([
							"flex items-center gap-1 text-xs font-bold px-2 py-1 rounded-lg",
							trendBg(__props.kpi.revenue_today_pct),
							trendClass(__props.kpi.revenue_today_pct)
						])}" data-v-857e1ba5${_scopeId}>`);
						ssrRenderVNode(_push, createVNode(resolveDynamicComponent(trendIcon(__props.kpi.revenue_today_pct)), { class: "h-3.5 w-3.5" }, null), _parent, _scopeId);
						_push(` ${ssrInterpolate(Math.abs(__props.kpi.revenue_today_pct))}% </span></div><div class="text-2xl font-black text-slate-900 dark:text-slate-50 tracking-tight" data-v-857e1ba5${_scopeId}>${ssrInterpolate(formatCurrency(__props.kpi.revenue_today))}</div><div class="text-xs font-semibold text-slate-500 dark:text-slate-400 mt-1" data-v-857e1ba5${_scopeId}>Revenue Today</div><div class="text-xs text-slate-400 mt-0.5" data-v-857e1ba5${_scopeId}>vs yesterday</div></div><div class="relative overflow-hidden bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl p-5 shadow-sm group hover:shadow-md transition-shadow" data-v-857e1ba5${_scopeId}><div class="absolute inset-x-0 top-0 h-0.5 bg-gradient-to-r from-blue-500 to-cyan-400 rounded-t-2xl" data-v-857e1ba5${_scopeId}></div><div class="flex items-start justify-between mb-3" data-v-857e1ba5${_scopeId}><div class="p-2.5 rounded-xl bg-blue-500/10" data-v-857e1ba5${_scopeId}>`);
						_push(ssrRenderComponent(unref(ReceiptText), { class: "h-5 w-5 text-blue-500" }, null, _parent, _scopeId));
						_push(`</div><span class="${ssrRenderClass([
							"flex items-center gap-1 text-xs font-bold px-2 py-1 rounded-lg",
							trendBg(__props.kpi.tx_today_pct),
							trendClass(__props.kpi.tx_today_pct)
						])}" data-v-857e1ba5${_scopeId}>`);
						ssrRenderVNode(_push, createVNode(resolveDynamicComponent(trendIcon(__props.kpi.tx_today_pct)), { class: "h-3.5 w-3.5" }, null), _parent, _scopeId);
						_push(` ${ssrInterpolate(Math.abs(__props.kpi.tx_today_pct))}% </span></div><div class="text-2xl font-black text-slate-900 dark:text-slate-50 tracking-tight" data-v-857e1ba5${_scopeId}>${ssrInterpolate(formatNumber(__props.kpi.tx_today))}</div><div class="text-xs font-semibold text-slate-500 dark:text-slate-400 mt-1" data-v-857e1ba5${_scopeId}>Transactions Today</div><div class="text-xs text-slate-400 mt-0.5" data-v-857e1ba5${_scopeId}>${ssrInterpolate(formatNumber(__props.kpi.tx_month))} this month</div></div><div class="relative overflow-hidden bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl p-5 shadow-sm group hover:shadow-md transition-shadow" data-v-857e1ba5${_scopeId}><div class="absolute inset-x-0 top-0 h-0.5 bg-gradient-to-r from-violet-500 to-purple-400 rounded-t-2xl" data-v-857e1ba5${_scopeId}></div><div class="flex items-start justify-between mb-3" data-v-857e1ba5${_scopeId}><div class="p-2.5 rounded-xl bg-violet-500/10" data-v-857e1ba5${_scopeId}>`);
						_push(ssrRenderComponent(unref(BarChart3), { class: "h-5 w-5 text-violet-500" }, null, _parent, _scopeId));
						_push(`</div><span class="${ssrRenderClass([
							"flex items-center gap-1 text-xs font-bold px-2 py-1 rounded-lg",
							trendBg(__props.kpi.avg_ticket_pct),
							trendClass(__props.kpi.avg_ticket_pct)
						])}" data-v-857e1ba5${_scopeId}>`);
						ssrRenderVNode(_push, createVNode(resolveDynamicComponent(trendIcon(__props.kpi.avg_ticket_pct)), { class: "h-3.5 w-3.5" }, null), _parent, _scopeId);
						_push(` ${ssrInterpolate(Math.abs(__props.kpi.avg_ticket_pct))}% </span></div><div class="text-2xl font-black text-slate-900 dark:text-slate-50 tracking-tight" data-v-857e1ba5${_scopeId}>${ssrInterpolate(formatCurrency(__props.kpi.avg_ticket_today))}</div><div class="text-xs font-semibold text-slate-500 dark:text-slate-400 mt-1" data-v-857e1ba5${_scopeId}>Avg. Ticket Today</div><div class="text-xs text-slate-400 mt-0.5" data-v-857e1ba5${_scopeId}>per transaction</div></div><div class="${ssrRenderClass([__props.kpi.low_stock_count > 0 ? "border-rose-300 dark:border-rose-900" : "border-slate-200 dark:border-slate-800", "relative overflow-hidden bg-white dark:bg-slate-900 border rounded-2xl p-5 shadow-sm group hover:shadow-md transition-shadow"])}" data-v-857e1ba5${_scopeId}><div class="${ssrRenderClass([__props.kpi.low_stock_count > 0 ? "bg-gradient-to-r from-rose-500 to-orange-400" : "bg-gradient-to-r from-emerald-500 to-teal-400", "absolute inset-x-0 top-0 h-0.5 rounded-t-2xl"])}" data-v-857e1ba5${_scopeId}></div><div class="flex items-start justify-between mb-3" data-v-857e1ba5${_scopeId}><div class="${ssrRenderClass([__props.kpi.low_stock_count > 0 ? "bg-rose-500/10" : "bg-emerald-500/10", "p-2.5 rounded-xl"])}" data-v-857e1ba5${_scopeId}>`);
						_push(ssrRenderComponent(unref(AlertTriangle), { class: ["h-5 w-5", __props.kpi.low_stock_count > 0 ? "text-rose-500" : "text-emerald-500"] }, null, _parent, _scopeId));
						_push(`</div>`);
						if (__props.kpi.low_stock_count > 0) _push(`<span class="flex items-center gap-1 text-xs font-bold px-2 py-1 rounded-lg bg-rose-500/10 text-rose-500 animate-pulse" data-v-857e1ba5${_scopeId}> Critical </span>`);
						else _push(`<span class="flex items-center gap-1 text-xs font-bold px-2 py-1 rounded-lg bg-emerald-500/10 text-emerald-500" data-v-857e1ba5${_scopeId}> All Good </span>`);
						_push(`</div><div class="${ssrRenderClass([__props.kpi.low_stock_count > 0 ? "text-rose-500" : "text-slate-900 dark:text-slate-50", "text-2xl font-black tracking-tight"])}" data-v-857e1ba5${_scopeId}>${ssrInterpolate(formatNumber(__props.kpi.low_stock_count))}</div><div class="text-xs font-semibold text-slate-500 dark:text-slate-400 mt-1" data-v-857e1ba5${_scopeId}>Low Stock Alerts</div><div class="text-xs text-slate-400 mt-0.5" data-v-857e1ba5${_scopeId}>items at or below threshold</div></div></div><div class="grid grid-cols-1 sm:grid-cols-3 gap-4 mb-6" data-v-857e1ba5${_scopeId}><div class="bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl p-5 shadow-sm flex items-center gap-4" data-v-857e1ba5${_scopeId}><div class="p-3 rounded-xl bg-amber-500/10 flex-shrink-0" data-v-857e1ba5${_scopeId}>`);
						_push(ssrRenderComponent(unref(ShoppingBag), { class: "h-6 w-6 text-amber-500" }, null, _parent, _scopeId));
						_push(`</div><div data-v-857e1ba5${_scopeId}><div class="text-xl font-black text-slate-900 dark:text-slate-50" data-v-857e1ba5${_scopeId}>${ssrInterpolate(formatCurrency(__props.kpi.revenue_month))}</div><div class="text-xs font-semibold text-slate-500 dark:text-slate-400" data-v-857e1ba5${_scopeId}>Revenue This Month</div><div class="text-xs text-slate-400" data-v-857e1ba5${_scopeId}>${ssrInterpolate(formatCurrency(__props.kpi.revenue_week))} this week</div></div></div><div class="bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl p-5 shadow-sm flex items-center gap-4" data-v-857e1ba5${_scopeId}><div class="p-3 rounded-xl bg-sky-500/10 flex-shrink-0" data-v-857e1ba5${_scopeId}>`);
						_push(ssrRenderComponent(unref(Store), { class: "h-6 w-6 text-sky-500" }, null, _parent, _scopeId));
						_push(`</div><div data-v-857e1ba5${_scopeId}><div class="text-xl font-black text-slate-900 dark:text-slate-50" data-v-857e1ba5${_scopeId}>${ssrInterpolate(__props.kpi.active_outlets)}</div><div class="text-xs font-semibold text-slate-500 dark:text-slate-400" data-v-857e1ba5${_scopeId}>Active Outlets</div><div class="text-xs text-slate-400" data-v-857e1ba5${_scopeId}>${ssrInterpolate(__props.kpi.active_products)} active products</div></div></div><div class="bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl p-5 shadow-sm flex items-center gap-4" data-v-857e1ba5${_scopeId}><div class="p-3 rounded-xl bg-indigo-500/10 flex-shrink-0" data-v-857e1ba5${_scopeId}>`);
						_push(ssrRenderComponent(unref(Truck), { class: "h-6 w-6 text-indigo-500" }, null, _parent, _scopeId));
						_push(`</div><div data-v-857e1ba5${_scopeId}><div class="text-xl font-black text-slate-900 dark:text-slate-50" data-v-857e1ba5${_scopeId}>${ssrInterpolate(__props.kpi.total_suppliers)}</div><div class="text-xs font-semibold text-slate-500 dark:text-slate-400" data-v-857e1ba5${_scopeId}>Registered Suppliers</div><div class="text-xs text-slate-400" data-v-857e1ba5${_scopeId}>across all outlets</div></div></div></div><div class="grid grid-cols-1 xl:grid-cols-3 gap-4 mb-6 items-stretch" data-v-857e1ba5${_scopeId}><div class="xl:col-span-2 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl p-5 shadow-sm flex flex-col" data-v-857e1ba5${_scopeId}><div class="flex items-center justify-between mb-1 flex-shrink-0" data-v-857e1ba5${_scopeId}><h2 class="text-sm font-bold text-slate-900 dark:text-slate-50" data-v-857e1ba5${_scopeId}>Sales Trend</h2><span class="text-xs text-slate-400 font-medium" data-v-857e1ba5${_scopeId}>${ssrInterpolate((/* @__PURE__ */ new Date(filterMonth.value + "-01")).toLocaleDateString("id-ID", {
							month: "long",
							year: "numeric"
						}))}</span></div>`);
						if (__props.salesTrend.length > 0) {
							_push(`<div class="flex-1 w-full min-h-[280px]" data-v-857e1ba5${_scopeId}>`);
							_push(ssrRenderComponent(unref(VueApexCharts), {
								key: chartKey.value,
								type: "area",
								height: "100%",
								options: salesTrendOptions.value,
								series: salesTrendSeries.value
							}, null, _parent, _scopeId));
							_push(`</div>`);
						} else _push(`<div class="flex-1 flex items-center justify-center text-slate-400 text-sm italic min-h-[200px]" data-v-857e1ba5${_scopeId}> No sales data in this period. </div>`);
						_push(`</div><div class="bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl p-5 shadow-sm" data-v-857e1ba5${_scopeId}><div class="flex items-center justify-between mb-1" data-v-857e1ba5${_scopeId}><h2 class="text-sm font-bold text-slate-900 dark:text-slate-50" data-v-857e1ba5${_scopeId}>Payment Methods</h2><span class="text-xs text-slate-400 font-medium" data-v-857e1ba5${_scopeId}>This month</span></div><p class="text-xs text-slate-500 dark:text-slate-400 mb-2" data-v-857e1ba5${_scopeId}>Transaction split by method</p>`);
						if (__props.paymentSplit.length > 0) {
							_push(`<div data-v-857e1ba5${_scopeId}>`);
							_push(ssrRenderComponent(unref(VueApexCharts), {
								type: "donut",
								height: "220",
								options: paymentDonutOptions.value,
								series: paymentDonutSeries.value
							}, null, _parent, _scopeId));
							_push(`<div class="mt-2 space-y-2" data-v-857e1ba5${_scopeId}><!--[-->`);
							ssrRenderList(__props.paymentSplit, (p) => {
								_push(`<div class="flex items-center justify-between text-xs" data-v-857e1ba5${_scopeId}><div class="flex items-center gap-2" data-v-857e1ba5${_scopeId}><div class="${ssrRenderClass(["p-1.5 rounded-md", paymentBg(p.method)])}" data-v-857e1ba5${_scopeId}>`);
								ssrRenderVNode(_push, createVNode(resolveDynamicComponent(paymentIcon(p.method)), { class: ["h-3 w-3", paymentColor(p.method)] }, null), _parent, _scopeId);
								_push(`</div><span class="font-semibold text-slate-700 dark:text-slate-300" data-v-857e1ba5${_scopeId}>${ssrInterpolate(paymentLabel(p.method))}</span></div><div class="text-right" data-v-857e1ba5${_scopeId}><div class="font-bold text-slate-900 dark:text-slate-100" data-v-857e1ba5${_scopeId}>${ssrInterpolate(formatCurrency(p.total))}</div><div class="text-slate-400" data-v-857e1ba5${_scopeId}>${ssrInterpolate(p.count)} txn</div></div></div>`);
							});
							_push(`<!--]--></div></div>`);
						} else _push(`<div class="h-52 flex items-center justify-center text-slate-400 text-sm italic" data-v-857e1ba5${_scopeId}> No transactions this month. </div>`);
						_push(`</div></div><div class="grid grid-cols-1 xl:grid-cols-2 gap-4 mb-6" data-v-857e1ba5${_scopeId}><div class="bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl p-5 shadow-sm" data-v-857e1ba5${_scopeId}><div class="flex items-center justify-between mb-1" data-v-857e1ba5${_scopeId}><h2 class="text-sm font-bold text-slate-900 dark:text-slate-50" data-v-857e1ba5${_scopeId}>Top 5 Products</h2><span class="text-xs text-slate-400 font-medium" data-v-857e1ba5${_scopeId}>This month</span></div><p class="text-xs text-slate-500 dark:text-slate-400 mb-3" data-v-857e1ba5${_scopeId}>By quantity sold</p>`);
						if (__props.topProducts.length > 0) {
							_push(`<div data-v-857e1ba5${_scopeId}>`);
							_push(ssrRenderComponent(unref(VueApexCharts), {
								type: "bar",
								height: "220",
								options: topProductsOptions.value,
								series: topProductsSeries.value
							}, null, _parent, _scopeId));
							_push(`</div>`);
						} else _push(`<div class="h-52 flex items-center justify-center text-slate-400 text-sm italic" data-v-857e1ba5${_scopeId}> No product sales data. </div>`);
						_push(`</div><div class="bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl p-5 shadow-sm" data-v-857e1ba5${_scopeId}><div class="flex items-center justify-between mb-1" data-v-857e1ba5${_scopeId}><h2 class="text-sm font-bold text-slate-900 dark:text-slate-50" data-v-857e1ba5${_scopeId}>Revenue by Outlet</h2><span class="text-xs text-slate-400 font-medium" data-v-857e1ba5${_scopeId}>This month</span></div><p class="text-xs text-slate-500 dark:text-slate-400 mb-3" data-v-857e1ba5${_scopeId}>Contribution per location</p>`);
						if (__props.revenueByOutlet.length > 0) {
							_push(`<div data-v-857e1ba5${_scopeId}>`);
							_push(ssrRenderComponent(unref(VueApexCharts), {
								type: "bar",
								height: "220",
								options: outletRevenueOptions.value,
								series: outletRevenueSeries.value
							}, null, _parent, _scopeId));
							_push(`</div>`);
						} else _push(`<div class="h-52 flex items-center justify-center text-slate-400 text-sm italic" data-v-857e1ba5${_scopeId}> No outlet revenue data. </div>`);
						_push(`</div></div><div class="grid grid-cols-1 xl:grid-cols-2 gap-4 mb-4" data-v-857e1ba5${_scopeId}><div class="bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-sm overflow-hidden" data-v-857e1ba5${_scopeId}><div class="px-5 py-4 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between" data-v-857e1ba5${_scopeId}><div data-v-857e1ba5${_scopeId}><h2 class="text-sm font-bold text-slate-900 dark:text-slate-50" data-v-857e1ba5${_scopeId}>Recent Transactions</h2><p class="text-xs text-slate-400 mt-0.5" data-v-857e1ba5${_scopeId}>Last 8 successful orders</p></div><a href="/admin/transactions" class="flex items-center gap-1 text-xs font-semibold text-rose-500 hover:text-rose-600 transition-colors" data-v-857e1ba5${_scopeId}> View All `);
						_push(ssrRenderComponent(unref(ArrowRight), { class: "h-3.5 w-3.5" }, null, _parent, _scopeId));
						_push(`</a></div>`);
						if (__props.recentTransactions.length > 0) {
							_push(`<div class="divide-y divide-slate-100 dark:divide-slate-800" data-v-857e1ba5${_scopeId}><!--[-->`);
							ssrRenderList(__props.recentTransactions, (tx) => {
								_push(`<div class="flex items-center gap-3 px-5 py-3 hover:bg-slate-50 dark:hover:bg-slate-800/50 transition-colors" data-v-857e1ba5${_scopeId}><div class="flex-shrink-0" data-v-857e1ba5${_scopeId}><div class="${ssrRenderClass(["p-2 rounded-lg", paymentBg(tx.payment_method)])}" data-v-857e1ba5${_scopeId}>`);
								ssrRenderVNode(_push, createVNode(resolveDynamicComponent(paymentIcon(tx.payment_method)), { class: ["h-3.5 w-3.5", paymentColor(tx.payment_method)] }, null), _parent, _scopeId);
								_push(`</div></div><div class="flex-1 min-w-0" data-v-857e1ba5${_scopeId}><div class="text-xs font-bold text-slate-900 dark:text-slate-100 truncate" data-v-857e1ba5${_scopeId}>${ssrInterpolate(tx.transaction_number)}</div><div class="text-xs text-slate-400 truncate" data-v-857e1ba5${_scopeId}>${ssrInterpolate(tx.outlet_name)} · ${ssrInterpolate(tx.items_count)} item(s) · ${ssrInterpolate(tx.cashier_name)}</div></div><div class="text-right flex-shrink-0" data-v-857e1ba5${_scopeId}><div class="text-xs font-bold text-slate-900 dark:text-slate-100" data-v-857e1ba5${_scopeId}>${ssrInterpolate(formatCurrency(tx.total_amount))}</div><div class="text-xs text-slate-400" data-v-857e1ba5${_scopeId}>${ssrInterpolate(tx.created_at)}</div></div></div>`);
							});
							_push(`<!--]--></div>`);
						} else _push(`<div class="p-8 text-center text-slate-400 text-sm italic" data-v-857e1ba5${_scopeId}> No transactions yet. </div>`);
						_push(`</div><div class="bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-sm overflow-hidden" data-v-857e1ba5${_scopeId}><div class="px-5 py-4 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between" data-v-857e1ba5${_scopeId}><div data-v-857e1ba5${_scopeId}><h2 class="text-sm font-bold text-slate-900 dark:text-slate-50 flex items-center gap-2" data-v-857e1ba5${_scopeId}> Low Stock Alerts `);
						if (__props.lowStockAlerts.length > 0) _push(`<span class="inline-flex items-center px-1.5 py-0.5 rounded-full bg-rose-500 text-white text-xs font-bold" data-v-857e1ba5${_scopeId}>${ssrInterpolate(__props.lowStockAlerts.length)}</span>`);
						else _push(`<!---->`);
						_push(`</h2><p class="text-xs text-slate-400 mt-0.5" data-v-857e1ba5${_scopeId}>Items at or below safety threshold</p></div><a href="/admin/ingredients" class="flex items-center gap-1 text-xs font-semibold text-rose-500 hover:text-rose-600 transition-colors" data-v-857e1ba5${_scopeId}> Manage `);
						_push(ssrRenderComponent(unref(ArrowRight), { class: "h-3.5 w-3.5" }, null, _parent, _scopeId));
						_push(`</a></div>`);
						if (__props.lowStockAlerts.length > 0) {
							_push(`<div class="divide-y divide-slate-100 dark:divide-slate-800 max-h-80 overflow-y-auto" data-v-857e1ba5${_scopeId}><!--[-->`);
							ssrRenderList(__props.lowStockAlerts, (item, idx) => {
								_push(`<div class="px-5 py-3 hover:bg-slate-50 dark:hover:bg-slate-800/50 transition-colors" data-v-857e1ba5${_scopeId}><div class="flex items-center justify-between mb-1.5" data-v-857e1ba5${_scopeId}><div class="flex items-center gap-2 min-w-0" data-v-857e1ba5${_scopeId}><span class="${ssrRenderClass(["text-xs font-bold px-1.5 py-0.5 rounded-md flex-shrink-0", item.type === "Ingredient" ? "bg-amber-500/10 text-amber-600 dark:text-amber-400" : "bg-sky-500/10 text-sky-600 dark:text-sky-400"])}" data-v-857e1ba5${_scopeId}>${ssrInterpolate(item.type === "Ingredient" ? "ING" : "RTL")}</span><span class="text-xs font-bold text-slate-900 dark:text-slate-100 truncate" data-v-857e1ba5${_scopeId}>${ssrInterpolate(item.name)}</span></div><span class="text-xs text-slate-400 flex-shrink-0 ml-2" data-v-857e1ba5${_scopeId}>${ssrInterpolate(item.outlet_name)}</span></div><div class="flex items-center gap-2" data-v-857e1ba5${_scopeId}><div class="flex-1 bg-slate-200 dark:bg-slate-700 rounded-full h-1.5 overflow-hidden" data-v-857e1ba5${_scopeId}><div class="${ssrRenderClass([stockPct(item) <= 30 ? "bg-rose-500" : stockPct(item) <= 70 ? "bg-amber-500" : "bg-emerald-500", "h-full rounded-full transition-all"])}" style="${ssrRenderStyle({ width: stockPct(item) + "%" })}" data-v-857e1ba5${_scopeId}></div></div><span class="text-xs font-semibold text-slate-500 dark:text-slate-400 flex-shrink-0 w-28 text-right" data-v-857e1ba5${_scopeId}>${ssrInterpolate(item.stock_qty)} / ${ssrInterpolate(item.threshold_qty)} ${ssrInterpolate(item.unit)}</span></div></div>`);
							});
							_push(`<!--]--></div>`);
						} else {
							_push(`<div class="p-8 text-center" data-v-857e1ba5${_scopeId}><div class="inline-flex items-center justify-center p-3 rounded-full bg-emerald-500/10 mb-3" data-v-857e1ba5${_scopeId}>`);
							_push(ssrRenderComponent(unref(Package), { class: "h-6 w-6 text-emerald-500" }, null, _parent, _scopeId));
							_push(`</div><p class="text-sm font-semibold text-slate-700 dark:text-slate-300" data-v-857e1ba5${_scopeId}>All stock levels are healthy</p><p class="text-xs text-slate-400 mt-1" data-v-857e1ba5${_scopeId}>No items are below their safety threshold.</p></div>`);
						}
						_push(`</div></div>`);
					} else return [
						createVNode("div", { class: "mb-6" }, [createVNode("div", { class: "flex flex-col sm:flex-row sm:items-start justify-between gap-3 mb-4" }, [createVNode("div", null, [createVNode("h1", { class: "text-2xl font-extrabold text-slate-900 dark:text-slate-50 tracking-tight" }, " Business Overview "), createVNode("p", { class: "text-sm text-slate-500 dark:text-slate-400 mt-0.5 flex items-center gap-1.5" }, [createVNode(unref(Clock), { class: "h-3.5 w-3.5" }), createTextVNode(" " + toDisplayString(nowStr.value), 1)])]), createVNode("div", { class: "flex items-center gap-2 self-start flex-shrink-0" }, [createVNode("button", {
							onClick: refresh,
							class: "flex items-center gap-2 px-4 py-2 rounded-xl bg-slate-100 dark:bg-slate-800 hover:bg-slate-200 dark:hover:bg-slate-700 text-slate-700 dark:text-slate-300 text-sm font-semibold transition-all cursor-pointer border-0 flex-shrink-0"
						}, [createVNode(unref(RefreshCw), { class: "h-4 w-4" }), createTextVNode(" Refresh ")])])]), createVNode("div", { class: "flex flex-wrap items-center gap-3 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl px-4 py-3 shadow-sm" }, [
							createVNode("div", { class: "flex items-center gap-2 pr-3 border-r border-slate-200 dark:border-slate-700 flex-shrink-0" }, [createVNode("div", { class: "p-1.5 rounded-lg bg-red-500/10" }, [createVNode(unref(Filter), { class: "h-3.5 w-3.5 text-red-500" })]), createVNode("span", { class: "text-xs font-bold text-slate-700 dark:text-slate-300 uppercase tracking-wider" }, "Filter")]),
							createVNode("div", { class: "flex items-center gap-2" }, [createVNode("span", { class: "text-xs font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-wide flex-shrink-0" }, "Bulan"), withDirectives(createVNode("input", {
								type: "month",
								"onUpdate:modelValue": ($event) => filterMonth.value = $event,
								onChange: applyFilters,
								class: "h-8 px-2.5 text-xs font-semibold border border-slate-200 dark:border-slate-700 rounded-lg bg-slate-50 dark:bg-slate-800 text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all cursor-pointer"
							}, null, 40, ["onUpdate:modelValue"]), [[vModelText, filterMonth.value]])]),
							createVNode("div", { class: "h-5 w-px bg-slate-200 dark:bg-slate-700 flex-shrink-0" }),
							createVNode("div", { class: "flex items-center gap-2" }, [createVNode("span", { class: "text-xs font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-wide flex-shrink-0" }, "Outlet"), withDirectives(createVNode("select", {
								"onUpdate:modelValue": ($event) => filterOutletId.value = $event,
								onChange: applyFilters,
								class: "h-8 px-2.5 pr-7 text-xs font-semibold border border-slate-200 dark:border-slate-700 rounded-lg bg-slate-50 dark:bg-slate-800 text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-red-500/20 focus:border-red-500 transition-all cursor-pointer appearance-none"
							}, [createVNode("option", { value: "" }, "Semua Outlet"), (openBlock(true), createBlock(Fragment, null, renderList(__props.outlets, (o) => {
								return openBlock(), createBlock("option", {
									key: o.id,
									value: String(o.id)
								}, toDisplayString(o.name), 9, ["value"]);
							}), 128))], 40, ["onUpdate:modelValue"]), [[vModelSelect, filterOutletId.value]])]),
							createVNode("div", { class: "flex items-center gap-2 ml-auto" }, [createVNode("div", { class: "hidden sm:flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-slate-100 dark:bg-slate-800 text-xs font-semibold text-slate-600 dark:text-slate-300" }, [
								createVNode("span", { class: "text-slate-400" }, "📅"),
								createTextVNode(" " + toDisplayString((/* @__PURE__ */ new Date(filterMonth.value + "-01")).toLocaleDateString("id-ID", {
									month: "short",
									year: "numeric"
								})) + " ", 1),
								filterOutletId.value ? (openBlock(), createBlock(Fragment, { key: 0 }, [createVNode("span", { class: "text-slate-300 dark:text-slate-600" }, "·"), createVNode("span", null, toDisplayString(__props.outlets.find((o) => String(o.id) === filterOutletId.value)?.name), 1)], 64)) : createCommentVNode("", true)
							]), createVNode(Transition, { name: "fade" }, {
								default: withCtx(() => [hasActiveFilters.value ? (openBlock(), createBlock("button", {
									key: 0,
									onClick: resetFilters,
									class: "flex items-center gap-1 h-8 px-3 text-xs font-bold rounded-lg text-rose-600 dark:text-rose-400 bg-rose-50 dark:bg-rose-500/10 hover:bg-rose-100 dark:hover:bg-rose-500/20 transition-colors cursor-pointer border-0 flex-shrink-0"
								}, [createVNode(unref(X), { class: "h-3 w-3" }), createTextVNode(" Reset ")])) : createCommentVNode("", true)]),
								_: 1
							})])
						])]),
						createVNode("div", { class: "grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4 mb-6" }, [
							createVNode("div", { class: "relative overflow-hidden bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl p-5 shadow-sm group hover:shadow-md transition-shadow" }, [
								createVNode("div", { class: "absolute inset-x-0 top-0 h-0.5 bg-gradient-to-r from-rose-500 via-red-500 to-orange-400 rounded-t-2xl" }),
								createVNode("div", { class: "flex items-start justify-between mb-3" }, [createVNode("div", { class: "p-2.5 rounded-xl bg-rose-500/10" }, [createVNode(unref(ShoppingBag), { class: "h-5 w-5 text-rose-500" })]), createVNode("span", { class: [
									"flex items-center gap-1 text-xs font-bold px-2 py-1 rounded-lg",
									trendBg(__props.kpi.revenue_today_pct),
									trendClass(__props.kpi.revenue_today_pct)
								] }, [(openBlock(), createBlock(resolveDynamicComponent(trendIcon(__props.kpi.revenue_today_pct)), { class: "h-3.5 w-3.5" })), createTextVNode(" " + toDisplayString(Math.abs(__props.kpi.revenue_today_pct)) + "% ", 1)], 2)]),
								createVNode("div", { class: "text-2xl font-black text-slate-900 dark:text-slate-50 tracking-tight" }, toDisplayString(formatCurrency(__props.kpi.revenue_today)), 1),
								createVNode("div", { class: "text-xs font-semibold text-slate-500 dark:text-slate-400 mt-1" }, "Revenue Today"),
								createVNode("div", { class: "text-xs text-slate-400 mt-0.5" }, "vs yesterday")
							]),
							createVNode("div", { class: "relative overflow-hidden bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl p-5 shadow-sm group hover:shadow-md transition-shadow" }, [
								createVNode("div", { class: "absolute inset-x-0 top-0 h-0.5 bg-gradient-to-r from-blue-500 to-cyan-400 rounded-t-2xl" }),
								createVNode("div", { class: "flex items-start justify-between mb-3" }, [createVNode("div", { class: "p-2.5 rounded-xl bg-blue-500/10" }, [createVNode(unref(ReceiptText), { class: "h-5 w-5 text-blue-500" })]), createVNode("span", { class: [
									"flex items-center gap-1 text-xs font-bold px-2 py-1 rounded-lg",
									trendBg(__props.kpi.tx_today_pct),
									trendClass(__props.kpi.tx_today_pct)
								] }, [(openBlock(), createBlock(resolveDynamicComponent(trendIcon(__props.kpi.tx_today_pct)), { class: "h-3.5 w-3.5" })), createTextVNode(" " + toDisplayString(Math.abs(__props.kpi.tx_today_pct)) + "% ", 1)], 2)]),
								createVNode("div", { class: "text-2xl font-black text-slate-900 dark:text-slate-50 tracking-tight" }, toDisplayString(formatNumber(__props.kpi.tx_today)), 1),
								createVNode("div", { class: "text-xs font-semibold text-slate-500 dark:text-slate-400 mt-1" }, "Transactions Today"),
								createVNode("div", { class: "text-xs text-slate-400 mt-0.5" }, toDisplayString(formatNumber(__props.kpi.tx_month)) + " this month", 1)
							]),
							createVNode("div", { class: "relative overflow-hidden bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl p-5 shadow-sm group hover:shadow-md transition-shadow" }, [
								createVNode("div", { class: "absolute inset-x-0 top-0 h-0.5 bg-gradient-to-r from-violet-500 to-purple-400 rounded-t-2xl" }),
								createVNode("div", { class: "flex items-start justify-between mb-3" }, [createVNode("div", { class: "p-2.5 rounded-xl bg-violet-500/10" }, [createVNode(unref(BarChart3), { class: "h-5 w-5 text-violet-500" })]), createVNode("span", { class: [
									"flex items-center gap-1 text-xs font-bold px-2 py-1 rounded-lg",
									trendBg(__props.kpi.avg_ticket_pct),
									trendClass(__props.kpi.avg_ticket_pct)
								] }, [(openBlock(), createBlock(resolveDynamicComponent(trendIcon(__props.kpi.avg_ticket_pct)), { class: "h-3.5 w-3.5" })), createTextVNode(" " + toDisplayString(Math.abs(__props.kpi.avg_ticket_pct)) + "% ", 1)], 2)]),
								createVNode("div", { class: "text-2xl font-black text-slate-900 dark:text-slate-50 tracking-tight" }, toDisplayString(formatCurrency(__props.kpi.avg_ticket_today)), 1),
								createVNode("div", { class: "text-xs font-semibold text-slate-500 dark:text-slate-400 mt-1" }, "Avg. Ticket Today"),
								createVNode("div", { class: "text-xs text-slate-400 mt-0.5" }, "per transaction")
							]),
							createVNode("div", { class: ["relative overflow-hidden bg-white dark:bg-slate-900 border rounded-2xl p-5 shadow-sm group hover:shadow-md transition-shadow", __props.kpi.low_stock_count > 0 ? "border-rose-300 dark:border-rose-900" : "border-slate-200 dark:border-slate-800"] }, [
								createVNode("div", { class: ["absolute inset-x-0 top-0 h-0.5 rounded-t-2xl", __props.kpi.low_stock_count > 0 ? "bg-gradient-to-r from-rose-500 to-orange-400" : "bg-gradient-to-r from-emerald-500 to-teal-400"] }, null, 2),
								createVNode("div", { class: "flex items-start justify-between mb-3" }, [createVNode("div", { class: ["p-2.5 rounded-xl", __props.kpi.low_stock_count > 0 ? "bg-rose-500/10" : "bg-emerald-500/10"] }, [createVNode(unref(AlertTriangle), { class: ["h-5 w-5", __props.kpi.low_stock_count > 0 ? "text-rose-500" : "text-emerald-500"] }, null, 8, ["class"])], 2), __props.kpi.low_stock_count > 0 ? (openBlock(), createBlock("span", {
									key: 0,
									class: "flex items-center gap-1 text-xs font-bold px-2 py-1 rounded-lg bg-rose-500/10 text-rose-500 animate-pulse"
								}, " Critical ")) : (openBlock(), createBlock("span", {
									key: 1,
									class: "flex items-center gap-1 text-xs font-bold px-2 py-1 rounded-lg bg-emerald-500/10 text-emerald-500"
								}, " All Good "))]),
								createVNode("div", { class: ["text-2xl font-black tracking-tight", __props.kpi.low_stock_count > 0 ? "text-rose-500" : "text-slate-900 dark:text-slate-50"] }, toDisplayString(formatNumber(__props.kpi.low_stock_count)), 3),
								createVNode("div", { class: "text-xs font-semibold text-slate-500 dark:text-slate-400 mt-1" }, "Low Stock Alerts"),
								createVNode("div", { class: "text-xs text-slate-400 mt-0.5" }, "items at or below threshold")
							], 2)
						]),
						createVNode("div", { class: "grid grid-cols-1 sm:grid-cols-3 gap-4 mb-6" }, [
							createVNode("div", { class: "bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl p-5 shadow-sm flex items-center gap-4" }, [createVNode("div", { class: "p-3 rounded-xl bg-amber-500/10 flex-shrink-0" }, [createVNode(unref(ShoppingBag), { class: "h-6 w-6 text-amber-500" })]), createVNode("div", null, [
								createVNode("div", { class: "text-xl font-black text-slate-900 dark:text-slate-50" }, toDisplayString(formatCurrency(__props.kpi.revenue_month)), 1),
								createVNode("div", { class: "text-xs font-semibold text-slate-500 dark:text-slate-400" }, "Revenue This Month"),
								createVNode("div", { class: "text-xs text-slate-400" }, toDisplayString(formatCurrency(__props.kpi.revenue_week)) + " this week", 1)
							])]),
							createVNode("div", { class: "bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl p-5 shadow-sm flex items-center gap-4" }, [createVNode("div", { class: "p-3 rounded-xl bg-sky-500/10 flex-shrink-0" }, [createVNode(unref(Store), { class: "h-6 w-6 text-sky-500" })]), createVNode("div", null, [
								createVNode("div", { class: "text-xl font-black text-slate-900 dark:text-slate-50" }, toDisplayString(__props.kpi.active_outlets), 1),
								createVNode("div", { class: "text-xs font-semibold text-slate-500 dark:text-slate-400" }, "Active Outlets"),
								createVNode("div", { class: "text-xs text-slate-400" }, toDisplayString(__props.kpi.active_products) + " active products", 1)
							])]),
							createVNode("div", { class: "bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl p-5 shadow-sm flex items-center gap-4" }, [createVNode("div", { class: "p-3 rounded-xl bg-indigo-500/10 flex-shrink-0" }, [createVNode(unref(Truck), { class: "h-6 w-6 text-indigo-500" })]), createVNode("div", null, [
								createVNode("div", { class: "text-xl font-black text-slate-900 dark:text-slate-50" }, toDisplayString(__props.kpi.total_suppliers), 1),
								createVNode("div", { class: "text-xs font-semibold text-slate-500 dark:text-slate-400" }, "Registered Suppliers"),
								createVNode("div", { class: "text-xs text-slate-400" }, "across all outlets")
							])])
						]),
						createVNode("div", { class: "grid grid-cols-1 xl:grid-cols-3 gap-4 mb-6 items-stretch" }, [createVNode("div", { class: "xl:col-span-2 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl p-5 shadow-sm flex flex-col" }, [createVNode("div", { class: "flex items-center justify-between mb-1 flex-shrink-0" }, [createVNode("h2", { class: "text-sm font-bold text-slate-900 dark:text-slate-50" }, "Sales Trend"), createVNode("span", { class: "text-xs text-slate-400 font-medium" }, toDisplayString((/* @__PURE__ */ new Date(filterMonth.value + "-01")).toLocaleDateString("id-ID", {
							month: "long",
							year: "numeric"
						})), 1)]), __props.salesTrend.length > 0 ? (openBlock(), createBlock("div", {
							key: 0,
							class: "flex-1 w-full min-h-[280px]"
						}, [(openBlock(), createBlock(unref(VueApexCharts), {
							key: chartKey.value,
							type: "area",
							height: "100%",
							options: salesTrendOptions.value,
							series: salesTrendSeries.value
						}, null, 8, ["options", "series"]))])) : (openBlock(), createBlock("div", {
							key: 1,
							class: "flex-1 flex items-center justify-center text-slate-400 text-sm italic min-h-[200px]"
						}, " No sales data in this period. "))]), createVNode("div", { class: "bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl p-5 shadow-sm" }, [
							createVNode("div", { class: "flex items-center justify-between mb-1" }, [createVNode("h2", { class: "text-sm font-bold text-slate-900 dark:text-slate-50" }, "Payment Methods"), createVNode("span", { class: "text-xs text-slate-400 font-medium" }, "This month")]),
							createVNode("p", { class: "text-xs text-slate-500 dark:text-slate-400 mb-2" }, "Transaction split by method"),
							__props.paymentSplit.length > 0 ? (openBlock(), createBlock("div", { key: 0 }, [createVNode(unref(VueApexCharts), {
								type: "donut",
								height: "220",
								options: paymentDonutOptions.value,
								series: paymentDonutSeries.value
							}, null, 8, ["options", "series"]), createVNode("div", { class: "mt-2 space-y-2" }, [(openBlock(true), createBlock(Fragment, null, renderList(__props.paymentSplit, (p) => {
								return openBlock(), createBlock("div", {
									key: p.method,
									class: "flex items-center justify-between text-xs"
								}, [createVNode("div", { class: "flex items-center gap-2" }, [createVNode("div", { class: ["p-1.5 rounded-md", paymentBg(p.method)] }, [(openBlock(), createBlock(resolveDynamicComponent(paymentIcon(p.method)), { class: ["h-3 w-3", paymentColor(p.method)] }, null, 8, ["class"]))], 2), createVNode("span", { class: "font-semibold text-slate-700 dark:text-slate-300" }, toDisplayString(paymentLabel(p.method)), 1)]), createVNode("div", { class: "text-right" }, [createVNode("div", { class: "font-bold text-slate-900 dark:text-slate-100" }, toDisplayString(formatCurrency(p.total)), 1), createVNode("div", { class: "text-slate-400" }, toDisplayString(p.count) + " txn", 1)])]);
							}), 128))])])) : (openBlock(), createBlock("div", {
								key: 1,
								class: "h-52 flex items-center justify-center text-slate-400 text-sm italic"
							}, " No transactions this month. "))
						])]),
						createVNode("div", { class: "grid grid-cols-1 xl:grid-cols-2 gap-4 mb-6" }, [createVNode("div", { class: "bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl p-5 shadow-sm" }, [
							createVNode("div", { class: "flex items-center justify-between mb-1" }, [createVNode("h2", { class: "text-sm font-bold text-slate-900 dark:text-slate-50" }, "Top 5 Products"), createVNode("span", { class: "text-xs text-slate-400 font-medium" }, "This month")]),
							createVNode("p", { class: "text-xs text-slate-500 dark:text-slate-400 mb-3" }, "By quantity sold"),
							__props.topProducts.length > 0 ? (openBlock(), createBlock("div", { key: 0 }, [createVNode(unref(VueApexCharts), {
								type: "bar",
								height: "220",
								options: topProductsOptions.value,
								series: topProductsSeries.value
							}, null, 8, ["options", "series"])])) : (openBlock(), createBlock("div", {
								key: 1,
								class: "h-52 flex items-center justify-center text-slate-400 text-sm italic"
							}, " No product sales data. "))
						]), createVNode("div", { class: "bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl p-5 shadow-sm" }, [
							createVNode("div", { class: "flex items-center justify-between mb-1" }, [createVNode("h2", { class: "text-sm font-bold text-slate-900 dark:text-slate-50" }, "Revenue by Outlet"), createVNode("span", { class: "text-xs text-slate-400 font-medium" }, "This month")]),
							createVNode("p", { class: "text-xs text-slate-500 dark:text-slate-400 mb-3" }, "Contribution per location"),
							__props.revenueByOutlet.length > 0 ? (openBlock(), createBlock("div", { key: 0 }, [createVNode(unref(VueApexCharts), {
								type: "bar",
								height: "220",
								options: outletRevenueOptions.value,
								series: outletRevenueSeries.value
							}, null, 8, ["options", "series"])])) : (openBlock(), createBlock("div", {
								key: 1,
								class: "h-52 flex items-center justify-center text-slate-400 text-sm italic"
							}, " No outlet revenue data. "))
						])]),
						createVNode("div", { class: "grid grid-cols-1 xl:grid-cols-2 gap-4 mb-4" }, [createVNode("div", { class: "bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-sm overflow-hidden" }, [createVNode("div", { class: "px-5 py-4 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between" }, [createVNode("div", null, [createVNode("h2", { class: "text-sm font-bold text-slate-900 dark:text-slate-50" }, "Recent Transactions"), createVNode("p", { class: "text-xs text-slate-400 mt-0.5" }, "Last 8 successful orders")]), createVNode("a", {
							href: "/admin/transactions",
							class: "flex items-center gap-1 text-xs font-semibold text-rose-500 hover:text-rose-600 transition-colors"
						}, [createTextVNode(" View All "), createVNode(unref(ArrowRight), { class: "h-3.5 w-3.5" })])]), __props.recentTransactions.length > 0 ? (openBlock(), createBlock("div", {
							key: 0,
							class: "divide-y divide-slate-100 dark:divide-slate-800"
						}, [(openBlock(true), createBlock(Fragment, null, renderList(__props.recentTransactions, (tx) => {
							return openBlock(), createBlock("div", {
								key: tx.id,
								class: "flex items-center gap-3 px-5 py-3 hover:bg-slate-50 dark:hover:bg-slate-800/50 transition-colors"
							}, [
								createVNode("div", { class: "flex-shrink-0" }, [createVNode("div", { class: ["p-2 rounded-lg", paymentBg(tx.payment_method)] }, [(openBlock(), createBlock(resolveDynamicComponent(paymentIcon(tx.payment_method)), { class: ["h-3.5 w-3.5", paymentColor(tx.payment_method)] }, null, 8, ["class"]))], 2)]),
								createVNode("div", { class: "flex-1 min-w-0" }, [createVNode("div", { class: "text-xs font-bold text-slate-900 dark:text-slate-100 truncate" }, toDisplayString(tx.transaction_number), 1), createVNode("div", { class: "text-xs text-slate-400 truncate" }, toDisplayString(tx.outlet_name) + " · " + toDisplayString(tx.items_count) + " item(s) · " + toDisplayString(tx.cashier_name), 1)]),
								createVNode("div", { class: "text-right flex-shrink-0" }, [createVNode("div", { class: "text-xs font-bold text-slate-900 dark:text-slate-100" }, toDisplayString(formatCurrency(tx.total_amount)), 1), createVNode("div", { class: "text-xs text-slate-400" }, toDisplayString(tx.created_at), 1)])
							]);
						}), 128))])) : (openBlock(), createBlock("div", {
							key: 1,
							class: "p-8 text-center text-slate-400 text-sm italic"
						}, " No transactions yet. "))]), createVNode("div", { class: "bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl shadow-sm overflow-hidden" }, [createVNode("div", { class: "px-5 py-4 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between" }, [createVNode("div", null, [createVNode("h2", { class: "text-sm font-bold text-slate-900 dark:text-slate-50 flex items-center gap-2" }, [createTextVNode(" Low Stock Alerts "), __props.lowStockAlerts.length > 0 ? (openBlock(), createBlock("span", {
							key: 0,
							class: "inline-flex items-center px-1.5 py-0.5 rounded-full bg-rose-500 text-white text-xs font-bold"
						}, toDisplayString(__props.lowStockAlerts.length), 1)) : createCommentVNode("", true)]), createVNode("p", { class: "text-xs text-slate-400 mt-0.5" }, "Items at or below safety threshold")]), createVNode("a", {
							href: "/admin/ingredients",
							class: "flex items-center gap-1 text-xs font-semibold text-rose-500 hover:text-rose-600 transition-colors"
						}, [createTextVNode(" Manage "), createVNode(unref(ArrowRight), { class: "h-3.5 w-3.5" })])]), __props.lowStockAlerts.length > 0 ? (openBlock(), createBlock("div", {
							key: 0,
							class: "divide-y divide-slate-100 dark:divide-slate-800 max-h-80 overflow-y-auto"
						}, [(openBlock(true), createBlock(Fragment, null, renderList(__props.lowStockAlerts, (item, idx) => {
							return openBlock(), createBlock("div", {
								key: idx,
								class: "px-5 py-3 hover:bg-slate-50 dark:hover:bg-slate-800/50 transition-colors"
							}, [createVNode("div", { class: "flex items-center justify-between mb-1.5" }, [createVNode("div", { class: "flex items-center gap-2 min-w-0" }, [createVNode("span", { class: ["text-xs font-bold px-1.5 py-0.5 rounded-md flex-shrink-0", item.type === "Ingredient" ? "bg-amber-500/10 text-amber-600 dark:text-amber-400" : "bg-sky-500/10 text-sky-600 dark:text-sky-400"] }, toDisplayString(item.type === "Ingredient" ? "ING" : "RTL"), 3), createVNode("span", { class: "text-xs font-bold text-slate-900 dark:text-slate-100 truncate" }, toDisplayString(item.name), 1)]), createVNode("span", { class: "text-xs text-slate-400 flex-shrink-0 ml-2" }, toDisplayString(item.outlet_name), 1)]), createVNode("div", { class: "flex items-center gap-2" }, [createVNode("div", { class: "flex-1 bg-slate-200 dark:bg-slate-700 rounded-full h-1.5 overflow-hidden" }, [createVNode("div", {
								class: ["h-full rounded-full transition-all", stockPct(item) <= 30 ? "bg-rose-500" : stockPct(item) <= 70 ? "bg-amber-500" : "bg-emerald-500"],
								style: { width: stockPct(item) + "%" }
							}, null, 6)]), createVNode("span", { class: "text-xs font-semibold text-slate-500 dark:text-slate-400 flex-shrink-0 w-28 text-right" }, toDisplayString(item.stock_qty) + " / " + toDisplayString(item.threshold_qty) + " " + toDisplayString(item.unit), 1)])]);
						}), 128))])) : (openBlock(), createBlock("div", {
							key: 1,
							class: "p-8 text-center"
						}, [
							createVNode("div", { class: "inline-flex items-center justify-center p-3 rounded-full bg-emerald-500/10 mb-3" }, [createVNode(unref(Package), { class: "h-6 w-6 text-emerald-500" })]),
							createVNode("p", { class: "text-sm font-semibold text-slate-700 dark:text-slate-300" }, "All stock levels are healthy"),
							createVNode("p", { class: "text-xs text-slate-400 mt-1" }, "No items are below their safety threshold.")
						]))])])
					];
				}),
				_: 1
			}, _parent));
			_push(`<!--]-->`);
		};
	}
});
//#endregion
//#region resources/js/Pages/Dashboard.vue
var _sfc_setup = Dashboard_vue_vue_type_script_setup_true_lang_default.setup;
Dashboard_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/Dashboard.vue");
	return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
var Dashboard_default = /*#__PURE__*/ _plugin_vue_export_helper_default(Dashboard_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-857e1ba5"]]);
//#endregion
export { Dashboard_default as default };
