"use client"
import{b as p,d as h}from"./chunk-XCLT6ETU.mjs";import{d as n,g as f,i as l}from"./chunk-3VTQK4AG.mjs";import{ChevronDown as y,Menu as N,X as w}from"lucide-react";import o from"next/link";import{useParams as v}from"next/navigation";import{useEffect as x,useState as u}from"react";import L from"swr";import{Fragment as z,jsx as e,jsxs as t}from"react/jsx-runtime";function D({theme:b="light"}){let{domain:r="dub.co"}=v(),[a,d]=u(!1),[c,g]=u(!1);x(()=>{a?document.body.style.overflow="hidden":document.body.style.overflow="auto"},[a]);let{data:m}=L(r==="dub.co"&&"/api/auth/session",f,{dedupingInterval:6e4});return t("div",{className:l(b==="dark"&&"dark"),children:[e("button",{onClick:()=>d(!a),className:l("fixed right-3 top-3 z-40 rounded-full p-2 transition-colors duration-200 hover:bg-gray-200 focus:outline-none active:bg-gray-300 dark:hover:bg-white/20 dark:active:bg-white/30 lg:hidden",a&&"hover:bg-gray-100 active:bg-gray-200"),children:a?e(w,{className:"h-5 w-5 text-gray-600 dark:text-white/70"}):e(N,{className:"h-5 w-5 text-gray-600 dark:text-white/70"})}),e("nav",{className:l("fixed inset-0 z-20 hidden w-full bg-white px-5 py-16 dark:bg-black dark:text-white/70 lg:hidden",a&&"block"),children:t("ul",{className:"grid divide-y divide-gray-200 dark:divide-white/[0.15]",children:[t("li",{className:"py-3",children:[t("button",{className:"flex w-full justify-between",onClick:()=>g(!c),children:[e("p",{className:"font-semibold",children:"Features"}),e(y,{className:l("h-5 w-5 text-gray-500 transition-all dark:text-white/50",c&&"rotate-180")})]}),c&&e("div",{className:"grid gap-4 overflow-hidden py-4",children:p.map(({slug:i,icon:s,shortTitle:k})=>t(o,{href:r==="dub.co"?`/${i}`:`https://dub.co/${i}`,onClick:()=>d(!1),className:"flex w-full space-x-2",children:[e(s,{className:"h-5 w-5 text-gray-500 dark:text-white/80"}),e("span",{className:"text-sm",children:k})]},i))})]}),h.map(({name:i,slug:s})=>e("li",{className:"py-3",children:e(o,{href:r==="dub.co"?`/${s}`:`https://dub.co/${s}`,onClick:()=>d(!1),className:"flex w-full font-semibold capitalize",children:i})},s)),m&&Object.keys(m).length>0?e("li",{className:"py-3",children:e(o,{href:n,className:"flex w-full font-semibold capitalize",children:"Dashboard"})}):t(z,{children:[e("li",{className:"py-3",children:e(o,{href:`${n}/login`,className:"flex w-full font-semibold capitalize",children:"Log in"})}),e("li",{className:"py-3",children:e(o,{href:`${n}/register`,className:"flex w-full font-semibold capitalize",children:"Sign Up"})})]})]})})]})}export{D as a};
