PageSourceSearch

https://rideshareguides.com/assets/Group-o12GUmil.js

js rideshareguides.com collected 2026-10-08 20:46:58 UTC 70,898 bytes, 1 lines download raw bytes

1import{aN as Xe,r as i,b$ as et,j as e,aL as fe,h as de,a6 as tt,a as Y,K as ye,e as Be,b_ as st,a3 as $e,a$ as Ue,k as xe,cP as rt,v as nt,m as Ee,ak as be,aK as Se,aP as it,U as at,p as we,cQ as ot,l as ne,a2 as lt,ae as Re,b6 as He,aI as Je,aW as je,G as ct,cR as dt,cS as xt,cT as mt}from"./index-Bn97Kz8X.js";import{S as ut}from"./SEO-BjAPr8No.js";import{S as Ye}from"./shield-C7SKDxdr.js";import{C as pt}from"./clock-3-CzVCToOo.js";import{S as Ge}from"./share-2-m_Gi-ymW.js";import{L as ht}from"./link-2-Dh-NJZwU.js";import{I as ft}from"./info-WZWzOYAm.js";import{T as De}from"./trash-2-Bmo_dMlV.js";import{L as ue}from"./lock-BRypwRBS.js";import{C as bt}from"./clock-Dfd8vDx6.js";import{U as gt}from"./user-check-DLTD2Rz8.js";import{N as wt}from"./NotificationDrawer-D3-OsZY1.js";import{S as jt}from"./shield-alert-DnPSteYw.js";import{C as vt}from"./CoachCarlWidget-ClhGcv6b.js";import{B as Nt}from"./check-check-BQNbSXu7.js";import{P as Le}from"./plus-CPfhT_Zt.js";import{H as yt}from"./hash-iWZLCoLH.js";import{S as Pe}from"./settings-BeKR1yt2.js";import"./heart-BzUvHkye.js";import"./badge-check-Ch_7psaO.js";import"./use-voice-call-MugEvtaI.js";import"./file-text-CeuKdFir.js";import"./chevron-right-nGmEXHGw.js";function ve(s){const a=(s||"").trim().split(/\s+/);return a.length>=2?(a[0][0]+(a[1][0]||"")).toUpperCase():(s||"RSG").slice(0,2).toUpperCase()}function Te(s){if(!s)return"just now";const a=new Date(s),x=Date.now()-a.getTime(),d=Math.floor(x/6e4);if(d<1)return"just now";if(d<60)return`${d}m ago`;const u=Math.floor(d/60);if(u<24)return`${u}h ago`;const p=Math.floor(u/24);return p===1?"1d ago":p<7?`${p}d ago`:a.toLocaleDateString()}const St=s=>{const a=Math.floor(s/60),x=Math.floor(s%60);return`${a}:${x.toString().padStart(2,"0")}`};function kt(s){try{const a=/(?:youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9_-]+)/,x=s.match(a);if(x&&x[1])return x[1];const d=new URL(s);if(d.hostname.includes("youtu.be"))return d.pathname.split("/").filter(Boolean)[0]||null;if(d.hostname.includes("youtube.com")||d.hostname.includes("youtube-nocookie.com")){const u=d.searchParams.get("v");if(u)return u;const p=d.pathname.split("/").filter(Boolean),y=p.indexOf("embed");if(y>=0&&p[y+1])return p[y+1];const S=p.indexOf("shorts");if(S>=0&&p[S+1])return p[S+1]}}catch{}return null}function Ft(s){try{const a=/vimeo\.com\/(\d+)/,x=s.match(a);if(x&&x[1])return x[1];const d=new URL(s);if(!d.hostname.includes("vimeo.com"))return null;const u=d.pathname.split("/").filter(Boolean);for(let y=u.length-1;y>=0;y--)if(/^\d+$/.test(u[y]))return u[y];const p=u.indexOf("video");if(p>=0&&u[p+1]&&/^\d+$/.test(u[p+1]))return u[p+1]}catch{}return null}const Me="#F45815",_t="Join the worldwide rideshare driver community on RideShareGuides for tips, earnings, airport runs, and direct bookings.",Ie={facebook:{label:"Facebook",color:"text-[#1877F2]",hover:"hover:bg-[#1877F2]/10"},x:{label:"X",color:"text-zinc-900",hover:"hover:bg-zinc-900/5"},linkedin:{label:"LinkedIn",color:"text-[#0A66C2]",hover:"hover:bg-[#0A66C2]/10"},whatsapp:{label:"WhatsApp",color:"text-[#25D366]",hover:"hover:bg-[#25D366]/10"}};function Ct({platform:s}){return s==="facebook"?e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",className:"h-4 w-4",children:e.jsx("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})}):s==="x"?e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",className:"h-4 w-4",children:e.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}):s==="linkedin"?e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",className:"h-4 w-4",children:e.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.777 13.019H3.56V9h3.554v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})}):e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"
1currentColor",className:"h-4 w-4",children:e.jsx("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"})})}function zt({post:s,comments:a=[],currentUserEmail:x,onAddComment:d,onRemoveComment:u,submitting:p=!1,canModerate:y=!1,onDelete:S,deleting:V=!1,driverMap:R}){const j=Xe(),w=s.is_rsg_seed,[G,L]=i.useState(!1),[F,h]=i.useState(""),[P,O]=i.useState(!1),[_,H]=i.useState(null),b=st,W=_t,B=i.useMemo(()=>et(b,W),[b,W]),[c,m]=i.useState(!1),[k,$]=i.useState(!1),X=i.useRef(null),C=typeof navigator<"u"&&typeof navigator.share=="function";i.useEffect(()=>{if(!c)return;const l=q=>{X.current&&!X.current.contains(q.target)&&m(!1)},v=q=>{q.key==="Escape"&&m(!1)};return document.addEventListener("mousedown",l),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("keydown",v)}},[c]);const D=async()=>{try{await navigator.clipboard.writeText(b),$(!0),setTimeout(()=>$(!1),2e3),setTimeout(()=>m(!1),700)}catch{try{const l=document.createElement("textarea");l.value=b,l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l),l.select(),document.execCommand("copy"),document.body.removeChild(l),$(!0),setTimeout(()=>$(!1),2e3),setTimeout(()=>m(!1),700)}catch{$(!1)}}},f=async()=>{var l,v,q,re;if(!C){m(A=>!A);return}try{await navigator.share({title:"RideShareGuides",text:W,url:b})}catch(A){if(((A==null?void 0:A.name)||"")==="AbortError"||(v=(l=A==null?void 0:A.message)==null?void 0:l.toLowerCase)!=null&&v.call(l).includes("abort")||(re=(q=A==null?void 0:A.message)==null?void 0:q.toLowerCase)!=null&&re.call(q).includes("cancel"))return;m(!0)}},z=l=>{const v=B[l];window.open(v,"_blank","noopener,noreferrer,width=600,height=520"),m(!1)},E=a.filter(l=>(l.status||"visible")==="visible"),K=(s.email||s.profile_email||"").trim().toLowerCase(),ee=K,ie=!!s.is_own||!!x&&ee===x.toLowerCase(),te=K.endsWith(".example")||K.includes("example.com"),I=!w&&!te?R==null?void 0:R[K]:void 0,o=!!I,g=()=>{if(!(w||te)&&I){if(I.micrositeSlug){j(`/microsite/${I.micrositeSlug}`);return}if(I.driverId){j(`/pro-driver/${I.driverId}`);return}}};if((s.status||"").toLowerCase()==="removed")return null;const M=async()=>{const l=F.trim();if(!(!l||l.length<1)&&!(l.length>1e3)&&d){O(!0);try{await d(s.id,l),h(""),L(!0)}finally{O(!1)}}},ae=async l=>{if(u){H(l);try{await u(l,s.id)}finally{H(null)}}},se=p||P;return e.jsxs("div",{className:"overflow-hidden rounded-[20px] border border-stone-200 bg-white shadow-[0_1px_0_0_rgba(0,0,0,0.02)]",children:[e.jsx("div",{className:`h-1 w-full ${w?"bg-gradient-to-r from-[#F45815] to-orange-300":"bg-zinc-900"}`}),e.jsxs("div",{className:"p-4 sm:p-5",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[o?e.jsx("button",{onClick:g,title:"View driver profile",className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-full border text-[11px] font-bold transition ${w?"border-orange-200 bg-orange-50 text-orange-700":"border-zinc-200 bg-zinc-900 text-white hover:ring-2 hover:ring-orange-200"}`,children:ve(s.display_name)}):e.jsx("div",{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-full border text-[11px] font-bold ${w?"border-orange-200 bg-orange-50 text-orange-700":"border-zinc-200 bg-zinc-900 text-white"}`,children:ve(s.display_name)}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o?e.jsx("button",{onClick:g,title:"View driver profile",className:"truncate text-left text-[14px] font-semibold text-zinc-900 transition hover:text-[#F45815] hover:underline cursor-pointer",children:s.display_name}):e.jsx("p",{className:"truncate text-[14px] font-semibold text-zinc-900",children:s.display_name}),w?e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-orange-200 bg-orange-50 px-2 py-0.5 text-[10px] font-bold uppercase tracking-widest text-orange-700",children:[e.jsx(Ye,{className:"h-3 w-3"})," RSG-created starter profile"]}):e.jsx("span",{className:"inline-flex items-center rounded-full border border-zinc-200 bg-zinc-50 px-2 py-0.5 text-[10px] font-semibold text-zinc-600",children:"Member"})]}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-[11px] text-zinc-500",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(pt,{className:"h-3 w-3"})," ",Te(s.created_at)]}),s.city_tag&&e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(fe,{className:"h-3 w-3"})," ",s.city_tag]}),s.category&&e.jsx("span",{className:"rounded-full bg-stone-50 px-2 py-0.5 text-[10px] font-medium ring-1 ring-stone-100",children:s.category}),e.jsxs("div",{ref:X,className:"relative ml-auto inline-block",children:[e.jsxs("button",{onClick:f,onContextMenu:l=>{l.preventDefault(),m(v=>!v)},className:"inline-flex items-center gap-1 rounded-full border border-zinc-200 bg-white px-2.5 py-1 text-[10px] font-semibold text-zinc-700 shadow-sm transition hover:bg-zinc-50 hover:border-zinc-300","aria-label":"Share RideShareGuides","aria-haspopup":"menu","aria-expanded":c,children:[k?e.jsx(de,{className:"h-3 w-3 text-emerald-600"}):e.jsx(Ge,{className:"h-3 w-3"}),k?"Copied":"Share"]}),c&&e.jsxs("div",{role:"menu",className:"absolute right-0 top-full z-50 mt-2 w-60 overflow-hidden rounded-xl border border-zinc-200 bg-white p-2 shadow-[0_12px_32px_rgba(0,0,0,0.12)]",children:[e.jsx("div",{className:"mb-1 px-2 py-1 text-[10px] font-bold uppercase tracking-widest text-zinc-400",children:"Share to — rideshareguides.com"}),e.jsx("div",{className:"px-2 pb-2 text-[11px] leading-snug text-zinc-500",children:"Invite drivers to the public community on rideshareguides.com"}),Object.keys(Ie).map(l=>{const v=Ie[l];return e.jsxs("button",{role:"menuitem",onClick:()=>z(l),className:`flex w-full items-center gap-2.5 rounded-lg px-3 py-2.5 text-[13px] font-medium text-zinc-800 transition ${v.hover}`,children:[e.jsx("span",{className:v.color,children:e.jsx(Ct,{platform:l})}),v.label,e.jsx(tt,{className:"ml-auto h-3 w-3 text-zinc-400"})]},l)}),e.jsx("div",{className:"my-1 h-px bg-zinc-100"}),e.jsxs("button",{role:"menuitem",onClick:D,className:"flex w-full items-center gap-2.5 rounded-lg px-3 py-2.5 text-[13px] font-medium text-zinc-800 transition hover:bg-zinc-50",children:[k?e.jsx(de,{className:"h-4 w-4 text-emerald-600"}):e.jsx(ht,{className:"h-4 w-4 text-zinc-500"}),k?"Copied!":"Copy Link",e.jsx("span",{className:"ml-auto max-w-[88px] truncate text-[10px] text-zinc-400",children:"ri
1deshareguides.com"})]}),C&&e.jsxs("button",{role:"menuitem",onClick:f,className:"flex w-full items-center gap-2.5 rounded-lg px-3 py-2.5 text-[13px] font-medium text-zinc-800 transition hover:bg-zinc-50",children:[e.jsx(Ge,{className:"h-4 w-4 text-zinc-500"}),"More options"]})]})]})]}),w&&e.jsxs("div",{className:"mt-2 rounded-xl border border-orange-100 bg-orange-50/70 px-3 py-2 text-[11px] leading-relaxed text-zinc-600",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 font-semibold text-orange-700",children:[e.jsx(ft,{className:"h-3 w-3"})," ",s.team_label||"RSG Community Team"]}),e.jsx("span",{className:"ml-1",children:"— This is fictional starter content created by RSG to seed the community. Not a real member post."})]}),ie&&S&&e.jsx("div",{className:"mt-2",children:e.jsxs("button",{onClick:()=>S(),disabled:!!V,className:"inline-flex items-center gap-1.5 rounded-full border border-red-200 bg-white px-3 py-1 text-[11px] font-semibold text-red-600 shadow-sm transition hover:bg-red-50 disabled:opacity-50",children:[V?e.jsx(Y,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(De,{className:"h-3.5 w-3.5"}),V?"Deleting...":"Delete post"]})})]})]}),e.jsx("div",{className:"mt-4 rounded-2xl bg-white p-4 ring-1 ring-stone-100",children:e.jsx("p",{className:"whitespace-pre-wrap break-words text-[14px] leading-relaxed text-zinc-800",children:s.content})}),s.video_url&&e.jsxs("div",{className:"relative mt-3",children:[s.video_url.includes("youtube.com")||s.video_url.includes("youtu.be")?e.jsx("iframe",{src:`https://www.youtube-nocookie.com/embed/${kt(s.video_url)||""}`,className:"w-full aspect-video rounded-xl border bg-black",allowFullScreen:!0,title:"YouTube video",loading:"lazy"}):s.video_url.includes("vimeo.com")?e.jsx("iframe",{src:`https://player.vimeo.com/video/${Ft(s.video_url)||""}`,className:"w-full aspect-video rounded-xl border bg-black",allowFullScreen:!0,title:"Vimeo video",loading:"lazy"}):e.jsx("video",{src:s.video_url,controls:!0,playsInline:!0,preload:"metadata",className:"w-full max-h-[560px] rounded-xl border bg-black",style:{maxHeight:560}}),s.video_duration_seconds&&s.video_duration_seconds>0&&e.jsx("span",{className:"absolute bottom-2 right-2 bg-black/70 text-white text-xs px-2 py-0.5 rounded font-medium",children:St(s.video_duration_seconds)})]}),w&&e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"rounded-full border border-orange-200 bg-white px-2.5 py-1 text-[10px] font-semibold text-orange-700",children:s.seed_label||"Starter Post"}),e.jsx("span",{className:"text-[10px] text-zinc-400",children:"RSG seed content is clearly labeled and only visible to group members."})]}),e.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[e.jsxs("button",{onClick:()=>L(l=>!l),className:"inline-flex items-center gap-1.5 rounded-full border border-zinc-200 bg-white px-3 py-1.5 text-[11px] font-semibold text-zinc-700 shadow-sm transition hover:bg-zinc-50","aria-label":G?"Hide replies":"Show replies",children:[e.jsx(ye,{className:"h-3.5 w-3.5",style:{color:Me}}),E.length===0?"Reply":`${E.length} ${E.length===1?"reply":"replies"}`]}),E.length>0&&!G&&e.jsx("span",{className:"text-[11px] text-zinc-400",children:"Tap to read conversation"})]}),G&&e.jsxs("div",{className:"mt-4 border-t border-stone-100 pt-4",children:[E.length>0?e.jsx("div",{className:`space-y-3 ${E.length>4?"max-h-[320px] overflow-y-auto pr-1":""}`,children:E.map(l=>{const v=l.is_own||y;return e.jsxs("div",{className:"flex gap-2.5",children:[e.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-stone-200 bg-stone-50 text-[10px] font-bold text-zinc-700",children:ve(l.display_name)}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-[12px] font-semibold text-zinc-900",children:l.display_name}),e.jsx("span",{className:"text-[10px] text-zinc-400",children:Te(l.created_at)}),l.is_own&&e.jsx("span",{className:"rounded-full bg-zinc-900 px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wide text-white",children:"You"})]}),e.jsx("div",{className:"mt-1 rounded-2xl rounded-tl-sm bg-stone-50 px-3.5 py-2.5 ring-1 ring-stone-100",children:e.jsx("p",{className:"whitespace-pre-wrap break-words text-[13px] leading-relaxed text-zinc-800",children:l.body})})]}),v&&u&&e.jsx("button",{onClick:()=>ae(l.id),disabled:_===l.id,className:"ml-1 flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-zinc-200 bg-white text-zinc-400 transition hover:border-red-200 hover:bg-red-50 hover:text-red-600 disabled:opacity-50","aria-label":"Remove c
1omment",title:l.is_own?"Remove your comment":"Remove comment as moderator",children:_===l.id?e.jsx(Y,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(De,{className:"h-3.5 w-3.5"})})]},l.id)})}):e.jsx("div",{className:"rounded-xl border border-dashed border-stone-200 bg-stone-50/60 px-4 py-3 text-center text-[12px] text-zinc-500",children:"No replies yet. Start the conversation below."}),x?e.jsxs("div",{className:"mt-4 flex items-end gap-2",children:[e.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-zinc-900 text-[10px] font-bold text-white",children:x.slice(0,2).toUpperCase()}),e.jsxs("div",{className:"flex flex-1 items-end gap-2 rounded-2xl border border-stone-200 bg-white p-1.5 shadow-sm focus-within:border-orange-200 focus-within:ring-2 focus-within:ring-orange-100",children:[e.jsx("textarea",{value:F,onChange:l=>h(l.target.value),placeholder:"Write a reply...",rows:1,maxLength:1e3,className:"max-h-[88px] min-h-[36px] flex-1 resize-none bg-transparent px-3 py-2 text-[13px] leading-relaxed text-zinc-900 placeholder:text-zinc-400 focus:outline-none",onKeyDown:l=>{l.key==="Enter"&&!l.shiftKey&&(l.preventDefault(),M())}}),e.jsx("button",{onClick:M,disabled:se||F.trim().length===0,className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-white shadow-[0_4px_10px_rgba(244,88,21,0.22)] transition hover:opacity-90 disabled:opacity-50",style:{background:Me},"aria-label":"Send reply",children:se?e.jsx(Y,{className:"h-4 w-4 animate-spin"}):e.jsx(Be,{className:"h-4 w-4"})})]})]}):e.jsx("div",{className:"mt-3 text-[11px] text-zinc-400",children:"Sign in to reply to this post."}),e.jsx("div",{className:"mt-2 text-right text-[10px] text-zinc-400",children:F.length>0?`${F.length}/1000`:""})]})]})]})}const me="#F45815",Et=["South Florida","Miami-Dade","Miami","Broward","Fort Lauderdale","Hollywood","Palm Beach","West Palm Beach","Boca Raton","Pompano Beach","Coral Springs","Hialeah"];function Rt({open:s,onClose:a,onCreated:x,createFn:d}){const[u,p]=i.useState(""),[y,S]=i.useState(""),[V,R]=i.useState("South Florida"),[j,w]=i.useState("private"),[G,L]=i.useState("instant"),[F,h]=i.useState(!1),[P,O]=i.useState(null);if(!s)return null;const _=u.trim().length>=3&&y.trim().length>=10&&V.trim().length>=2,H=async()=>{var b,W,B;if(!(!_||F)){h(!0),O(null);try{const c={name:u.trim(),description:y.trim(),city_scope:V.trim(),privacy:j,join_policy:j==="public"?"instant":G},m=await d(c);if(m!=null&&m.error||(b=m==null?void 0:m.data)!=null&&b.error){O((m==null?void 0:m.error)||((W=m==null?void 0:m.data)==null?void 0:W.error)||"Could not create group");return}const k=(m==null?void 0:m.group)||((B=m==null?void 0:m.data)==null?void 0:B.group);if(!k){O("Group response missing. Try refreshing.");return}p(""),S(""),R("South Florida"),w("private"),L("instant"),x(k)}catch(c){O((c==null?void 0:c.message)||"Could not create group. Please try again.")}finally{h(!1)}}};return e.jsx("div",{className:"fixed inset-0 z-[90] flex items-end justify-center bg-black/30 px-0 pb-0 sm:items-center sm:px-4 sm:pb-4 backdrop-blur-[2px] overflow-x-hidden",children:e.jsxs("div",{className:"w-full max-h-[90vh] overflow-hidden rounded-t-[24px] border border-stone-200 bg-white shadow-[0_24px_80px_rgba(0,0,0,0.18)] sm:rounded-[24px] sm:max-w-[520px] flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-stone-100 px-5 py-4 sm:px-6",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"text-[16px] font-bold tracking-tight text-zinc-900",children:"Start a Group"}),e.jsx("p",{className:"mt-0.5 text-[12px] leading-relaxed text-zinc-500",children:"Public or private. You become the owner instantly."})]}),e.jsx("button",{onClick:a,className:"flex h-9 w-9 items-center justify-center rounded-full border border-zinc-200 bg-white text-zinc-600 hover:bg-zinc-50","aria-label":"Close",children:e.jsx($e,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-5 sm:px-6 space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] font-bold uppercase tracking-widest text-zinc-600",children:"Group name"}),e.jsx("input",{value:u,onChange:b=>p(b.target.value),placeholder:"e.g. Broward Airport Queue Crew",maxLength:80,className:"mt-2 w-full rounded-2xl border border-stone-200 bg-white px-4 py-3 text-[14px] font-medium text-zinc-900 placeholder:text-zinc-400 focus:border-orange-200 focus:outline-none focus:ring-2 focus:ring-orange-100"}),e.jsxs("p",{className:"mt-1.5 text-[11px] text-zinc-400",children:[u.length,"/80"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] font-bold uppercase tracking-widest text-zinc-600",children:"Short purpose"}),e.jsx("textarea",{value:y,onChange:b=>S(b.target.value),placeholder:"What is this group for? Who should join? What will you share?",maxLength:500,className:"mt-2 min-h-[96px] w-full resize-none rounded-2xl border border-stone-200 bg-white px-4 py-3 text-[14px] leading-relaxed text-zinc-900 placeholder:text-zinc-400 focus:border-orange-200 focus:outline-none focus:ring-2 focus:ring-orange-100"}),e.jsxs("p",{className:"mt-1.5 text-[11px] text-zinc-400",children:[y.length,"/500 • Be specific, 10 characters minimum"]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-1 text-[11px] font-bold uppercase tracking-widest text-zinc-600",children:[e.jsx(fe,{className:"h-3 w-3"})," South Florida city / area"]}),e.jsx("select",{value:V,onChange:b=>R(b.target.value),className:"mt-2 w-full rounded-2xl border border-stone-200 bg-white px-4 py-3 text-[14px] font-medium text-zinc-900 focus:border-orange-200 focus:outline-none focus:ring-2 focus:ring-orange-100",children:Et.map(b=>e.jsx("option",{value:b,children:b},b))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] font-bold uppercase tracking-widest text-zinc-600",children:"Privacy"}),e.jsxs("div",{className:"mt-2 grid grid-cols-1 gap-3 sm:grid-cols-2",children:[e.jsxs("button",{type:"button",onClick:()=>w("public"),className:`text-left rounded-2xl border p-4 transition ${j==="public"?"border-[#F45815] bg-orange-50 ring-1 ring-orange-200":"border-stone-200 bg-white hover:border-stone-300"}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:`flex h-8 w-8 items-center justify-center rounded-full border ${j==="public"?"border-orange-200 bg-white text-orange-600":"border-zinc-200 bg-zinc-50 text-zinc-600"}`,children:e.jsx(Ue,{className:"h-4 w-4"})}),e.jsx("span",{className:"text-[13px] font-bold text-zinc-900",children:"Public"})]}),j==="public"&&e.jsx(de,{className:"h-4 w-4",style:{color:me}})]}),e.jsx("p",{className:"mt-2 text-[11px] leading-relaxed text-zinc-600",children:"Anyone signed in can read posts without joining. Posting still requires joining."}),e.jsx("p",{className:"mt-2 inline-flex rounded-full bg-white px-2 py-0.5 text-[10px] font-semibold ring-1 ring-stone-200",children:"Free • Instant to post"})]}),e.jsxs("button",{type:"button",onClick:()=>w("private"),className:`text-left rounded-2xl border p-4 transition ${j==="private"?"border-[#F45815] bg-orange-50 ring-1 ring-orange-200":"border-stone-200 bg-white hover:border-stone-300"}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:`flex h-8 w-8 items-center justify-center rounded-full border ${j==="private"?"border-orange-200 bg-white text-orange-600":"border-zinc-200 bg-zinc-50 text-zinc-600"}`,children:e.jsx(ue,{className:"h-4 w-4"})}),e.jsx("span",{className:"text-[13px] font-bold text-zinc-900",children:"Private"})]}),j==="private"&&e.jsx(de,{className:"h-4 w-4",style:{color:me}})]}),e.jsx("p",{className:"mt-2 text-[11px] leading-relaxed text-zinc-600",children:"Only members can read and post. Descriptions are public."}),e.jsx("p",{className:"mt-2 inline-flex rounded-full bg-white px-2 py-0.5 text-[10px] font-semibold ring-1 ring-stone-200",children:"Free • Members only"})]})]})]}),j==="private"&&e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] font-bold uppercase tracking-widest text-zinc-600",children:"How should people join this private group?"}),e.jsxs("div",{className:"mt-2 grid grid-cols-1 gap-3 sm:grid-cols-2",children:[e.jsxs("button",{type:"button",onClick:()=>L("instant"),className:`text-left rounded-2xl border p-4 transition ${G==="instant"?"border-[#F45815] bg-orange-50 ring-1 ring-orange-200":"border-stone-200 bg-white hover:border-stone-300"}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:`flex h-8 w-8 items-center justify-center rounded-full border ${G==="instant"?"border-orange-200 bg-white text-orange-600":"border-zinc-200 bg-zinc-50 text-zinc-600"}`,children:e.jsx(bt,{className:"h-4 w-4"})}),e.jsx("span",{className:"text-[13px] font-bold text-zinc-900",children:"Instant Join"})]}),G==="instant"&&e.jsx(de,{className:"h-4 w-4",style:{color:me}})]}),e.jsx("p",{className:"mt-2 text-[11px] leading-relaxed text-zinc-600",children:"Anyone can join right away and start reading and posting."})]}),e.jsxs("button",{type:"button",onClick:()=>L("approval"),className:`text-left rounded-2xl border p-4 transition ${G==="approval"?"border-[#F45815] bg-orange-50 ring-1 ring-orange-200":"border-stone-200 bg-white hover:border-stone-300"}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:`flex h-8 w-8 items-center justify-center rounded-full border ${G==="approval"?"border-orange-200 bg-white text-orange-600":"border-zinc-200 bg-zinc-50 text-zinc-600"}`,children:e.jsx(gt,{className:"h-4 w-4"})}),e.jsx("span",{className:"text-[13px] font-bold text-zinc-900",children:"Owner Approval"})]}),G==="approval"&&e.jsx(de,{className:"h-4 w-4",style:{color:me}})]}),e.jsx("p",{className:"mt-2 text-[11px] leading-relaxed text-zinc-600",children:"Requests go to you first. You approve or reject in Manage Group."})]})]})]}),j==="public"&&e.jsxs("div",{className:"flex gap-2 rounded-xl border border-stone-200 bg-stone-50 px-3 py-2.5 text-[11px] leading-relaxed text-zinc-600",children:[e.jsx(Ye,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-zinc-500"}),e.jsx("span",{children:"Public groups are always instant join. Anyone signed in can read before joining, members can post."})]}),P&&e.jsx("div",{className:"rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-[12px] font-medium leading-relaxed text-red-800",children:P})]}),e.jsxs("div",{className:"border-t border-stone-100 bg-stone-50/70 px-5 py-4 sm:px-6 flex items-center justify-between gap-3",children:[e.jsx("button",{onClick:a,disabled:F,className:"rounded-full border border-zinc-200 bg-white px-5 py-2.5 text-[12px] font-bold text-zinc-700 hover:bg-zinc-50 disabled:opacity-50",children:"Cancel"}),e.jsxs("button",{onClick:H,disabled:!_||F,className:"inline-flex items-center gap-2 rounded-full px-6 py-2.5 text-[13px] font-bold text-white shadow-[0_4px_14px_rgba(244,88,21,0.22)] transition hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",style:{background:me},children:[F?e.jsx(Y,{className:"h-4 w-4 animate-spin"}):e.jsx(xe,{className:"h-4 w-4"}),F?"Creating...":"Create Group"]})]})]})})}function Gt(s){const a=(s==null?void 0:s.data)??s;if(a!=null&&a.error||a!=null&&a.code&&(a==null?void 0:a.ok)===!1){const x=new Error(a.error||"Me
1ssaging is temporarily unavailable");throw x.code=a.code,x}return a}function pe(s){var x;const a=String((s==null?void 0:s.code)||((x=s==null?void 0:s.data)==null?void 0:x.code)||"").toLowerCase();return a==="unauthenticated"||a==="unauthorized"?"Sign in again to use private group messages.":a==="not_a_member"?"Join this group before messaging its members.":a==="target_not_member"?"That member is no longer active in this group.":a==="forbidden"?"You do not have access to that private conversation.":a==="not_found"?"That group or conversation is no longer available.":a==="validation"?"Check the group or message details and try again.":"Private messages are temporarily unavailable. Please try again."}function Ae(s){if(!s)return"";const a=new Date(s);return Number.isNaN(a.getTime())?"":a.toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function Ne(s){const a=s.trim().split(/\s+/).filter(Boolean);return(a.length>1?a[0][0]+a[1][0]:s.slice(0,2)).toUpperCase()}function Dt({isOpen:s,onClose:a,groupId:x,groupSlug:d,groupName:u,currentUserId:p,currentUserDisplayName:y,startWithUserId:S,startWithDisplayName:V,onStartHandled:R,onUnreadChange:j}){const[w,G]=i.useState([]),[L,F]=i.useState([]),[h,P]=i.useState(null),[O,_]=i.useState([]),[H,b]=i.useState(!1),[W,B]=i.useState(!1),[c,m]=i.useState(!1),[k,$]=i.useState(""),[X,C]=i.useState(null),D=i.useRef(null),f=i.useRef(null),z=i.useCallback(async(o,g={})=>Gt(await rt({action:o,group_id:x,group_slug:d,...g})),[x,d]),E=i.useCallback(async()=>{const g=(await z("threads")).threads||[];return F(g),j==null||j(g.reduce((T,M)=>T+(M.unread_count||0),0)),g},[z,j]),J=i.useCallback(async(o,g=!1)=>{g||B(!0);try{const T=await z("messages",{thread_id:o});_(T.messages||[]);const M=T.thread;M!=null&&M.id&&(P(M),F(ae=>ae.map(se=>se.id===M.id?M:se))),await E(),window.setTimeout(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight)},50)}catch(T){C(pe(T))}finally{g||B(!1)}},[E,z]),K=i.useCallback(async o=>{C(null),P(o),_([]),await J(o.id)},[J]),ee=i.useCallback(async o=>{if(o){C(null),B(!0);try{const T=(await z("start",{target_user_id:o})).thread;P(T),_([]),await J(T.id,!0),R==null||R()}catch(g){C(pe(g))}finally{B(!1)}}},[J,R,z]),ie=i.useCallback(async()=>{if(!x&&!d){C("Open a group first to message its members.");return}b(!0),C(null),P(null),_([]);try{const[o]=await Promise.all([z("members"),E()]);G(o.members||[])}catch(o){C(pe(o))}finally{b(!1)}},[x,d,E,z]);i.useEffect(()=>{if(!s){D.current=null,P(null),_([]);return}ie()},[s,ie]),i.useEffect(()=>{!s||!S||H||D.current===S||!w.length||(D.current=S,ee(S))},[s,H,w.length,ee,S]),i.useEffect(()=>{if(!s||!(h!=null&&h.id))return;const o=window.setInterval(()=>J(h.id,!0),8e3);return()=>window.clearInterval(o)},[h==null?void 0:h.id,s,J]),i.useEffect(()=>{if(!s)return;const o=g=>{g.key==="Escape"&&a()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[s,a]);const te=i.useMemo(()=>w.filter(o=>o.user_id!==p),[p,w]),I=async()=>{const o=k.trim();if(!(!o||!h||c)){m(!0),C(null);try{const g=await z("send",{thread_id:h.id,body:o});_(T=>[...T,g.message]),$(""),await E(),window.setTimeout(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight)},40)}catch(g){C(pe(g))}finally{m(!1)}}};return e.jsx(nt,{children:s&&e.jsxs(e.Fragment,{children:[e.jsx(Ee.button,{"aria-label":"Close group messages",className:"fixed inset-0 z-40 cursor-default bg-zinc-950/25 backdrop-blur-[2px]",onClick:a,initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0}}),e.jsxs(Ee.aside,{role:"dialog","aria-modal":"true","aria-labelledby":"group-dm-title",className:"fixed right-0 top-0 z-50 flex h-[100dvh] w-full max-w-[520px] flex-col border-l border-[#F0E6D6] bg-white shadow-[-20px_0_70px_rgba(66,44,25,0.16)]",initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:30,stiffness:300},children:[e.jsxs("header",{className:"flex shrink-0 items-center justify-between border-b border-[#F0E6D6] bg-[#FFFBF0] px-4 py-4 sm:px-5",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-[#FFF1E8] text-[#F45815]",children:e.jsx(be,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{id:"group-dm-title",className:"truncate text-[15px] font-black text-zinc-900",children:u||"Group messages"}),e.jsxs("p",{className:"mt-0.5 flex items-center gap-1 text-[11px] text-stone-500",children:[e.jsx(ue,{className:"h-3 w-3"})," Private between group members"]})]})]}),e.jsx("button",{onClick:a,"aria-label":"Close group messages",className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-200 bg-white text-stone-600 hover:bg-stone-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#F45815]/30",children:e.jsx($e,{className:"h-4 w-4"})})]}),X&&e.jsxs("div",{role:"alert",className:"mx-4 mt-3 flex items-start gap-2 rounded-xl border border-amber-200 bg-amber-50 px-3 py-2.5 text-[12px] leading-relaxed text-amber-900 sm:mx-5",children:[e.jsx(jt,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("span",{children:X})]}),h?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-stone-100 px-4 py-3 sm:px-5",children:[e.jsx("button",{onClick:()=>{P(null),_([]),C(null)},"aria-label":"Back to members and conversations",className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-stone-200 bg-white text-stone-600 hover:bg-stone-50",children:e.jsx(Se,{className:"h-4 w-4"})}),e.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-[#F45815] text-[11px] font-bold text-white",children:Ne(h.other_member.display_name)}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-[13px] font-bold text-zinc-900",children:h.other_member.display_name}),e.jsx("p",{className:"text-[10px] text-stone-500",children:"Private conversation"})]})]}),e.jsx("div",{ref:f,className:"min-h-0 flex-1 overflow-y-auto bg-[#FFFEFD] px-4 py-4 sm:px-5",children:W?e.jsx("div",{className:"flex justify-center py-12 text-stone-400",children:e.jsx(Y,{className:"h-5 w-5 animate-spin"})}):O.length===0?e.jsxs("div",{className:"flex flex-col items-center py-16 text-center",children:[e.jsx(ye,{className:"h-8 w-8 text-stone-300"}),e.jsx("p",{className:"mt-3 text-[13px] font-semibold text-stone-700",children:"Start the conversation"}),e.jsxs("p",{className:"mt-1 text-[11px] text-stone-500",children:["Send a private note to ",h.other_member.display_name,"."]})]}):e.jsx("div",{className:"space-y-3",children:O.map(o=>e.jsx("div",{className:o.is_mine?"flex justify-end":"flex justify-start",children:e.jsxs("div",{className:`max-w-[84%] rounded-2xl px-3.5 py-2.5 ${o.is_mine?"rounded-br-sm bg-[#F45815] text-white":"rounded-bl-sm border border-stone-200 bg-white text-zinc-800"}`,children:[e.jsx("p",{className:"whitespace-pre-wrap break-words text-[13px] leading-relaxed",children:o.body}),e.jsx("p",{className:`mt-1 text-[10px] ${o.is_mine?"text-white/70":"text-stone-400"}`,children:Ae(o.created_at)})]})},o.id))})}),e.jsxs("div",{className:"shrink-0 border-t border-stone-200 bg-white p-3 sm:p-4",children:[e.jsxs("div",{className:"flex items-end gap-2",children:[e.jsx("textarea",{value:k,maxLength:2e3,onChange:o=>$(o.target.value),onKeyDown:o=>{o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),I())},rows:2,placeholder:`Message ${h.other_member.display_name}`,className:"min-h-[44px] flex-1 resize-none rounded-2xl border border-stone-200 bg-stone-50 px-3.5 py-2.5 text-[13px] focus:border-[#F45815] focus:bg-white focus:outline-none focus:ring-2 focus:ring-[#F45815]/15"}),e.jsx("button",{onClick:I,disabled:!k.trim()||c,"aria-label":"Send private message",className:"inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-[#F45815] text-white hover:bg-[#
1E84F12] disabled:opacity-40",children:c?e.jsx(Y,{className:"h-4 w-4 animate-spin"}):e.jsx(Be,{className:"h-4 w-4"})})]}),e.jsxs("p",{className:"mt-1 text-right text-[10px] text-stone-400",children:[k.length,"/2000"]})]})]}):e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-5",children:H?e.jsx("div",{className:"flex justify-center py-12 text-stone-400",children:e.jsx(Y,{className:"h-5 w-5 animate-spin"})}):e.jsxs(e.Fragment,{children:[e.jsxs("section",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("h3",{className:"flex items-center gap-2 text-[12px] font-black uppercase tracking-[0.14em] text-stone-600",children:[e.jsx(xe,{className:"h-4 w-4 text-[#F45815]"})," Active members"]}),e.jsx("span",{className:"rounded-full bg-[#FFF1E8] px-2 py-1 text-[10px] font-bold text-[#C9420E]",children:te.length})]}),e.jsx("p",{className:"mt-1 text-[11px] text-stone-500",children:"Choose a member to start a private conversation."}),e.jsx("div",{className:"mt-3 overflow-hidden rounded-2xl border border-stone-200 bg-white",children:te.length===0?e.jsx("p",{className:"px-4 py-6 text-center text-[12px] text-stone-500",children:"No other active members are available yet."}):te.map(o=>e.jsxs("div",{className:"flex items-center gap-3 border-b border-stone-100 px-3 py-3 last:border-0",children:[e.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-zinc-900 text-[11px] font-bold text-white",children:Ne(o.display_name)}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-[13px] font-semibold text-zinc-900",children:o.display_name}),e.jsx("p",{className:"text-[10px] capitalize text-stone-500",children:o.role||"member"})]}),e.jsx("button",{onClick:()=>
1ee(o.user_id),disabled:W,className:"rounded-full border border-orange-200 bg-orange-50 px-3 py-1.5 text-[11px] font-bold text-[#C9420E] hover:bg-orange-100 disabled:opacity-50",children:"Message"})]},o.user_id))})]}),e.jsxs("section",{className:"mt-7",children:[e.jsxs("h3",{className:"flex items-center gap-2 text-[12px] font-black uppercase tracking-[0.14em] text-stone-600",children:[e.jsx(ye,{className:"h-4 w-4 text-[#F45815]"})," Conversations"]}),L.length===0?e.jsxs("div",{className:"mt-3 rounded-2xl border border-dashed border-stone-200 bg-[#FFFBF0] px-4 py-7 text-center",children:[e.jsx(be,{className:"mx-auto h-7 w-7 text-stone-300"}),e.jsx("p",{className:"mt-2 text-[13px] font-semibold text-stone-700",children:"No conversations yet"}),e.jsx("p",{className:"mt-1 text-[11px] text-stone-500",children:"Your group conversations will appear here."})]}):e.jsx("div",{className:"mt-3 overflow-hidden rounded-2xl border border-stone-200 bg-white",children:L.map(o=>e.jsxs("button",{onClick:()=>K(o),className:"flex w-full items-center gap-3 border-b border-stone-100 px-3 py-3 text-left last:border-0 hover:bg-stone-50",children:[e.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-[#F45815] text-[11px] font-bold text-white",children:Ne(o.other_member.display_name)}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:`truncate text-[13px] ${o.unread_count?"font-black text-zinc-900":"font-semibold text-zinc-800"}`,children:o.other_member.display_name}),o.unread_count>0&&e.jsx("span",{className:"rounded-full bg-[#F45815] px-1.5 py-0.5 text-[10px] font-bold text-white",children:o.unread_count})]}),e.jsx("p",{className:"mt-0.5 truncate text-[11px] text-stone-500",children:o.last_message_preview||"No messages yet"}),e.jsx("p",{className:"mt-1 text-[10px] text-stone-400",children:Ae(o.last_message_at)})]})]},o.id))})]})]})})]})]})})}const Lt="https://ellprnxjjzatijdxcogk.supabase.co/storage/v1/render/image/public/project-favicons/6a81f2cd-581a-424d-8d04-0a09cf47dec3/9xrrufffexrbbkhc2dshz-67503787-e407-4650-a9d0-541536119d4a.png?width=200&resize=contain&quality=75",Pt="https://ellprnxjjzatijdxcogk.supabase.co/storage/v1/object/public/superdev-project-images/6a81f2cd-581a-424d-8d04-0a09cf47dec3/9xrrufffexrbbkhc2dshz/1785715109124-IMG-0545.gif",Tt="https://ellprnxjjzatijdxcogk.supabase.co/storage/v1/render/image/public/files/chat-generated-images/project-9xrrufffexrbbkhc2dshz/802bc08a-7f1e-461a-9a36-2ae25a979972.png?width=1200&resize=contain&quality=85";function he(){const s=encodeURIComponent(window.location.href);return`${"https://www.buildy.ai/api".replace(/\/api\/?$/,"").replace(/\/$/,"")}/auth/app-login?app_id=9xrrufffexrbbkhc2dshz&from_url=${s}`}function Mt(s,a){if(s&&s.trim().length>=2)return s.trim();if(a){const x=a.split("@")[0];if(x.length>=2)return x.charAt(0).toUpperCase()+x.slice(1)}return"RSG Member"}function Oe({active:s,mobile:a=!1}){const x=[{id:"home",label:"RSG Live Feed",href:"/pro-dashboard",icon:He},{id:"groups",label:"Groups",href:"/group",icon:xe},{id:"forum",label:"Forum",href:"/forum",icon:Je}];return e.jsx("nav",{"aria-label":"RSG community navigation",className:a?"flex md:hidden items-center gap-1 overflow-x-auto border-t border-[#F5EEE6] px-4 py-2 scrollbar-none":"hidden md:flex items-center gap-1 rounded-full border border-stone-200 bg-[#FFFEFD] p-1 shadow-sm overflow-x-auto scrollbar-none",children:x.map(d=>{const u=d.icon,p=s===d.id;return e.jsxs(ne,{to:d.href,"aria-current":p?"page":void 0,className:`inline-flex items-center gap-1.5 rounded-full ${a?"px-3 py-2 text-[12px]":"px-3.5 py-2 text-[12px]"} font-semibold whitespace-nowrap transition ${p?"bg-[#F45815] text-white shadow-sm":"text-stone-600 hover:bg-stone-50 hover:text-stone-900"}`,children:[e.jsx(u,{className:"h-4 w-4"})," ",d.label]},d.id)})})}function os(){const{toast:s}=it(),[a,x]=i.useState(!0),[d,u]=i.useState(!1),[p,y]=i.useState(null),[S,V]=i.useState(null),[R,j]=i.useState("Guest"),[w,G]=i.useState(""),[L,F]=i.useState("all"),[h,P]=i.useState([]),[O,_]=i.useState(!0),[H,b]=i.useState([]),[W,B]=i.useState(!0),[c,m]=i.useState(null),[k,$]=i.useState([]),[X,C]=i.useState(!1),[D,f]=i.useState(null),[z,E]=i.useState(null),[J,K]=i.useState(""),[ee,ie]=i.useState(!1),[te,I]=i.useState(!1),[o,g]=i.useState([]),[T,M]=i.useState(!1),[ae,se]=i.useState(0),[l,v]=i.useState(!1),[q,re]=i.useState(null),[A,le]=i.useState(null),[Ve,We]=i.useState({});i.useEffect(()=>{(async()=>{try{const t=await at.me();y((t==null?void 0:t.id)||(t==null?void 0:t._id)||null),V((t==null?void 0:t.email)||null),j(Mt((t==null?void 0:t.full_name)||(t==null?void 0:t.name),t==null?void 0:t.email)),u(!0)}catch{u(!1)}finally{x(!1)}})()},[]);const ke=async()=>{_(!0);try{let t=[];try{t=await je.filter({status:"active"},"display_order",50),(!t||t.length===0)&&(t=(await je.list("display_order",80)||[]).filter(N=>(N.status||"active")==="active"))}catch{try{t=(await je.list("display_order",80)||[]).filter(N=>(N.status||"active")==="active")}catch{t=[]}}const r=(t||[]).sort((n,N)=>(n.display_order??9999)-(N.display_order??9999));P(r.slice(0,50))}catch{P([])}finally{_(!1)}},Fe=async()=>{B(!0);try{const t=await ct.list("-created_at",100);b((t||[]).filter(r=>(r.status||"active")==="active"))}catch{b([])}finally{B(!1)}};i.useEffect(()=>
1{a||ke(),!a&&d&&Fe()},[a,d]),i.useEffect(()=>{d&&(async()=>{try{const t=await we.list("-created_at",40);g(t||[])}catch{}})()},[d,p,S]),i.useEffect(()=>{const t=new Set;k.forEach(r=>{const n=(r.email||r.profile_email||"").toLowerCase();n&&!n.endsWith(".example")&&t.add(n)}),t.size!==0&&ot({emails:Array.from(t)}).then(r=>{const n=(r==null?void 0:r.data)??r,N={};((n==null?void 0:n.drivers)||[]).forEach(U=>{U.email&&(N[String(U.email).toLowerCase()]={driverId:U.driverId,micrositeSlug:U.micrositeSlug})}),We(N)}).catch(()=>{})},[k]);const Q=i.useMemo(()=>{const t={};return H.forEach(r=>{r.group_id&&(t[r.group_id]=r),r.group_slug&&(t[r.group_slug.toLowerCase()]=r)}),t},[H]),_e=i.useMemo(()=>{let t=[...h];if(w.trim()){const r=w.trim().toLowerCase();t=t.filter(n=>(n.name||"").toLowerCase().includes(r)||(n.description||"").toLowerCase().includes(r)||(n.city_scope||"").toLowerCase().includes(r))}return L==="mine"?t=t.filter(r=>Q[r.id]||Q[(r.slug||"").toLowerCase()]):L==="joined"&&(t=t.filter(r=>Q[r.id]||Q[(r.slug||"").toLowerCase()])),t},[h,w,L,Q]),qe=t=>{const r=(t||"").toLowerCase();return r==="unauthorized"?"UNAUTHORIZED":r==="not_found"?"NOT_FOUND":r==="not_joined"?"JOIN_REQUIRED":r==="pending_approval"||r==="pending"?"PENDING":r==="banned"?"BANNED":r==="validation"?"VALIDATION":"SERVER_ERROR"},oe=async t=>{m(t),v(!1),re(null),le(null),se(0),$([]),f(null),C(!0);try{const r=await dt({group_id:t.id,group_slug:t.slug}),n=(r==null?void 0:r.data)??r;if((n!=null&&n.error||n!=null&&n.code)&&n!=null&&n.error){const U=qe(n==null?void 0:n.code);if(n!=null&&n.code)f(U);else{const Z=String(n.error).toLowerCase();Z.includes("join")||Z.includes("must join")||Z.includes("not_joined")?f("JOIN_REQUIRED"):Z.includes("pending")?f("PENDING"):Z.includes("banned")?f("BANNED"):Z.includes("sign in")||Z.includes("authentication")||Z.includes("unauthorized")?f("UNAUTHORIZED"):Z.includes("not found")?f("NOT_FOUND"):f("SERVER_ERROR")}return}const N=(n==null?void 0:n.posts)||[];$(N.map(U=>({...U,group_id:U.group_id||t.id,group_slug:U.group_slug||t.slug})))}catch(r){const n=String((r==null?void 0:r.message)||"").toLowerCase();n.includes("unauthorized")||n.includes("authentication")||n.includes("sign in")||n.includes("401")?f("UNAUTHORIZED"):n.includes("not_joined")||n.includes("must join")||n.includes("join")?f("JOIN_REQUIRED"):n.includes("pending")?f("PENDING"):n.includes("banned")?f("BANNED"):n.includes("not_found")||n.includes("not found")||n.includes("could not resolve group")?f("NOT_FOUND"):(console.error("openGroup failed",r),f("SERVER_ERROR"))}finally{C(!1)}},Ce=async t=>{if(!d){window.location.href=he();return}E(t.id);try{const r=await xt({group_id:t.id}),n=(r==null?void 0:r.data)??r;if(n!=null&&n.error){const N=(n==null?void 0:n.code)==="banned"?"You are banned from this group":(n==null?void 0:n.code)==="pending_approval"?"Request pending — awaiting owner approval":"Could not join this group right now";throw new Error(N)}s({title:"Joined "+t.name,description:"You can now see posts inside this group and share useful tips across your social networks."}),await Fe(),await oe(t)}catch(r){const n=String((r==null?void 0:r.message)||"").toLowerCase();let N="Try again in a moment";n.includes("banned")?N="You are banned from this group and cannot join":n.includes("pending")||n.includes("approval")?N="Join request pending approval":(n.includes("sign in")||n.includes("authentication")||n.includes("unauthorized"))&&(N="Sign in required to join groups"),s({title:"Could not join",description:N,variant:"destructive"})}finally{E(null)}},Ke=async()=>{const t=J.trim();if(!t||t.length<2){s({title:"Add a bit more"});return}if(c){ie(!0);try{const r=await mt({group_id:c.id,content:t,display_name:R}),n=(r==null?void 0:r.data)??r;if(n!=null&&n.error)throw new Error(n.error);const N=(n==null?void 0:n.post)||{id:"temp-"+Date.now(),content:t,display_name:R,created_at:new Date().toISOString(),group_id:c.id};$(U=>[N,...U]),K(""),s({title:"Posted to group",description:"Your post is now live inside "+c.name})}catch(r){s({title:"Could not post",description:(r==null?void 0:r.message)||"Try again",variant:"destructive"})}finally{ie(!1)}}},ge=i.useMemo(()=>o.filter(t=>!t.read).length,[o]),Qe=t=>{g(r=>r.map(n=>n.id===t?{...n,read:!0}:n)),we.update(t,{read:!0}).catch(()=>{})},Ze=()=>{const t=o.filter(r=>!r.read).map(r=>r.id);g(r=>r.map(n=>({...n,read:!0}))),Promise.all(t.map(r=>we.update(r,{read:!0}).catch(()=>null))).catch(()=>{})},ze=(t=null,r=null)=>{if(!d){window.location.href=he();return}if(!c){s({title:"Open a group first",description:"Choose a group to message its active members."});return}re(t),le(r),v(!0)},ce=()=>{m(null),v(!1),re(null),le(null)};return e.jsxs("div",{className:"min-h-screen w-full bg-[#FFFEFD] text-zinc-900 antialiased",children:[e.jsx(ut,{title:"RSG Groups — City and Topic Communities | RideShareGuides",description:"Join RSG Groups by city, market, and business goal. Discover airport, NEMT, direct-booking and earnings crews in the driver-owned RideShareGuides network.",url:"https://rideshareguides.com/group",image:Tt,ogImageWidth:1200,ogImageHeight:675,ogImageAlt:"RideShareGuides Groups directory showing city and topic communities for drivers",ogType:"website",siteName:"RideShareGuides",structuredData:[{"@context":"https://schema.org","@type":"CollectionPage",name:"RSG Groups — City and Topic Communities",description:"Join RSG Groups by city, market, and business goal. Discover airport, NEMT, direct-booking and earnings crews in the driver-owned RideShareGuides network.",url:"https://rideshareguides.com/group",isPartOf:{"@type":"WebSite",name:"RideShareGuides",url:"https://rideshareguides.com"},publisher:{"@type":"Organization",name:"RideShareGuides",url:"https://rideshareguides.com",logo:{"@type":"ImageObject",url:Lt}}},{"@context":"https://schema.org","@type":"WebSite",name:"RideShareGuides",url:"https://rideshareguides.com",description:"Driver-owned network for tips, direct bookings, delivery, rewards, and business tools.",publisher:{"@type":"Organization",name:"RideShareGuides",url:"https://rideshareguides.com"}}]}),e.jsx("style",{children:"@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;600&family=Space+Grotesk:wght@500;700&display=swap'); .scrollbar-none::-webkit-scrollbar{display:none} .scrollbar-none{-ms-overflow-style:none; scrollbar-width:none}"}),e.jsx("div",{className:"sticky top-0 z-30 border-b border-[#F5EEE6] bg-white/95 backdrop-blur-xl",children:e.jsxs("div",{className:"mx-auto max-w-[1320px]",children:[e.jsxs("div",{className:"flex min-h-[64px] flex-wrap items-center justify-between gap-x-3 gap-y-2 px-4 sm:px-6 lg:px-8 md:flex-nowrap",children:[e.jsxs(ne,{to:"/","aria-label":"Go to the RSG Home Feed",className:"order-1 flex min-w-0 shrink-0 items-center gap-2.5 rounded-full pr-1 md:order-none",children:[e.jsx("img",{src:Pt,alt:"RideShareGuides animated logo",className:"h-10 w-auto max-w-[88px] shrink-0 object-contain"}),e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.12em] text-stone-600 sm:text-[11px] sm:tracking-[0.16em]",children:"RSG Groups"})]}),e.jsx(Oe,{active:"groups"}),e.jsxs("div",{className:"order-2 relative flex w-full shrink-0 items-center justify-end gap-1.5 md:order-none md:w-auto",children:[e.jsx(lt,{}),d&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>M(!0),"aria-label":"Open notifications",title:"Notifications",className:"relative inline-flex h-9 w-9 items-center justify-center rounded-full border border-stone-200 bg-white text-stone-700 transition hover:bg-stone-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#F45815]/30",children:[e.jsx(Nt,{className:"h-4 w-4"}),ge>0&&e.jsx("span",{className:"absolute -right-0.5 -top-0.5 flex h-4 min-w-[16px] items-center justify-center rounded-full bg-[#F45815] px-1 text-[9px] font-bold text-white",children:ge>9?"9+":ge})]}),e.jsxs("button",{onClick:()=>ze(),"aria-label":"Open private group messages",title:"Private group messages",className:"relative inline-flex h-9 w-9 items-center justify-center rounded-full border border-stone-200 bg-white text-stone-700 transition hover:bg-stone-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#F45815]/30",children:[e.jsx(be,{className:"h-4 w-4"}),ae>0&&e.jsx("span",{className:"absolute -right-0.5 -top-0.5 flex h-4 min-w-[16px] items-center justify-center rounded-full bg-[#F45815] px-1 text-[9px] font-bold text-white",children:ae>9?"9+":ae})]})]}),!a&&!d&&e.jsx("a",{href:he(),className:"inline-flex h-9 items-center justify-center rounded-full bg-[#F45815] px-4 text-[13px] font-bold text-white hover:bg-[#
1E84F12]",children:"Sign in"}),e.jsx(wt,{isOpen:T,onClose:()=>M(!1),notifications:o,onMarkRead:Qe,onMarkAllRead:Ze})]})]}),e.jsx(Oe,{active:"groups",mobile:!0})]})}),e.jsxs("div",{className:"mx-auto max-w-[1320px] px-4 sm:px-6 lg:px-8 py-5 sm:py-7",children:[e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-white border border-[#F0E6D6] px-3 py-1.5 text-[11px] font-semibold text-stone-600",children:[e.jsx(xe,{className:"h-3.5 w-3.5"})," ",h.length," active communities"]}),d&&e.jsxs("button",{onClick:()=>I(!0),className:"inline-flex h-9 items-center justify-center gap-1.5 rounded-full bg-[#F45815] px-4 text-[13px] font-bold text-white hover:bg-[#E04E10]",children:[e.jsx(Le,{className:"h-4 w-4"})," New Group"]})]}),c?e.jsxs("div",{className:"mt-6 grid grid-cols-1 gap-6 lg:grid-cols-[1.6fr_0.8fr] lg:items-start",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("button",{onClick:()=>ce(),className:"inline-flex items-center gap-1 rounded-full border border-stone-200 bg-white px-3 py-1.5 text-[12px] font-semibold hover:bg-stone-50",children:[e.jsx(Se,{className:"h-4 w-4"})," All groups"]}),e.jsxs("div",{className:"mt-4 rounded-[20px] border border-stone-200 bg-white p-5 shadow-sm",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-[22px] font-black tracking-tight leading-tight",style:{fontFamily:"'Space Grotesk', sans-serif"},children:c.name}),e.jsx("p",{className:"mt-1 max-w-[60ch] text-[13px] leading-[1.5] text-stone-600",children:c.description}),e.jsxs("div",{className:"mt-2 flex items-center gap-2 text-[11px] text-stone-500",children:[c.city_scope&&e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[#FFFBF0] border border-[#F0E6D6] px-2.5 py-1",children:[e.jsx(fe,{className:"h-3 w-3"})," ",c.city_scope]}),e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-stone-200 bg-white px-2.5 py-1",children:[e.jsx(Pe,{className:"h-3 w-3"})," ",c.privacy||"public"]})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[e.jsxs("button",{onClick:()=>ze(),className:"inline-flex items-center gap-1.5 rounded-full bg-[#F45815] px-3.5 py-2 text-[12px] font-bold text-white transition hover:bg-[#E84F12] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#F45815]/30",children:[e.jsx(be,{className:"h-3.5 w-3.5"})," Message members"]}),e.jsxs(ne,{to:"/pro-dashboard",className:"inline-flex items-center gap-1.5 rounded-full border border-[#F0E6D6] bg-[#FFFBF0] px-3.5 py-2 text-[12px] font-semibold text-stone-700 hover:bg-white",children:[e.jsx(He,{className:"h-3.5 w-3.5"})," Home Feed"]})]})]}),e.jsx("div",{className:"hidden sm:flex h-12 w-12 items-center justify-center rounded-full bg-zinc-900 text-white font-bold",children:(c.name||"RSG").slice(0,2).toUpperCase()})]}),e.jsxs("div",{className:"mt-4 flex gap-2",children:[e.jsx("textarea",{value:J,onChange:t=>K(t.target.value),placeholder:`Post something in ${c.name} — share with the worldwide community`,rows:2,className:"min-h-[48px] flex-1 resize-none rounded-[14px] border border-[#E8DDD0] bg-[#FFFBF0] px-4 py-3 text-[13px] placeholder:text-stone-400 focus:bg-white focus:outline-none focus:ring-2 focus:ring-[#F45815]/20"}),e.jsx("button",{disabled:ee||J.trim().length<2,onClick:Ke,className:"inline-flex h-[48px] items-center justify-center rounded-full bg-[#F45815] px-5 text-[13px] font-bold text-white hover:bg-[#E84F12] disabled:opacity-50",children:ee?e.jsx(Y,{className:"h-4 w-4 animate-spin"}):"Post"})]})]}),e.jsx("div",{className:"mt-5 space-y-4",children:X?Array.from({length:3}).map((t,r)=>e.jsx("div",{className:"h-[200px] animate-pulse rounded-[20px] bg-zinc-100"},r)):D?e.jsx("div",{className:"rounded-[18px] border bg-white p-6 text-center shadow-sm",style:{borderColor:D==="BANNED"?"#FECACA":D==="SERVER_ERROR"?"#E7E5E4":"#FDE68A"},children:D==="UNAUTHORIZED"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto flex h-11 w-11 items-center justify-center rounded-full bg-[#FFF1E8] text-[#F45815]",children:e.jsx(ue,{className:"h-5 w-5"})}),e.jsx("p",{className:"mt-3 text-[15px] font-bold text-zinc-900",children:"Sign in to view this group"}),e.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-stone-600",children:"Private group posts are visible to members who have joined. Sign in to connect, learn, and share with the worldwide RSG community."}),e.jsxs("div",{className:"mt-4 flex justify-center gap-2",children:[e.jsx("a",{href:he(),className:"inline-flex rounded-full bg-[#F45815] px-6 py-2.5 text-[13px] font-bold text-white hover:bg-[#
1E84F12]",children:"Sign in to continue"}),e.jsx("button",{onClick:()=>ce(),className:"inline-flex rounded-full border border-stone-200 bg-white px-5 py-2.5 text-[13px] font-semibold hover:bg-stone-50",children:"Browse groups"})]})]}):D==="JOIN_REQUIRED"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto flex h-11 w-11 items-center justify-center rounded-full bg-[#FFF1E8] text-[#F45815]",children:e.jsx(xe,{className:"h-5 w-5"})}),e.jsxs("p",{className:"mt-3 text-[15px] font-bold text-zinc-900",children:["Join to see posts inside ",c.name]}),e.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-stone-600",children:"This is a private RSG community. Join once to see posts, connect with local drivers, and share what helps across your social networks."}),e.jsx("button",{disabled:z===c.id,onClick:()=>Ce(c),className:"mt-4 inline-flex rounded-full bg-[#F45815] px-6 py-2.5 text-[13px] font-bold text-white hover:bg-[#E84F12] disabled:opacity-50",children:z===c.id?e.jsx(Y,{className:"h-4 w-4 animate-spin"}):"Join group to view"})]}):D==="PENDING"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto flex h-11 w-11 items-center justify-center rounded-full bg-amber-50 text-amber-700",children:e.jsx(Y,{className:"h-5 w-5"})}),e.jsxs("p",{className:"mt-3 text-[15px] font-bold text-zinc-900",children:["Request pending for ",c.name]}),e.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-stone-600",children:"Your join request is awaiting owner approval. You will see posts as soon as you are approved and can start sharing with the community."}),e.jsxs("div",{className:"mt-4 flex justify-center gap-2",children:[e.jsx("button",{onClick:()=>ce(),className:"rounded-full border border-stone-200 bg-white px-5 py-2 text-[13px] font-semibold",children:"Back to groups"}),e.jsx(ne,{to:"/pro-dashboard",className:"rounded-full bg-[#F45815] px-5 py-2 text-[13px] font-bold text-white hover:bg-[#E04E10]",children:"Go to Home Feed"})]})]}):D==="BANNED"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto flex h-11 w-11 items-center justify-center rounded-full bg-red-50 text-red-600",children:e.jsx(ue,{className:"h-5 w-5"})}),e.jsxs("p",{className:"mt-3 text-[15px] font-bold text-zinc-900",children:["You cannot view ",c.name]}),e.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-stone-600",children:"You have been removed from this group. If you believe this is a mistake, contact the group owner inside RSG."}),e.jsx("button",{onClick:()=>ce(),className:"mt-4 rounded-full border border-stone-200 bg-white px-5 py-2.5 text-[13px] font-semibold",children:"Browse other groups"})]}):D==="NOT_FOUND"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto flex h-11 w-11 items-center justify-center rounded-full bg-zinc-50 border border-stone-200",children:e.jsx(Re,{className:"h-5 w-5 text-stone-400"})}),e.jsx("p",{className:"mt-3 text-[15px] font-bold text-zinc-900",children:"Group not found"}),e.jsx("p",{className:"mt-1 text-[13px] text-stone-600",children:"This group may have been renamed, merged, or removed. Pick another focused community inside RSG."}),e.jsx("button",{onClick:()=>ce(),className:"mt-4 rounded-full bg-[#F45815] px-5 py-2.5 text-[13px] font-bold text-white hover:bg-[#E04E10]",children:"Back to all groups"})]}):D==="VALIDATION"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-[14px] font-bold text-zinc-900",children:"This group is not available right now"}),e.jsx("p",{className:"mt-1 text-[13px] text-stone-600",children:"The group is inactive or being updated. Try again in a moment or choose another group."}),e.jsx("button",{onClick:()=>c&&oe(c),className:"mt-4 rounded-full border border-stone-200 bg-white px-5 py-2.5 text-[13px] font-semibold",children:"Try again"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto flex h-11 w-11 items-center justify-center rounded-full bg-zinc-50 border border-stone-200",children:e.jsx(Pe,{className:"h-5 w-5 text-stone-500"})}),e.jsx("p",{className:"mt-3 text-[15px] font-bold text-zinc-900",children:"Temporary issue loading posts"}),e.jsxs("p",{className:"mt-1 text-[13px] leading-relaxed text-stone-600",children:["We could not load posts for ",c.name," right now. This is usually brief. Please retry in a moment."]}),e.jsxs("div",{className:"mt-4 flex justify-center gap-2",children:[e.jsx("button",{onClick:()=>c&&oe(c),className:"inline-flex items-center justify-center rounded-full bg-[#F45815] px-5 py-2.5 text-[13px] font-bold text-white hover:bg-[#
1E04E10]",children:"Retry"}),e.jsx("button",{onClick:()=>ce(),className:"rounded-full border border-stone-200 bg-white px-5 py-2.5 text-[13px] font-semibold",children:"All groups"})]})]})}):k.length===0?e.jsxs("div",{className:"rounded-[18px] border border-dashed border-stone-200 bg-white p-8 text-center",children:[e.jsx("div",{className:"mx-auto flex h-10 w-10 items-center justify-center rounded-full bg-zinc-50 border border-stone-200",children:e.jsx(Je,{className:"h-5 w-5 text-stone-400"})}),e.jsxs("p",{className:"mt-3 text-[14px] font-bold",children:["No posts yet in ",c.name]}),e.jsx("p",{className:"mt-1 text-[12px] text-stone-500",children:"Be first to share photos, videos, and wins with the community."})]}):k.map(t=>e.jsx(zt,{post:t,comments:[],currentUserEmail:S,driverMap:Ve},t.id))})]}),e.jsx("div",{className:"min-w-0 space-y-4 lg:sticky lg:top-[86px]",children:e.jsxs("div",{className:"rounded-[18px] border border-stone-200 bg-white p-4",children:[e.jsx("p",{className:"text-[11px] font-bold uppercase tracking-[0.14em] text-stone-500",children:"Other groups"}),e.jsx("div",{className:"mt-3 grid grid-cols-1 gap-2",children:h.filter(t=>t.id!==c.id).slice(0,6).map(t=>e.jsxs("button",{onClick:()=>oe(t),className:"flex items-center gap-2 rounded-[12px] border border-stone-200 bg-white px-3 py-2.5 text-left hover:bg-stone-50",children:[e.jsx("span",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-zinc-900 text-[10px] font-bold text-white",children:(t.name||"RSG").slice(0,2).toUpperCase()}),e.jsx("span",{className:"flex-1 truncate text-[12px] font-semibold",children:t.name}),(Q[t.id]||Q[(t.slug||"").toLowerCase()])&&e.jsx("span",{className:"rounded-full bg-emerald-50 border border-emerald-200 px-2 py-0.5 text-[9px] font-bold uppercase text-emerald-800",children:"Joined"})]},t.id))}),e.jsxs("div",{className:"mt-4 grid grid-cols-2 gap-2",children:[e.jsx(ne,{to:"/pro-dashboard",className:"rounded-full border border-[#F0E6D6] bg-[#FFFBF0] px-3 py-2 text-center text-[12px] font-semibold",children:"Home Feed →"}),e.jsx(ne,{to:"/forum",className:"rounded-full border border-stone-200 bg-white px-3 py-2 text-center text-[12px] font-semibold",children:"Forum →"})]})]})})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mt-6 overflow-hidden rounded-[28px] border border-[#F0E6D6] bg-[#FFFBF0] p-6 sm:p-8 shadow-[0_8px_40px_rgba(199,125,40,0.08)]",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full bg-white border border-[#F0E6D6] px-3.5 py-1.5 shadow-sm text-[11px] font-black uppercase tracking-[0.14em] text-stone-700",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[#F45815]"})," RSG Groups • Members-only"]}),e.jsxs("h1",{className:"mt-4 text-[34px] sm:text-[42px] font-black leading-[0.92] tracking-tight",style:{fontFamily:"'Bebas Neue', sans-serif"},children:["Find your crew.",e.jsx("br",{}),e.jsx("span",{className:"text-[#F45815]",children:"Share worldwide."})]}),e.jsx("p",{className:"mt-3 max-w-[52ch] text-[14px] leading-[1.6] text-stone-600",children:"Groups are focused communities by city, market, and goal. Airport runs, NEMT, direct bookings, delivery, earnings — pick your lane, join, and post. Connect, learn, and share from one driver-owned network and share what helps across your socials."}),e.jsxs("div",{className:"mt-5 flex flex-col gap-3 sm:flex-row sm:items-center",children:[e.jsxs("div",{className:"relative flex-1 sm:max-w-[320px]",children:[e.jsx(Re,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone-400"}),e.jsx("input",{value:w,onChange:t=>G(t.target.value),placeholder:"Search groups, cities, interests...",className:"h-11 w-full rounded-full border border-[#E8DDD0] bg-white pl-10 pr-4 text-[14px] placeholder:text-stone-400 focus:outline-none focus:ring-2 focus:ring-[#F45815]/20"})]}),e.jsx("div",{className:"flex items-center gap-1.5 rounded-full border border-stone-200 bg-white p-1",children:["all","mine"].map(t=>e.jsx("button",{onClick:()=>F(t),className:`rounded-full px-4 py-1.5 text-[12px] font-bold transition ${L===t?"bg-[#F45815] text-white":"text-stone-600 hover:bg-stone-50"}`,children:t==="all"?"All Groups":"My Groups"},t))})]})]}),e.jsx("div",{className:"mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:O?Array.from({length:6}).map((t,r)=>e.jsx("div",{className:"h-[180px] animate-pulse rounded-[20px] bg-zinc-100"},r)):_e.length===0?e.jsxs("div",{className:"col-span-full rounded-[20px] border border-dashed border-stone-200 bg-white p-10 text-center",children:[e.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-[#FFF1E8] text-[#F45815]",children:e.jsx(yt,{className:"h-6 w-6"})}),e.jsx("p",{className:"mt-4 text-[16px] font-bold",children:"No groups foun
1d"}),e.jsx("p",{className:"mt-1 text-[13px] text-stone-500",children:"Try another search or create a new group for your city / interest."}),d&&e.jsx("button",{onClick:()=>I(!0),className:"mt-4 inline-flex rounded-full bg-[#F45815] px-5 py-2.5 text-[13px] font-bold text-white",children:"Start a Group"})]}):_e.map(t=>{const r=!!Q[t.id]||!!Q[(t.slug||"").toLowerCase()],n=(t.privacy||"public").toLowerCase()!=="public";return e.jsxs("div",{className:"group flex flex-col overflow-hidden rounded-[22px] border border-stone-200 bg-white p-5 shadow-sm hover:border-[#F2D7C0] hover:shadow-[0_12px_32px_rgba(244,88,21,0.08)] transition",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-zinc-900 text-white text-[12px] font-bold",children:(t.name||"RSG").slice(0,2).toUpperCase()}),e.jsx("span",{className:`inline-flex items-center gap-1 rounded-full px-2.5 py-1 text-[10px] font-bold uppercase tracking-widest ${n?"bg-amber-50 border border-amber-200 text-amber-800":"bg-emerald-50 border border-emerald-200 text-emerald-800"}`,children:n?e.jsxs(e.Fragment,{children:[e.jsx(ue,{className:"h-3 w-3"})," Private"]}):e.jsxs(e.Fragment,{children:[e.jsx(Ue,{className:"h-3 w-3"})," Public"]})})]}),e.jsx("h3",{className:"mt-4 text-[16px] font-bold leading-tight text-zinc-900 line-clamp-2",children:t.name}),e.jsx("p",{className:"mt-1.5 line-clamp-3 text-[13px] leading-[1.5] text-stone-600",children:t.description||"A focused community for drivers who share wins and learn together."}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-1.5",children:[t.city_scope&&e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[#FFFBF0] border border-[#F0E6D6] px-2.5 py-1 text-[11px] font-medium text-stone-700",children:[e.jsx(fe,{className:"h-3 w-3"})," ",t.city_scope]}),t.member_count!=null&&e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-white border border-stone-200 px-2.5 py-1 text-[11px] text-stone-600",children:[e.jsx(xe,{className:"h-3 w-3"})," ",t.member_count," members"]})]}),e.jsxs("div",{className:"mt-4 flex items-center gap-2",children:[r?e.jsx("button",{onClick:()=>oe(t),className:"inline-flex flex-1 items-center justify-center gap-1 rounded-full bg-[#F45815] px-4 py-2.5 text-[13px] font-bold text-white hover:bg-[#E04E10]",children:"Open feed"}):e.jsx("button",{disabled:z===t.id,onClick:()=>Ce(t),className:"inline-flex flex-1 items-center justify-center gap-1 rounded-full bg-[#F45815] px-4 py-2.5 text-[13px] font-bold text-white hover:bg-[#E84F12] disabled:opacity-50",children:z===t.id?e.jsx(Y,{className:"h-4 w-4 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(Le,{className:"h-4 w-4"})," Join group"]})}),e.jsx("button",{onClick:()=>oe(t),className:"inline-flex h-[40px] w-[40px] items-center justify-center rounded-full border border-stone-200 bg-white hover:bg-stone-50",children:e.jsx(Se,{className:"h-4 w-4 rotate-180"})})]})]},t.id)})}),e.jsxs("div",{className:"mt-8 rounded-[20px] border border-[#F0E6D6] bg-[#FFFBF0] p-4",children:[e.jsx("p",{className:"text-[11px] font-bold uppercase tracking-[0.14em] text-stone-500",children:"Share across networks"}),e.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-stone-600",children:"Start useful conversations in RSG Groups and share what helps drivers across your social networks. Build your reputation with the worldwide RSG community while growing your reach."}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsx(ne,{to:"/pro-dashboard",className:"rounded-full border border-white bg-white px-4 py-2 text-[12px] font-semibold shadow-sm hover:bg-[#FFFBF0]",children:"Go to Home Feed →"}),e.jsx(ne,{to:"/forum",className:"rounded-full border border-stone-200 bg-white px-4 py-2 text-[12px] font-semibold hover:bg-stone-50",children:"Open Forum →"})]})]})]})]}),e.jsx(Dt,{isOpen:l,onClose:()=>{v(!1),re(null),le(null)},groupId:(c==null?void 0:c.id)||null,groupSlug:(c==null?void 0:c.slug)||null,groupName:(c==null?void 0:c.name)||null,currentUserId:p,currentUserDisplayName:R,startWithUserId:q,startWithDisplayName:A,onStartHandled:()=>{re(null),le(null)},onUnreadChange:se}),e.jsx(Rt,{isOpen:te,onClose:()=>I(!1),onCreated:t=>{ke(),s({title:"Group created",description:((t==null?void 0:t.name)||"Your group")+" is live — inv
1ite members and start sharing with the worldwide community."}),t&&oe(t)}}),e.jsx(vt,{})]})}export{os 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.