1import{s as e}from"./rolldown-runtime-BG2f4sTM.js";import{t}from"./react-CYsHstG7.js";import{a as n,s as r}from"./hooks-Dr3i4SJb.js";import{t as i}from"./lib-DFHwdoKZ.js";import{Xt as a,cn as o,n as s,yt as c}from"./state-C4IzlkDq.js";import{t as l}from"./jsx-runtime-CqqR4vFp.js";import{t as u}from"./UnreadBadge-D4atx0mh.js";import{t as d}from"./useLogout-zTr632iD.js";import{t as f}from"./AuthNavLoading-CW-2RjJA.js";import{t as p}from"./useCloseOnNavigation-bTTWgJXW.js";import{t as m}from"./userMenu-BVCUKIWg.js";import{n as h,t as g}from"./logo-light-Bdb_UsA7.js";var _=e(t(),1),v=l(),y=[{label:`Invest`,to:`/marketplace`},{label:`About`,to:`/team`},{label:`Learn`,to:`/how-it-works`},{label:`List Property`,to:`/list-your-property`}],b=[`/`,`/refer`,`/team`,`/compare`,`/calculators`,`/real-estate-investing`,`/reviews`,`/blog`,`/list-your-property`,`/how-it-works`,`/glossary`,`/data`,`/landlord-tenant-laws`,`/short-term-rental-laws`,`/1031-exchange-rules-by-state`],x=e=>e.startsWith(`/`),S=(e,t,n)=>e.external||!x(e.to)?(0,v.jsx)(`a`,{href:e.to,target:e.external?`_blank`:void 0,rel:e.external?`noreferrer`:void 0,className:t,onClick:n,children:e.label},e.label):(0,v.jsx)(i,{to:e.to,className:t,onClick:n,children:e.label},e.label),C=(e,t)=>x(e.to)?e.to===`/`?t===`/`:t===e.to||t.startsWith(`${e.to}/`):!1;function w({signupCtaLabel:e=`Sign Up`,signupCtaHref:t=`/signup`}={}){let{isAuthPending:l,isLoggedIn:x,isLoggedOut:w}=c(),T=d(),{unreadCount:E}=s(),D=a();r();let O=n(),[k,A]=(0,_.useState)(!1),[j,M]=(0,_.useState)(!1),N=(0,_.useRef)(null);(0,_.useEffect)(()=>{if(!k)return;let e=e=>{N.current&&!N.current.contains(e.target)&&A(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[k]),o(j),p(()=>{M(!1),A(!1)}),(0,_.useEffect)(()=>{x&&M(!1)},[x]),(0,_.useEffect)(()=>{if(!j)return;let e=e=>{e.key===`Escape`&&M(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[j]);let P=()=>{A(!1),T()},F=[D.firstName,D.lastName].filter(Boolean).map(e=>e?.[0]?.toUpperCase()).join(``),I=()=>M(!1),L={pathname:`/login`,state:{referrer:{pathname:O.pathname,search:O.search}}},R=b.some(e=>e===`/`?O.pathname===`/`:O.pathname===e||O.pathname.startsWith(`${e}/`));return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`header`,{className:`sticky z-50 w-full border-b border-lofty-gray-300/60 bg-white/85 backdrop-blur-md pt-safe-top`,style:{top:`var(--top-mkt-bar-offset, 0px)`},children:(0,v.jsxs)(`div`,{className:`mx-auto flex h-16 w-full max-w-[1280px] items-center justify-between gap-8 px-6 lg:px-12`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-10`,children:[(0,v.jsxs)(i,{to:`/`,className:`flex items-center`,"aria-label":`Lofty home`,onClick:I,children:[(0,v.jsx)(`img`,{src:g,alt:``,className:`my-0 block h-7 w-auto sm:h-8 ${R?``:`dark:hidden`}`}),(0,v.jsx)(`img`,{src:h,alt:``,className:`my-0 h-7 w-auto sm:h-8 ${R?`hidden`:`hidden dark:block`}`})]}),(0,v.jsx)(`nav`,{className:`hidden items-center gap-7 lg:flex`,"aria-label":`Primary`,children:y.map(e=>S(e,`text-sm text-lofty-purple-700 no-underline transition-colors hover:text-lofty`))})]}),(0,v.jsxs)(`div`,{className:`flex items-center gap-2 sm:gap-3`,children:[l?(0,v.jsx)(f,{}):x?(0,v.jsxs)(`div`,{className:`relative`,ref:N,children:[(0,v.jsxs)(`button`,{type:`button`,onClick:()=>A(!k),className:`flex items-center gap-2.5 py-1.5 pl-1.5 pr-3 rounded-full bg-lofty-purple-50 hover:bg-lofty-purple/20 border border-lofty-purple/20 transition-colors`,children:[(0,v.jsxs)(`div`,{className:`relative`,children:[(0,v.jsx)(`div`,{className:`w-8 h-8 rounded-full bg-lofty-purple flex items-center justify-center text-white text-xs font-bold`,children:F||(0,v.jsx)(`i`,{className:`far fa-user text-sm`})}),(0,v.jsx)(u,{count:E,className:`absolute -right-1 -top-1`})]}),(0,v.jsx)(`span`,{className:`text-sm font-medium text-lofty-purple-600 max-w-[120px] truncate`,children:D.firstName||`Account`}),(0,v.jsx)(`i`,{className:`far fa-chevron-down text-[10px] text-gray-400 transition-transform ${k?`rotate-180`:``}`})]}),k&&(0,v.jsxs)(`div`,{className:`absolute right-0 top-full mt-2 w-64 bg-white rounded-xl shadow-2xl overflow-hidden z-50 border border-lofty-purple/20`,children:[(0,v.jsxs)(`div`,{className:`px-4 py-3 border-b border-gray-100`,children:[(0,v.jsx)(`p`,{className:`text-sm font-semibold text-lofty-purple-600 truncate`,children:[D.firstName,D.lastName].filter(
1Boolean).join(` `)||`My Account`}),D.email&&(0,v.jsx)(`p`,{className:`text-xs text-gray-400 truncate mt-0.5`,children:D.email})]}),(0,v.jsx)(`div`,{className:`py-1`,children:m.map(e=>(0,v.jsxs)(i,{to:e.to,onClick:()=>A(!1),className:`flex items-center gap-3 px-4 py-2.5 text-sm text-lofty-purple-600 hover:bg-gray-50 transition-colors`,children:[(0,v.jsx)(`i`,{className:`${e.icon} w-4 text-center text-gray-400`}),e.label,e.forumUnread&&(0,v.jsx)(u,{count:E,className:`ml-auto`})]},e.to))}),(0,v.jsx)(`div`,{className:`border-t border-gray-100 py-1`,children:(0,v.jsxs)(`button`,{type:`button`,onClick:P,className:`flex items-center gap-3 w-full px-4 py-2.5 text-sm text-gray-500 hover:bg-gray-50 transition-colors text-left`,children:[(0,v.jsx)(`i`,{className:`far fa-arrow-right-from-bracket w-4 text-center`}),`Log Out`]})})]})]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(i,{to:L,className:`hidden shrink-0 whitespace-nowrap rounded-full px-2 py-2 text-sm font-semibold text-lofty-purple-700 no-underline transition-colors hover:text-lofty min-[360px]:inline-flex sm:px-4`,children:`Log In`}),(0,v.jsx)(i,{to:t,className:`inline-flex shrink-0 items-center whitespace-nowrap rounded-full bg-lofty px-4 py-2.5 text-sm font-semibold !text-white no-underline shadow-sm transition-colors hover:bg-lofty-purple-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-lofty focus-visible:ring-offset-2 sm:px-5`,children:e})]}),!x&&(0,v.jsx)(`button`,{type:`button`,onClick:()=>M(e=>!e),className:`inline-flex h-10 w-10 items-center justify-center rounded-md text-lofty-purple-700 transition-colors hover:bg-lofty-purple-50 lg:hidden`,"aria-label":j?`Close menu`:`Open menu`,"aria-expanded":j,"aria-controls":`mobile-menu-panel`,children:(0,v.jsx)(`i`,{className:`fas ${j?`fa-xmark`:`fa-bars`} text-xl`,"aria-hidden":`true`})})]})]})}),!x&&j&&(0,v.jsxs)(`div`,{id:`mobile-menu-panel`,role:`dialog`,"aria-modal":`true`,"aria-label":`Site menu`,className:`fixed inset-x-0 bottom-0 z-40 flex flex-col bg-white lg:hidden`,style:{top:`calc(4rem + var(--safe-area-inset-top, 0px) + var(--top-mkt-bar-offset, 0px))`},children:[(0,v.jsx)(`nav`,{className:`flex flex-1 flex-col overflow-y-auto`,"aria-label":`Mobile primary`,children:y.map(e=>S(e,`block border-b border-lofty-gray-300/60 px-6 py-5 text-base font-semibold uppercase tracking-wide text-lofty-purple-700 no-underline ${C(e,O.pathname)?`bg-lofty-purple-50`:``}`,I))}),w&&(0,v.jsx)(`div`,{className:`border-t border-lofty-gray-300/60 bg-white p-4`,style:{paddingBottom:`calc(1rem + var(--safe-area-inset-bottom, 0px))`},children:(0,v.jsxs)(`div`,{className:`mx-auto flex max-w-md gap-3`,children:[(0,v.jsx)(i,{to:L,onClick:I,className:`flex flex-1 items-center justify-center rounded-full border border-lofty-purple-700/15 bg-white px-4 py-3 text-sm font-semibold text-lofty-purple-700 no-underline`,children:`Log In`}),(0,v.jsx)(i,{to:t,onClick:I,className:`flex flex-1 items-center justify-center rounded-full bg-lofty px-4 py-3 text-sm font-semibold !text-white no-underline`,children:e})]})}),l&&(0,v.jsx)(`div`,{className:`border-t border-lofty-gray-300/60 bg-white p-4 flex justify-center`,style:{paddingBottom:`calc(1rem + var(--safe-area-inset-bottom, 0px))`},children:(0,v.jsx)(f,{})})]})]})}export{w as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.