1import{c as f,r as d,b as h,j as e,az as u,p as m,aC as b}from"./index-DvhEnGG3.js";import{F as g}from"./Footer-BselVbtb.js";import{m as j,E as v}from"./EventMap-BcqxLvvH.js";import{S as w}from"./skeleton-RfpY2edk.js";import{t as c}from"./en-US-BF8dUB01.js";import{e as N}from"./endOfDay-BaudiAeu.js";import{A as y}from"./arrow-left-Y949Irqs.js";import{E as k}from"./earth-fhJxFMYW.js";import{M as E}from"./map-pin-CWEEbUVM.js";import{C as M}from"./calendar-days-BeDpXHdp.js";import{f as _}from"./format-CxxDD1Zd.js";import"./useMutation-5Qt1sQt-.js";import"./geocoding-DvxVO3br.js";import"./eventDates-Bo9vnE9I.js";import"./calendar-BTJHFAW8.js";import"./external-link-DhKCH367.js";const C=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],D=f("list-filter",C);function S(t,r){const a=c(t),n=c(r);return+a<+n}const F=t=>N(new Date(t.endDate||t.startDate));function $(){const[t,r]=d.useState("upcoming"),{data:a=[],isLoading:n,isError:o,refetch:x}=h({queryKey:["/api/events/all"],queryFn:async()=>{const s=await fetch("/api/events/all");if(!s.ok)throw new Error("Unable to load events");return s.json()}}),i=d.useMemo(()=>a.filter(s=>{const l=S(F(s),new Date);return t==="all"||(t==="past"?l:!l)}),[a,t]),p=j(i);return e.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[e.jsx(u,{}),e.jsxs("main",{className:"mx-auto w-full max-w-[1500px] flex-1 px-4 py-7 sm:px-6 lg:px-8",children:[e.jsxs("div",{className:"mb-6 flex flex-col justify-between gap-4 md:flex-row md:items-end",children:[e.jsxs("div",{children:[e.jsxs(m,{href:"/events",className:"mb-4 inline-flex items-center gap-1.5 text-sm font-semibold text-[#087f8c] hover:underline",children:[e.jsx(y,{className:"h-4 w-4"})," Back to event desk"]}),e.jsx("p",{className:"mb-2 text-xs font-semibold uppercase tracking-[0.24em] text-[#087f8c]",children:"SeaNews / World view"}),e.jsxs("h1",{className:"flex items-center gap-3 font-serif text-4xl font-bold tracking-tight text-[#123247]",children:[e.jsx(k,{className:"h-8 w-8 text-[#087f8c]"})," Global maritime events"]}),e.jsx("p",{className:"mt-2 max-w-2xl text-sm text-muted-foreground",children:"A live geographic read of the industry calendar. Select a marker to open the official event listing."})]}),e.jsx("div",{className:"flex items-center gap-1 rounded-lg border border-[#b7d8d7] bg-[#edf7f5] p-1",children:["upcoming","all","past"].map(s=>e.jsx("button",{onClick:()=>r(s),className:`rounded-md px-3 py-2 text-xs font-semibold capitalize transition ${t===s?"bg-[#123247] text-white shadow-sm":"text-[#075e69] hover:bg-white/70"}`,children:s},s))})]}),e.jsxs("div",{className:"mb-5 flex flex-col gap-3 rounded-xl border border-[#b9d7d2] bg-[#e6f3ef] p-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("p",{className:"text-sm font-semibold text-[#123247]",children:["Hosting a maritime event? ",e.jsx("span",{className:"font-normal text-[#38616a]",children:"Submit it to SeaNews."})]}),e.jsx(m,{href:"/events/submit",onClick:()=>b("event_submission_cta_opened",{placement:"events_map"}),className:"inline-flex items-center justify-center rounded-md bg-[#087f8c] px-4 py-2 text-sm font-bold text-white hover:bg-[#075e69]",children:"Submit your event"})]}),o?e.jsxs("div",{className:"rounded-xl border border-red-200 bg-red-50 p-10 text-center",children:[e.jsx("p",{className:"font-semibold text-red-900",children:"The map could not load."}),e.jsx("button",{onClick:()=>x(),className:"mt-4 rounded-md bg-[#123247] px-4 py-2 text-sm font-semibold text-white",children:"Retry"})]}):n?e.jsx(w,{className:"h-[calc(100dvh-250px)] min-h-[520px] w-full rounded-xl"}):e.jsx("div",{className:"overflow-hidden rounded-xl border border-[#9cc7c5] bg-[#dce9e8] shadow-[0_18px_55px_-30px_rgba(8,96,107,.8)]",children:e.jsxs("div",{className:"relative h-[calc(100dvh-250px)] min-h-[520px] w-full",children:[e.jsx(v,{events:i,detailed:!0}),e.jsxs("div",{className:"pointer-events-none absolute left-4 top-4 max-w-xs rounded-lg bg-[#123247]/95 px-4 py-3 text-white shadow-lg",children:[e.jsxs("p",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-[#9cd5d0]",children:[e.jsx(D,{className:"h-3.5 w-3.5"})," ",t," calendar"]}),e.jsxs("p",{className:"mt-1 text-sm",children:[i.length," listings · ",p," plotted locations"]})]}),e.jsxs("div",{className:"pointer-events-none absolute bottom-4 right-4 hidden rounded-lg bg-white/95 px-3 py-2 text-xs text-[#123247] shadow-md sm:block",children:[e.jsxs("p",{className:"flex items-center gap-1 font-semibold",children:[e.jsx(E,{className:"h-3.5 w-3.5 text-[#087f8c]"})," Marker details"]}
1),e.jsx("p",{className:"mt-0.5 text-muted-foreground",children:"Click any point to inspect the event"})]})]})}),!n&&!o&&e.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-x-5 gap-y-2 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(M,{className:"h-3.5 w-3.5 text-[#087f8c]"})," Dates use the event end date for live status"]}),e.jsxs("span",{children:[_(new Date,"d MMM yyyy")," · ",a.length," published listings"]})]})]}),e.jsx(g,{})]})}export{$ as default};
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.