1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4502],{79967:function(e,s,t){t.d(s,{K:function(){return i},a:function(){return u}});var a=t(57437),r=t(2265),l=t(80605),n=t(99376);let o=(0,r.createContext)({mode:"exploring",setMode:()=>{},toggleMode:()=>{},isHosting:!1,isHost:!1,isOrgMember:!1});function i(){return(0,r.useContext)(o)}let d="tnh-app-mode",c=["/dashboard/listings","/dashboard/calendar","/dashboard/revenue","/dashboard/performance","/dashboard/reservations","/dashboard/pipeline","/dashboard/host-verification","/dashboard/analytics","/dashboard/opportunities","/dashboard/calendar-sync","/create-listing"],h=["/search","/trips","/dashboard/trips","/dashboard/wishlist"];function u({children:e,defaultMode:s}){let{data:t}=(0,l.useSession)()||{},i=t?.user?.isHost??!1,u=t?.user?.isOrgMember??!1,x=(0,n.usePathname)(),f=(0,n.useRouter)(),b=(0,r.useRef)(!1),[m,p]=(0,r.useState)(s??"exploring"),[g,j]=(0,r.useState)(!1);(0,r.useEffect)(()=>{try{if(i)p("hosting"),localStorage.setItem(d,"hosting");else{let e=localStorage.getItem(d);"exploring"===e?p("exploring"):(p("exploring"),localStorage.setItem(d,"exploring"))}}catch{}j(!0)},[i]),(0,r.useEffect)(()=>{if(!i||!g)return;let e=function(e){for(let s of c)if(e===s||e.startsWith(s+"/"))return"hosting";for(let s of h)if(e===s||e.startsWith(s+"/"))return"exploring";return null}(x);if(e&&e!==m){p(e);try{localStorage.setItem(d,e)}catch{}}},[x,i,g]),(0,r.useEffect)(()=>{if(!i&&"hosting"===m){p("exploring");try{localStorage.setItem(d,"exploring")}catch{}}},[i,m]);let v=(0,r.useCallback)(e=>{if("hosting"!==e||i){b.current=!0,p(e);try{localStorage.setItem(d,e)}catch{}}},[i]),w=(0,r.useCallback)(()=>{i&&v("hosting"===m?"exploring":"hosting")},[m,v,i]);return(0,r.useEffect)(()=>{g&&b.current&&(b.current=!1,"/dashboard"!==x&&f.push("/dashboard"))},[m,g]),(0,a.jsx)(o.Provider,{value:{mode:m,setMode:v,toggleMode:w,isHosting:"hosting"===m,isHost:i,isOrgMember:u},children:e})}},4502:function(e,s,t){t.d(s,{PublicNav:function(){return H}});var a=t(57437),r=t(2265),l=t(27648),n=t(80605),o=t(99376),i=t(57729),d=t(79967);function c({href:e,icon:s,label:t,badge:r,onClose:n}){return(0,a.jsxs)(l.default,{href:e,onClick:n,className:"flex items-center justify-between px-3 py-3.5 rounded-xl hover:bg-slate-50 transition-colors",children:[(0,a.jsxs)("span",{className:"flex items-center gap-4",children:[(0,a.jsx)("span",{className:"w-7 grid place-items-center text-slate-600",children:(0,a.jsx)(s,{size:22})}),(0,a.jsx)("span",{className:"font-semibold text-title-4",children:t})]}),r&&(0,a.jsx)("span",{className:"bg-[#ced02d] text-[#091628] text-xs font-medium rounded-full px-2.5 py-1",children:r})]})}function h(){return(0,a.jsx)("div",{className:"!my-5 border-t border-line"})}function u({open:e,onClose:s}){let{data:t}=(0,n.useSession)()||{},{mode:o,toggleMode:u,isHosting:x,isHost:f,isOrgMember:b}=(0,d.K)(),m=function(){let{data:e}=(0,n.useSession)()||{},[s,t]=(0,r.useState)(0);return(0,r.useEffect)(()=>{e?.user&&fetch("/api/v1/conversations/unread-count").then(e=>e.ok?e.json():null).then(e=>{e&&t(e.totalUnread||0)}).catch(()=>{})},[e?.user]),s}(),[p,g]=(0,r.useState)(!1),[j,v]=(0,r.useState)(!1),w=t?.user?.roles||[],N=w.includes("ADMIN")||w.includes("SUPER_ADMIN")||w.includes("MODERATOR");return((0,r.useEffect)(()=>{if(e)v(!0),requestAnimationFrame(()=>requestAnimationFrame(()=>g(!0))),document.body.style.overflow="hidden";else{g(!1);let e=setTimeout(()=>v(!1),400);return document.body.style.overflow="",()=>clearTimeout(e)}return()=>{document.body.style.overflow=""}},[e]),(0,r.useEffect)(()=>{let t=e=>{"Escape"===e.key&&s()};return e&&window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,s]),j)?(0,a.jsxs)("div",{className:"fixed inset-0 z-[10000]",children:[(0,a.jsx)("div",{className:`absolute inset-0 bg-[#091628]/40 backdrop-blur-[2px] transition-opacity duration-400 ease-tdls ${p?"opacity-100":"opacity-0"}`,onClick:s}),(0,a.jsxs)("aside",{className:`fixed top-0 right-0 bottom-0 w-full max-w-[460px] bg-white rounded-l-[28px] shadow-[0_24px_64px_rgba(9,22,40,.16)] flex flex-col transition-transform duration-400 ease-tdls ${p?"translate-x-0":"translate-x-full"}`,children:[(0,a.jsxs)("div",{className:"flex items-center justify-end gap-3 px-7 pt-6",children:[(0,a.jsx)("button",{className:"w-10 h-10 rounded-full bg-slate-100 grid place-items-center text-[#091628] hover:bg-slate-200 transition-colors",children:(0,a.jsx)(i.Bell,{size:20})}),(0,a.jsx)("button",{onClick:s,className:"w-10 h-10 rounded-full bg-slate-100 grid place-items-center text-[#091628] hover:bg-slate-200 transition-colors",children:(0,a.jsx)(i.X,{size:20})})]}),(0,a.jsxs)("div",{className:"px-9 pt-4 pb-8 overflow-y-auto flex-1",children:[(0,a.jsx)("h1",{className:"text-4xl font-semibold tracking-tight text-[#091628]",children:"Menu"}),t?.user?(0,a.jsxs)(a.Fragment,{children:[f&&x?(0,a.jsxs)(l.default,{href:"/create-listing",onClick:s,className:"mt-8 flex items-center gap-4 bg-[#F6F8E8] rounded-2xl p-5 hover:bg-[#
1EFF3D8] transition-colors",children:[(0,a.jsx)("div",{className:"w-14 h-14 rounded-xl bg-[#ced02d]/20 grid place-items-center",children:(0,a.jsx)(i.Plus,{size:28,className:"text-[#091628]"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"font-bold text-[#091628]",children:"List a Property"}),(0,a.jsx)("div",{className:"text-sm text-slate-500",children:"Add a new listing to your portfolio."})]})]}):b?(0,a.jsxs)(l.default,{href:"/dashboard/organization/requests",onClick:s,className:"mt-8 flex items-center gap-4 bg-[#F6F8E8] rounded-2xl p-5 hover:bg-[#EFF3D8] transition-colors",children:[(0,a.jsx)("div",{className:"w-14 h-14 rounded-xl bg-[#ced02d]/20 grid place-items-center",children:(0,a.jsx)(i.Compass,{size:28,className:"text-[#091628]"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"font-bold text-[#091628]",children:"Housing Requests"}),(0,a.jsx)("div",{className:"text-sm text-slate-500",children:"Manage traveler housing requests."})]})]}):f?null:(0,a.jsxs)(l.default,{href:"/become-a-host",onClick:s,className:"mt-8 flex items-center gap-4 bg-[#F6F8E8] rounded-2xl p-5 hover:bg-[#EFF3D8] transition-colors",children:[(0,a.jsx)("div",{className:"w-14 h-14 rounded-xl bg-[#ced02d]/20 grid place-items-center",children:(0,a.jsx)(i.Plus,{size:28,className:"text-[#091628]"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"font-bold text-[#091628]",children:"Become a Host"}),(0,a.jsx)("div",{className:"text-sm text-slate-500",children:"Start hosting on Travel Nurse Houses."})]})]}),(0,a.jsx)("nav",{className:"mt-7 space-y-1",children:b?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c,{href:"/dashboard/organization",icon:i.LayoutDashboard,label:"Dashboard",onClose:s}),(0,a.jsx)(c,{href:"/dashboard/organization/requests",icon:i.UserPlus,label:"Housing Requests",onClose:s}),(0,a.jsx)(c,{href:"/dashboard/organization/travelers",icon:i.Stethoscope,label:"Travelers",onClose:s}),(0,a.jsx)(c,{href:"/dashboard/organization/placements",icon:i.Home,label:"Assignments",onClose:s}),(0,a.jsx)(c,{href:"/dashboard/organization/shortlists",icon:i.Building2,label:"Shortlists",onClose:s}),(0,a.jsx)(c,{href:"/dashboard/organization/applications",icon:i.Compass,label:"Applications",onClose:s}),(0,a.jsx)(c,{href:"/dashboard/organization/team",icon:i.User,label:"Team",onClose:s}),(0,a.jsx)(h,{}),(0,a.jsx)(c,{href:"/dashboard/messages",icon:i.MessageSquare,label:"Messages",badge:m>0?String(m):void 0,onClose:s}),(0,a.jsx)(c,{href:"/dashboard/organization/analytics",icon:i.BarChart3,label:"Analytics",onClose:s}),(0,a.jsx)(c,{href:"/dashboard/organization/reports",icon:i.BarChart3,label:"Reports",onClose:s}),(0,a.jsx)(h,{}),(0,a.jsx)(c,{href:"/dashboard/organization/preferences",icon:i.Settings,label:"Agency Settings",onClose:s}),(0,a.jsx)(c,{href:"/dashboard/profile",icon:i.Settings,label:"Account",onClose:s}),N&&(0,a.jsx)(c,{href:"/admin",icon:i.Settings,label:"Admin Panel",onClose:s}),(0,a.jsx)(h,{}),(0,a.jsx)(c,{href:"/dashboard/help",icon:i.HelpCircle,label:"Help Center",onClose:s}),(0,a.jsxs)("button",{onClick:()=>{s(),(0,n.signOut)({callbackUrl:"/"})},className:"flex items-center gap-4 px-3 py-3.5 rounded-xl hover:bg-slate-50 transition-colors w-full",children:[(0,a.jsx)("span",{className:"w-7 text-center text-slate-400",children:(0,a.jsx)(i.LogOut,{size:22})}),(0,a.jsx)("span",{className:"font-semibold text-title-4 text-slate-500",children:"Log out"})]})]}):(0,a.jsxs)(a.Fragment,{children:[f&&x&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c,{href:"/dashboard",icon:i.LayoutDashboard,label:"Dashboard",onClose:s}),(0,a.jsx)(c,{href:"/dashboard/revenue",icon:i.DollarSign,label:"Earnings",onClose:s}),(0,a.jsx)(c,{href:"/dashboard/performance",icon:i.BarChart3,label:"Insights",onClose:s}),(0,a.jsx)(c,{href:"/dashboard/opportunities",icon:i.UserPlus,label:"Traveler requests",onClose:s}),(0,a.jsx)(c,{href:"/dashboard/pipeline",icon:i.GanttChart,label:"Pipeline",onClose:s}),(0,a.jsx)(c,{href:"/dashboard/reservations",icon:i.CalendarCheck,label:"Reservations",onClose:s}),(0,a.jsx)(c,{href:"/dashboard/payment-settings",icon:i.DollarSign,label:"Payment Settings",onClose:s}),(0,a.jsx)(c,{href:"/dashboard/billing",icon:i.BarChart3,label:"Billing & Invoices",onClose:s})]}),!x&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c,{href:"/search",icon:i.Compass,label:"Explore",onClose:s}),(0,a.jsx)(c,{href:"/trips",icon:i.Briefcase,label:"Trips",onClose:s}),(0,a.jsx)(c,{href:"/dashboard/wishlist",icon:i.Heart,label:"Wishlist",onClose:s}),(0,a.jsx)(c,{href:"/dashboard/opportunities",icon:i.UserPlus,label:"My Requests",onClose:s})]}),(0,a.jsx)(h,{}),(0,a.jsx)(c,{href:"/dashboard/messages",icon:i.MessageSquare,label:"Messages",badge:m>0?String(m):void 0,onClose:s}),(0,a.jsx)(h,{}),(0,a.jsx)(c,{href:"/dashboard/profile",icon:i.Settings,label:"Account settings",onClose:s}),(0,a.jsx)(c,{href:"/dashboard/verification",icon:i.ShieldCheck,label:"Verification",onClose:s}),N&&(0,a.jsx)(c,{href:"/admin",icon:i.Settings,label:"Admin Panel",onClose:s}),(0,a.jsx)(h,{}),f?(0,a.jsxs)("button",{onClick:()=>{u(),s()},className:"flex items-center gap-4 px-3 py-3.5 rounded-xl hover:bg-slate-50 transition-colors w-full",children:[(0,a.jsx)("span",{className:"w-7 text-center text-slate-600",children:(0,a.jsx)(i.ArrowRightLeft,{size:22})}),(0,a.jsx)("span",{className:"font-semibold text-title-4",children:x?"Switch to Traveler":"Switch to Host"})]}):(0,a.jsxs)(l.default,{href:"/become-a-host",onClick:s,className:"flex items-center gap-4 px-3 py-3.5 rounded-xl hover:bg-slate-50 transition-colors w-full",children:[(0,a.jsx)("span",{className:"w-7 text-center text-[#ced02d]",children:(0,a.jsx)(i.Plus,{size:22})}),(0,a.jsx)("span",{className:"font-semibold text-title-4 text-[#091628]",children:"Become a Host"})]}),(0,a.jsx)(c,{href:"/dashboard/help",icon:i.HelpCircle,label:"Help Center",onClose:s}),(0,a.jsxs)("button",{onClick:()=>{s(),(0,n.signOut)({callbackUrl:"/"})},className:"flex items-center gap-4 px-3 py-3.5 rounded-xl hover:bg-slate-50 transition-colors w-full",children:[(0,a.jsx)("span",{className:"w-7 text-center text-slate-400",children:(0,a.jsx)(i.LogOut,{size:22})}),(0,a.jsx)("span",{className:"font-semibold text-title-4 text-slate-500",children:"Log out"})]})]})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"mt-8 space-y-3",children:[(0,a.jsx)(l.default,{href:"/login",onClick:s,className:"block",children:(0,a.jsx)("button",{className:"w-full h-12 rounded-full bg-[#091628] text-white text-body-lg font-bold transition-colors hover:bg-[#0f2440]",children:"Log in"})}),(0,a.jsx)(l.default,{href:"/signup",onClick:s,className:"block",children:(0,a.jsx)("button",{className:"w-full h-12 rounded-full border-2 border-[#091628] text-[#091628] text-body-lg font-bold transition-colors hover:bg-slate-50",children:"Sign up"})})]}),(0,a.jsxs)("nav",{className:"mt-8 space-y-1",children:[(0,a.jsx)(c,{href:"/search",icon:i.Search,label:"Browse Listings",onClose:s}),(0,a.jsx)(c,{href:"/signup?role=host",icon:i.Plus,label:"List Your Property",onClose:s}),(0,a.jsx)(h,{}),(0,a.jsx)(c,{href:"/help",icon:i.HelpCircle,label:"Help",onClose:s})]})]})]})]})]}):null}var x=t(29837),f=t(94508);let b=[{label:"Today",icon:i.Home,href:"/dashboard"},{label:"Calendar",icon:i.Calendar,href:"/dashboard/calendar"},{label:"Listings",icon:i.Building2,href:"/dashboard/listings"},{label:"Messages",icon:i.MessageSquare,href:"/dashboard/messages"}],m=[{label:"Explore",icon:i.Compass,href:"/search"},{label:"Wishlist",icon:i.Heart,href:"/dashboard/wishlist"},{label:"Trips",icon:i.Briefcase,href:"/trips"},{label:"Messages",icon:i.MessageSquare,href:"/dashboard/messages"}],p=[{label:"Requests",icon:i.UserPlus,href:"/dashboard/organization/requests"},{label:"Travelers",icon:i.Stethoscope,href:"/dashboard/organization/travelers"},{label:"Assignments",icon:i.Home,href:"/dashboard/organization/placements"},{label:"Messages",icon:i.MessageSquare,href:"/dashboard/messages"}],g="--tnh-tabbar-height";function j(){let e=(0,o.usePathname)(),s=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=document.documentElement,t=s.current;if(!t)return;let a=()=>e.style.setProperty(g,`${Math.ceil(t.getBoundingClientRect().height)}px`);a();let r=new ResizeObserver(a);return r.observe(t),()=>{r.disconnect(),e.style.removeProperty(g)}},[]);
1let{isHosting:t,isHost:n,isOrgMember:c}=(0,d.K)();return(0,a.jsx)("div",{ref:s,className:"fixed bottom-notice inset-x-0 z-40 md:hidden bg-white border-t border-[#091628]/10",children:(0,a.jsxs)("div",{className:"px-2 pt-2 pb-[env(safe-area-inset-bottom,8px)] grid grid-cols-5 text-center",children:[(t&&n?b:c?p:m).map(s=>{var t;let r=!!("/dashboard"===(t=s.href)&&"/dashboard"===e||"/search"===t&&("/search"===e||"/"===e)||"/dashboard"!==t&&"/search"!==t&&e.startsWith(t)),n=s.icon;return(0,a.jsxs)(l.default,{href:s.href,className:(0,f.cn)("flex flex-col items-center py-1",r?"text-[#091628]":"text-[#091628]/40"),children:[(0,a.jsx)(n,{size:22,strokeWidth:r?2:1.5}),(0,a.jsx)("p",{className:(0,f.cn)("text-body-ui mt-0.5",r?"font-extrabold":"font-bold"),children:s.label})]},s.label)}),(0,a.jsxs)("button",{onClick:()=>window.dispatchEvent(new CustomEvent("tnh:open-drawer")),className:"flex flex-col items-center py-1 text-[#091628]/40",children:[(0,a.jsx)(i.Menu,{size:22}),(0,a.jsx)("p",{className:"text-body-ui font-medium mt-0.5",children:"Menu"})]})]})})}var v=t(33145),w=t(7347);let N=[{label:"Wishlist",href:"/dashboard/wishlist"},{label:"Trips",href:"/trips"},{label:"Messages",href:"/dashboard/messages"},{label:"Profile",href:"/dashboard/profile"}],y=[{label:"Today",href:"/dashboard"},{label:"Listings",href:"/dashboard/listings"},{label:"Reservations",href:"/dashboard/reservations"},{label:"Messages",href:"/dashboard/messages"},{label:"Profile",href:"/dashboard/profile"}],C=[{label:"Housing requests",href:"/dashboard/organization/requests"},{label:"Travelers",href:"/dashboard/organization/travelers"},{label:"Assignments",href:"/dashboard/organization/placements"},{label:"Messages",href:"/dashboard/messages"},{label:"Profile",href:"/dashboard/profile"}],k=[{label:"Notifications",href:"/notifications"},{label:"Help",href:"/dashboard/help"}];function S({userInitial:e,avatarKey:s,isHost:t}){let[o,i]=(0,r.useState)(!1),c=(0,r.useRef)(null),{isHosting:h,isOrgMember:u}=(0,d.K)(),x=function(){let[e,s]=(0,r.useState)(0);return(0,r.useEffect)(()=>{let e=!0,t=()=>{fetch("/api/v1/notifications/unread-count").then(e=>e.ok?e.json():null).then(t=>{e&&t&&s(t.count||0)}).catch(()=>{})};t();let a=setInterval(t,3e4);return()=>{e=!1,clearInterval(a)}},[]),e}();return(0,r.useEffect)(()=>{if(!o)return;let e=e=>{c.current&&!c.current.contains(e.target)&&i(!1)},s=e=>{"Escape"===e.key&&i(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",s),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",s)}},[o]),(0,a.jsxs)("div",{className:"relative shrink-0",ref:c,children:[(0,a.jsx)("button",{type:"button","aria-haspopup":"menu","aria-expanded":o,"aria-label":"Account menu",onClick:()=>i(e=>!e),className:"w-8 h-8 aspect-square rounded-full bg-[#091628] text-white grid place-items-center text-sm font-medium ml-1 shrink-0 overflow-hidden relative focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#091628] focus-visible:ring-offset-2",children:s?(0,a.jsx)(v.default,{src:(0,w.s)(s),alt:"",fill:!0,className:"object-cover",sizes:"32px"}):e}),x>0&&(0,a.jsx)("span",{role:"status","aria-label":`${x} unread notifications`,className:"pointer-events-none absolute -top-1 -right-1 min-w-[18px] h-[18px] flex items-center justify-center rounded-full bg-red-500 text-white text-body-ui font-medium leading-none px-1",children:x>99?"99+":x}),o&&(0,a.jsxs)("div",{role:"menu",className:"absolute right-0 mt-2 w-[272px] rounded-control bg-surface py-3 shadow-menu border border-line z-overlay",children:[(u?C:h&&t?y:N).map(e=>(0,a.jsx)(l.default,{role:"menuitem",href:e.href,onClick:()=>i(!1),className:"flex h-10 items-center px-6 text-label font-medium text-ink hover:bg-fill",children:e.label},e.href)),(0,a.jsx)("div",{className:"my-2 mx-6 border-t border-line"}),k.map(e=>(0,a.jsx)(l.default,{role:"menuitem",href:e.href,onClick:()=>i(!1),className:"flex h-10 items-center px-6 text-label text-ink hover:bg-fill",children:e.label},e.href)),(0,a.jsx)("div",{className:"my-2 mx-6 border-t border-line"}),(0,a.jsx)("button",{type:"button",role:"menuitem",onClick:()=>{i(!1),(0,n.signOut)({callbackUrl:"/"})},className:"flex h-10 w-full items-center px-6 text-label text-ink hover:bg-fill",children:"Log out"})]})]})}function z({count:e}){return e?(0,a.jsx)("span",{className:"absolute -top-1 -right-1 min-w-[18px] h-[18px] flex items-center justify-center rounded-full bg-red-500 text-white text-body-ui font-medium leading-none px-1",children:e>99?"99+":e}):null}let E=[{label:"Today",href:"/dashboard"},{label:"Calendar",href:"/dashboard/calendar"},{label:"Listings",href:"/dashboard/listings"},{label:"Messages",href:"/dashboard/messages"}],F=[{label:"Explore",href:"/search"},{label:"Wishlist",href:"/dashboard/wishlist"},{label:"Trips",href:"/trips"},{label:"Messages",href:"/dashboard/messages"}],M=[{label:"Requests",href:"/dashboard/organization/requests"},{label:"Travelers",href:"/dashboard/organization/travelers"},{label:"Assignments",href:"/dashboard/organization/placements"},{label:"Messages",href:"/dashboard/messages"}];function H({variant:e="default",searchSummary:s,onSearchClick:t}){let{data:c}
1=(0,n.useSession)()||{},{isHosting:h,toggleMode:f,isHost:b,isOrgMember:m}=(0,d.K)();(0,o.useRouter)();let p=(0,o.usePathname)(),[g,v]=(0,r.useState)(!1),[w,N]=(0,r.useState)(!1),y="minimal"===e;(0,r.useEffect)(()=>{let e=()=>N(window.scrollY>10);return window.addEventListener("scroll",e,{passive:!0}),()=>window.removeEventListener("scroll",e)},[]);let C=!!c?.user,k=c?.user?.firstName||c?.user?.name?.split(" ")[0]||"",H=k[0]?.toUpperCase()||c?.user?.email?.[0]?.toUpperCase()||"G",L=c?.user?.avatarStorageKey,q=function(){let{data:e}=(0,n.useSession)()||{},[s,t]=(0,r.useState)(0);return(0,r.useEffect)(()=>{if(!e?.user)return;let s=!0,a=()=>{fetch("/api/v1/conversations/unread-count").then(e=>e.ok?e.json():null).then(e=>{s&&e&&t(e.totalUnread||0)}).catch(()=>{})};a();let r=setInterval(a,3e4);return()=>{s=!1,clearInterval(r)}},[e?.user]),s}(),P=h?[{label:"Dashboard",href:"/dashboard"},{label:"Listings",href:"/dashboard/listings"},{label:"Reservations",href:"/dashboard/reservations"}]:[{label:"Explore",href:"/search"},{label:"Hospitals",href:"/hospitals"},{label:"Hosts",href:"/host"},{label:"Podcast",href:"/podcast",icon:i.Mic}],R=m?M:h&&b?E:F,T=[...P,...C?[{label:"Messages",href:"/dashboard/messages"}]:[]];return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("header",{className:`${y?"relative":"sticky top-0"} z-40 transition-all duration-300 ${w?"bg-white/95 backdrop-blur-md shadow-[0_1px_3px_rgba(9,22,40,0.06)]":"bg-white"} border-b border-line`,children:(0,a.jsxs)("div",{className:"mx-auto max-w-[1440px] px-4 sm:px-6 lg:px-10 h-[68px] flex items-center",children:[(0,a.jsx)(x.B,{className:"h-10 w-52 sm:h-9 sm:w-48 lg:h-10 lg:w-[220px]",priority:!0}),(0,a.jsxs)("div",{className:"flex-1 flex items-center justify-center",children:["compact"===e&&s&&(0,a.jsxs)("button",{onClick:t,className:"hidden sm:flex items-center gap-1 bg-white border border-line rounded-full shadow-[0_1px_6px_rgba(0,0,0,0.08)] hover:shadow-[0_2px_12px_rgba(0,0,0,0.12)] pl-5 pr-2 py-2 text-sm font-semibold transition-shadow",children:[(0,a.jsx)("span",{className:"truncate max-w-[400px]",children:s}),(0,a.jsx)("span",{className:"ml-2 w-8 h-8 rounded-full bg-[#ced02d] grid place-items-center text-[#091628] shrink-0",children:(0,a.jsx)(i.Search,{size:16})})]}),"app"===e&&(0,a.jsx)("nav",{className:"hidden md:flex items-center gap-1",children:R.map(e=>{let s="/dashboard"===e.href?"/dashboard"===p:p.startsWith(e.href);return(0,a.jsxs)(l.default,{href:e.href,className:`relative text-body-ui font-medium whitespace-nowrap px-4 py-2 transition-colors ${s?"text-[#091628]":"text-[#3D4F5F] hover:text-[#091628]"}`,children:[e.label,s&&(0,a.jsx)("span",{className:"absolute inset-x-4 -bottom-0.5 h-0.5 bg-[#091628] rounded-full"})]},e.href)})}),"compact"!==e&&"login"!==e&&"app"!==e&&(0,a.jsx)("nav",{className:"hidden lg:flex items-center gap-1",children:T.map(e=>{let s="/search"===e.href?"/search"===p:p===e.href,t=e.icon;return(0,a.jsxs)(l.default,{href:e.href,className:`text-body-ui font-medium transition-colors hover:text-[#091628] hover:bg-slate-50 whitespace-nowrap rounded-full px-4 py-2 flex items-center gap-1.5 ${s?"text-[#091628] font-semibold bg-slate-50":"text-[#3D4F5F]"}`,children:[t&&(0,a.jsx)(t,{className:"w-3.5 h-3.5"}),e.label]},e.label)})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:["login"===e?(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(l.default,{href:"/host",className:"hidden sm:inline-flex items-center justify-center text-body-ui font-medium bg-[#ced02d] text-[#091628] rounded-full px-5 h-9 leading-none hover:brightness-105 transition-all whitespace-nowrap",children:"List your place"})}):C?(0,a.jsxs)(a.Fragment,{children:[b?(0,a.jsx)("button",{onClick:f,className:"hidden sm:flex text-body-ui font-medium rounded-full px-3.5 py-2 hover:bg-slate-50 items-center gap-1.5 transition-colors whitespace-nowrap text-[#3D4F5F]",children:h?"Switch to Traveler":"Switch to Host"}):m?(0,a.jsx)(l.default,{href:"/search",className:"hidden sm:flex text-body-ui font-medium rounded-full px-3.5 py-2 hover:bg-slate-50 items-center gap-1.5 transition-colors whitespace-nowrap text-[#091628]",children:"Find Housing"}):(0,a.jsx)(l.default,{href:"/become-a-host",className:"hidden sm:flex text-body-ui font-medium rounded-full px-4 py-2 bg-[#ced02d] hover:bg-[#b5c025] items-center gap-1.5 transition-colors whitespace-nowrap text-[#091628]",children:"Become a Host"}),(0,a.jsx)(l.default,{href:"/dashboard/wishlist",className:"relative w-9 h-9 aspect-square rounded-full hover:bg-slate-50 grid place-items-center transition-colors hidden sm:grid shrink-0",children:(0,a.jsx)(i.Heart,{className:"w-[18px] h-[18px] text-[#091628]"})}),(0,a.jsxs)(l.default,{href:"/dashboard/messages",className:"relative w-9 h-9 aspect-square rounded-full hover:bg-slate-50 grid place-items-center transition-colors shrink-0",children:[(0,a.jsx)(i.MessageSquare,{className:"w-[18px] h-[18px] text-[#091628]"}),(0,a.jsx)(z,{count:q})]}),(0,a.jsx)(S,{userInitial:H,avatarKey:L,isHost:b})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.default,{href:"/login",className:"hidden sm:flex items-center text-body-ui font-medium text-[#091628] hover:text-slate-600 transition-colors h-9 px-3.5 rounded-full hover:bg-slate-50",children:"Log in"}),(0,a.jsx)(l.default,{href:"/host",className:"hidden sm:inline-flex items-center justify-center text-body-ui font-medium bg-[#ced02d] text-[#091628] rounded-full px-5 h-9 leading-none hover:brightness-105 transition-all whitespace-nowrap",children:"List your place"})]}),"login"!==e&&!C&&(0,a.jsx)(l.default,{href:"/login","aria-label":"Sign in",className:"sm:hidden w-9 h-9 aspect-square rounded-full bg-slate-100 grid place-items-center ml-1 shrink-0 hover:bg-slate-200 transition-colors",children:(0,a.jsx)(i.User,{size:20,className:"text-[#3D4F5F]"})}),(0,a.jsx)("button",{onClick:()=>v(!0),"aria-label":"Open menu",className:"w-9 h-9 aspect-square rounded-full border border-line grid place-items-center text-[#091628] hover:shadow-sm transition-all ml-1 shrink-0",children:(0,a.jsx)(i.Menu,{size:18})})]})]})}),c?.user&&!y&&(0,a.jsx)(j,{}),(0,a.jsx)(u,{open:g,onClose:()=>v(!1)})]})}},29837:function(e,s,t){t.d(s,{B:function(){return n}});
1var a=t(57437),r=t(27648),l=t(33145);function n({className:e="h-10 w-52",linkTo:s="/",priority:t=!1}){let n=(0,a.jsx)(l.default,{src:"/images/tnh-logo-v2.png",alt:"Travel Nurse Houses",width:600,height:100,priority:t,className:`${e} object-contain object-left w-auto`,sizes:"(max-width: 640px) 180px, 220px"});return!1===s?n:(0,a.jsx)(r.default,{href:s,className:"flex items-center shrink-0","aria-label":"Travel Nurse Houses home",children:n})}},7347:function(e,s,t){t.d(s,{s:function(){return r}});let a=(t(40257).env.CDN_URL||"https://cdn.travelnursehouses.ca").replace(/\/+$/,"");function r(e){if(!e)return"";if(/^https?:\/\//i.test(e))return e;let s=e.startsWith("/")?e.slice(1):e;return`${a}/${s}`}}}]);
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.