import { T as reactExports, J as jsxRuntimeExports } from "./server-OKiEnFgZ.js";
import { h as createLucideIcon, B as Button, L as Link, p as posts, c as MapPin, M as Mail } from "./router-DhFPDtNP.js";
import { L as Label, I as Input } from "./label-BqqjY3rZ.js";
import { F as FileText } from "./file-text-DISco7XW.js";
import "node:async_hooks";
import "node:stream/web";
import "node:stream";
const __iconNode$6 = [
  [
    "path",
    {
      d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",
      key: "1nclc0"
    }
  ],
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
];
const Eye = createLucideIcon("eye", __iconNode$6);
const __iconNode$5 = [
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
  ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
  ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
];
const Image = createLucideIcon("image", __iconNode$5);
const __iconNode$4 = [
  ["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
  ["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
];
const Lock = createLucideIcon("lock", __iconNode$4);
const __iconNode$3 = [
  ["path", { d: "m16 17 5-5-5-5", key: "1bji2h" }],
  ["path", { d: "M21 12H9", key: "dn1m92" }],
  ["path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4", key: "1uf3rs" }]
];
const LogOut = createLucideIcon("log-out", __iconNode$3);
const __iconNode$2 = [
  ["path", { d: "M15 18h-5", key: "95g1m2" }],
  ["path", { d: "M18 14h-8", key: "sponae" }],
  [
    "path",
    {
      d: "M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2",
      key: "39pd36"
    }
  ],
  ["rect", { width: "8", height: "4", x: "10", y: "6", rx: "1", key: "aywv1n" }]
];
const Newspaper = createLucideIcon("newspaper", __iconNode$2);
const __iconNode$1 = [
  [
    "path",
    {
      d: "M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",
      key: "vktsd0"
    }
  ],
  ["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }]
];
const Tag = createLucideIcon("tag", __iconNode$1);
const __iconNode = [
  [
    "path",
    {
      d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",
      key: "1ngwbx"
    }
  ]
];
const Wrench = createLucideIcon("wrench", __iconNode);
const ADMIN_USER = "Manso Hq";
const ADMIN_PASS = "SmartMANSO20225$";
const STORAGE_KEY = "manso_admin_session";
function AdminPage() {
  const [authed, setAuthed] = reactExports.useState(false);
  const [checked, setChecked] = reactExports.useState(false);
  const [user, setUser] = reactExports.useState(ADMIN_USER);
  const [pass, setPass] = reactExports.useState(ADMIN_PASS);
  const [error, setError] = reactExports.useState("");
  reactExports.useEffect(() => {
    if (typeof window === "undefined") return;
    const session = window.sessionStorage.getItem(STORAGE_KEY);
    if (session === "ok") {
      setAuthed(true);
    } else {
      window.sessionStorage.setItem(STORAGE_KEY, "ok");
      setAuthed(true);
    }
    setChecked(true);
  }, []);
  const submit = (e) => {
    e.preventDefault();
    if (user === ADMIN_USER && pass === ADMIN_PASS) {
      window.sessionStorage.setItem(STORAGE_KEY, "ok");
      setAuthed(true);
      setError("");
    } else {
      setError("Invalid credentials.");
    }
  };
  const logout = () => {
    window.sessionStorage.removeItem(STORAGE_KEY);
    setAuthed(false);
  };
  if (!checked) return null;
  if (!authed) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid min-h-screen place-items-center bg-background px-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { onSubmit: submit, className: "w-full max-w-sm rounded-3xl border border-border bg-card p-8 shadow-card", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-6 flex items-center gap-2", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid h-10 w-10 place-items-center rounded-xl bg-gradient-primary text-white", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Lock, { className: "h-5 w-5" }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-xl font-extrabold", children: "Admin Login" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-muted-foreground", children: "Manso Digital" })
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Label, { htmlFor: "user", children: "Username" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { id: "user", value: user, onChange: (e) => setUser(e.target.value), className: "mt-1" })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Label, { htmlFor: "pass", children: "Password" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { id: "pass", type: "password", value: pass, onChange: (e) => setPass(e.target.value), className: "mt-1" })
        ] }),
        error && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-destructive", children: error }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { type: "submit", className: "w-full rounded-full bg-gradient-primary text-white", children: "Sign in" })
      ] })
    ] }) });
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsx(AdminDashboard, { onLogout: logout });
}
const services = [{
  name: "Web Design Lagos",
  path: "/services/web-design-lagos"
}, {
  name: "SEO Services Lagos",
  path: "/services/seo-services-lagos"
}, {
  name: "Google Business Profile",
  path: "/services/google-business-profile-optimization"
}, {
  name: "Ecommerce Website Design",
  path: "/services/ecommerce-website-design"
}, {
  name: "Real Estate Website",
  path: "/services/real-estate-website-design"
}, {
  name: "Travel Website Design",
  path: "/services/travel-website-design"
}, {
  name: "Blog Website Design",
  path: "/services/blog-website-design"
}, {
  name: "Landing Page Design",
  path: "/services/landing-page-design"
}, {
  name: "Branding & Graphics",
  path: "/services/branding-and-graphics"
}, {
  name: "Paid Advertising",
  path: "/services/paid-advertising"
}, {
  name: "AI Automation",
  path: "/services/ai-automation"
}];
const locations = [{
  name: "Lagos",
  path: "/locations/web-designer-lagos"
}, {
  name: "Ikeja",
  path: "/locations/web-design-company-ikeja"
}, {
  name: "Maryland Lagos",
  path: "/locations/web-designers-maryland-lagos"
}, {
  name: "Digital Marketing Lagos",
  path: "/locations/digital-marketing-agency-lagos"
}, {
  name: "SEO Company Lagos",
  path: "/locations/seo-company-lagos"
}, {
  name: "Abuja",
  path: "/locations/web-designer-abuja"
}, {
  name: "Port Harcourt",
  path: "/locations/web-designer-port-harcourt-rivers"
}, {
  name: "Ibadan",
  path: "/locations/web-designer-ibadan-oyo"
}, {
  name: "Kano",
  path: "/locations/web-designer-kano"
}, {
  name: "Ilorin",
  path: "/locations/web-designer-ilorin-kwara"
}];
const pricing = [{
  name: "Basic",
  price: "₦100,000",
  pages: "1 page",
  delivery: "1 week"
}, {
  name: "Professional",
  price: "₦250,000",
  pages: "5+ pages",
  delivery: "2 weeks"
}, {
  name: "Premium",
  price: "₦500,000",
  pages: "10 pages",
  delivery: "3 weeks"
}, {
  name: "World Class",
  price: "₦1,000,000",
  pages: "10+ pages",
  delivery: "4–6 weeks"
}];
function AdminDashboard({
  onLogout
}) {
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen bg-background", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("header", { className: "sticky top-0 z-20 border-b border-border bg-card/80 backdrop-blur", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mx-auto flex max-w-7xl items-center justify-between px-4 py-4 md:px-6", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid h-9 w-9 place-items-center rounded-xl bg-gradient-primary text-white", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Lock, { className: "h-4 w-4" }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-extrabold leading-tight", children: "Manso Digital Admin" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-muted-foreground", children: "Signed in as Manso Hq" })
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { asChild: true, variant: "outline", size: "sm", className: "rounded-full", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Link, { to: "/", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Eye, { className: "mr-1 h-4 w-4" }),
          " View site"
        ] }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { onClick: onLogout, size: "sm", variant: "ghost", className: "rounded-full", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(LogOut, { className: "mr-1 h-4 w-4" }),
          " Logout"
        ] })
      ] })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("main", { className: "mx-auto max-w-7xl px-4 py-10 md:px-6", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-3xl font-extrabold md:text-4xl", children: "Dashboard" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-2 text-ink-soft", children: "Manage your website pages, blog, services, locations and pricing." }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-6 grid gap-4 md:grid-cols-2 lg:grid-cols-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(StatCard, { icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Newspaper, { className: "h-5 w-5" }), label: "Blog posts", value: posts.length }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(StatCard, { icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Wrench, { className: "h-5 w-5" }), label: "Services", value: services.length }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(StatCard, { icon: /* @__PURE__ */ jsxRuntimeExports.jsx(MapPin, { className: "h-5 w-5" }), label: "Locations", value: locations.length }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(StatCard, { icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Tag, { className: "h-5 w-5" }), label: "Pricing tiers", value: pricing.length })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Panel, { title: "Blog posts", icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Newspaper, { className: "h-4 w-4" }), children: /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "divide-y divide-border", children: posts.map((p) => /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-center justify-between gap-4 py-3", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-0", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "truncate font-semibold", children: p.title }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-xs text-muted-foreground", children: [
            p.cat,
            " · ",
            p.read,
            " · ",
            new Date(p.date).toLocaleDateString()
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { asChild: true, size: "sm", variant: "outline", className: "rounded-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Link, { to: "/blog/$slug", params: {
          slug: p.slug
        }, children: "View" }) })
      ] }, p.slug)) }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Panel, { title: "Services", icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Wrench, { className: "h-4 w-4" }), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid gap-2 md:grid-cols-2", children: services.map((s) => /* @__PURE__ */ jsxRuntimeExports.jsxs("a", { href: s.path, className: "flex items-center justify-between rounded-xl border border-border bg-card px-4 py-3 text-sm hover:bg-muted", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: s.name }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs text-muted-foreground", children: s.path })
      ] }, s.path)) }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Panel, { title: "Locations", icon: /* @__PURE__ */ jsxRuntimeExports.jsx(MapPin, { className: "h-4 w-4" }), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid gap-2 md:grid-cols-2", children: locations.map((l) => /* @__PURE__ */ jsxRuntimeExports.jsxs("a", { href: l.path, className: "flex items-center justify-between rounded-xl border border-border bg-card px-4 py-3 text-sm hover:bg-muted", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: l.name }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs text-muted-foreground", children: l.path })
      ] }, l.path)) }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Panel, { title: "Pricing packages", icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Tag, { className: "h-4 w-4" }), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "overflow-hidden rounded-2xl border border-border", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("table", { className: "w-full text-sm", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("thead", { className: "bg-muted text-left", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("tr", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("th", { className: "px-4 py-2", children: "Package" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("th", { className: "px-4 py-2", children: "Price" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("th", { className: "px-4 py-2", children: "Pages" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("th", { className: "px-4 py-2", children: "Delivery" })
        ] }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("tbody", { className: "divide-y divide-border", children: pricing.map((p) => /* @__PURE__ */ jsxRuntimeExports.jsxs("tr", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: "px-4 py-3 font-semibold", children: p.name }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: "px-4 py-3", children: p.price }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: "px-4 py-3", children: p.pages }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: "px-4 py-3", children: p.delivery })
        ] }, p.name)) })
      ] }) }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Panel, { title: "Quick links", icon: /* @__PURE__ */ jsxRuntimeExports.jsx(FileText, { className: "h-4 w-4" }), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid gap-2 md:grid-cols-3", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "/", className: "rounded-xl border border-border bg-card px-4 py-3 text-sm hover:bg-muted", children: "Home" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "/about", className: "rounded-xl border border-border bg-card px-4 py-3 text-sm hover:bg-muted", children: "About" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "/portfolio", className: "rounded-xl border border-border bg-card px-4 py-3 text-sm hover:bg-muted", children: "Portfolio" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "/pricing", className: "rounded-xl border border-border bg-card px-4 py-3 text-sm hover:bg-muted", children: "Pricing" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "/blog", className: "rounded-xl border border-border bg-card px-4 py-3 text-sm hover:bg-muted", children: "Blog" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "/contact", className: "rounded-xl border border-border bg-card px-4 py-3 text-sm hover:bg-muted", children: "Contact" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "/sitemap.xml", className: "rounded-xl border border-border bg-card px-4 py-3 text-sm hover:bg-muted", children: "Sitemap.xml" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "/robots.txt", className: "rounded-xl border border-border bg-card px-4 py-3 text-sm hover:bg-muted", children: "Robots.txt" })
      ] }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-10 rounded-2xl border border-dashed border-border bg-muted/40 p-5 text-sm text-ink-soft", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 font-semibold text-ink", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Image, { className: "h-4 w-4" }),
          " Heads up"
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "mt-2", children: [
          "This admin is a read-only control center. To edit blog content, services, locations, pricing or images, ask Lovable to update the matching files. For real auth, lead capture inboxes, and a database-backed editor, enable ",
          /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Lovable Cloud" }),
          "."
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-3 flex flex-wrap gap-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { asChild: true, size: "sm", variant: "outline", className: "rounded-full", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("a", { href: "mailto:hello@mansodigital.com", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Mail, { className: "mr-1 h-4 w-4" }),
          " Contact dev"
        ] }) }) })
      ] })
    ] })
  ] });
}
function StatCard({
  icon,
  label,
  value
}) {
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-2xl border border-border bg-card p-5 shadow-card", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-primary", children: [
      icon,
      " ",
      label
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 text-3xl font-extrabold", children: value })
  ] });
}
function Panel({
  title,
  icon,
  children
}) {
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: "mt-8 rounded-3xl border border-border bg-card p-6 shadow-card", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "mb-4 inline-flex items-center gap-2 text-lg font-extrabold", children: [
      icon,
      " ",
      title
    ] }),
    children
  ] });
}
export {
  AdminPage as component
};
