1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[53409],{53409:function(e,t,a){a.r(t),a.d(t,{default:function(){return eT}});var r=a(65724),n=a(92169),s=a(78883),i=a(90639),o=a(68125),l=a(54704),c=a(2512),d=a(34806),u=a(28266),m=a(35218),h=a(73789),x=a(5277),p=a(74046),g=a(89282),f=a(79980),v=a(76205),y=a(25387);let b={type:"spring",stiffness:260,damping:26,mass:.9},j={hidden:{},visible:{transition:{staggerChildren:.055,delayChildren:.08}}},w={hidden:{opacity:0,y:12},visible:{opacity:1,y:0,transition:b}},k=e=>{let{children:t,className:a}=e;return(0,r.jsx)(n.E.div,{initial:{opacity:0,y:18,rotateX:6},animate:{opacity:1,y:0,rotateX:0},transition:{...b,delay:.12},className:(0,v.cn)("w-full rounded-2xl border border-white/70 bg-white/95 p-4 shadow-[0_24px_60px_-24px_rgba(15,23,42,0.45)] backdrop-blur",a),children:t})},N=e=>{let{children:t,index:a}=e;return(0,r.jsx)(n.E.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{...b,delay:.22+.07*a},className:"flex items-center gap-3 rounded-xl px-2 py-2 odd:bg-gray-50/70",children:t})},C=[{name:"Amara Okafor",tag:"Buyer",initials:"AO"},{name:"Jonas Weber",tag:"Member",initials:"JW"},{name:"Priya Raman",tag:"Lead",initials:"PR"},{name:"Dani Alvarez",tag:"Buyer",initials:"DA"}],_=[38,52,44,66,58,82,100],L=[{label:"Visitors",value:"24,910",width:100},{label:"Signups",value:"6,204",width:72},{label:"Trials",value:"1,880",width:46},{label:"Customers",value:"612",width:24}],E={contacts:{id:"contacts",navLabel:"Contacts",eyebrow:"Contacts",headline:"Every lead, member and buyer in one place",subhead:"Your audience is already here â communities, courses, funnels and calls all write to the same contact record. Upgrade to open it.",benefits:["One profile per person across every community and course","Segment by tag, source and purchase history","Up to 150,000 contacts, exportable any time"],preview:(0,r.jsx)(()=>(0,r.jsxs)(k,{children:[(0,r.jsxs)("div",{className:"mb-3 flex items-center justify-between px-2",children:[(0,r.jsx)("p",{className:"text-[13px] font-semibold text-gray-900",children:"All contacts"}),(0,r.jsx)("span",{className:"rounded-full bg-brand/10 px-2 py-0.5 text-[11px] font-semibold text-brand",children:"12,480"})]}),(0,r.jsx)("div",{className:"space-y-0.5",children:C.map((e,t)=>(0,r.jsxs)(N,{index:t,children:[(0,r.jsx)("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-sky-400 to-blue-600 text-[11px] font-bold text-white",children:e.initials}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium text-gray-800",children:e.name}),(0,r.jsx)("span",{className:"rounded-full bg-gray-100 px-2 py-0.5 text-[11px] font-medium text-gray-600",children:e.tag})]},e.name))})]}),{})},income:{id:"income",navLabel:"Income",eyebrow:"Income",headline:"See the money the moment it lands",subhead:"Products, memberships, live calls and tips â totalled daily, with payouts and fees you can actually reconcile.",benefits:["Live revenue across every product and community","Payout timeline, refunds and fees in one ledger","Transaction fees drop from 10% to 2.9% as you scale"],preview:(0,r.jsx)(()=>(0,r.jsxs)(k,{children:[(0,r.jsxs)("div",{className:"px-2",children:[(0,r.jsx)("p",{className:"text-[12px] font-medium text-gray-500",children:"Revenue \xb7 last 7 days"}),(0,r.jsxs)("div",{className:"mt-1 flex items-baseline gap-2",children:[(0,r.jsx)("p",{className:"text-[26px] font-bold leading-none tracking-tight text-gray-900",children:"$12,480"}),(0,r.jsx)("span",{className:"rounded-full bg-emerald-50 px-2 py-0.5 text-[11px] font-semibold text-emerald-600",children:"+18.2%"})]})]}),(0,r.jsx)("div",{className:"mt-4 flex h-24 items-end gap-2 px-2",children:_.map((e,t)=>(0,r.jsx)(n.E.div,{initial:{height:0},animate:{height:"".concat(e,"%")},transition:{...b,delay:.24+.05*t},className:(0,v.cn)("flex-1 rounded-t-md",t===_.length-1?"bg-brand":"bg-brand/25")},e+String(t)))})]}),{})},analytics:{id:"analytics",navLabel:"Analytics",eyebrow:"Analytics",headline:"Know exactly what turns visitors into buyers",subhead:"Stop guessing which post, page or offer is doing the work. Follow the whole funnel from first visit to paid.",benefits:["Funnel conversion from view to signup to sale","Traffic sources, retention and watch time","Advanced attribution and cohorts on higher plans"],preview:(0,r.jsx)(()=>(0,r.jsxs)(k,{children:[(0,r.jsxs)("div",{className:"mb-3 flex items-center justify-between px-2",children:[(0,r.jsx)("p",{className:"text-[13px] font-semibold text-gray-900",children:"Conversion funnel"}),(0,r.jsx)("span",{className:"rounded-full bg-brand/10 px-2 py-0.5 text-[11px] font-semibold text-brand",children:"2.4% â sale"})]}),(0,r.jsx)("div",{className:"space-y-2.5 px-2",children:L.map((e,t)=>(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"mb-1 flex items-center justify-between text-[11px]",children:[(0,r.jsx)("span",{className:"font-medium text-gray-600",children:e.label}),(0,r.jsx)("span",{className:"font-semibold text-gray-900",children:e.value})]}),(0,r.jsx)("div",{className:"h-2 w-full overflow-hidden rounded-full bg-gray-100",children:(0,r.jsx)(n.E.div,{initial:{width:0},animate:{width:"".concat(e.width,"%")}
1,transition:{...b,delay:.24+.07*t},className:"h-full rounded-full bg-gradient-to-r from-brand to-brand/60"})})]},e.label))})]}),{})}},M=e=>{let{className:t="h-4 w-4"}=e;return(0,r.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:[(0,r.jsx)("rect",{x:"4",y:"10.5",width:"16",height:"10.5",rx:"2.5",fill:"currentColor",opacity:"0.18"}),(0,r.jsx)("rect",{x:"4",y:"10.5",width:"16",height:"10.5",rx:"2.5",stroke:"currentColor",strokeWidth:"1.7"}),(0,r.jsx)("path",{d:"M8 10.5V7.5a4 4 0 1 1 8 0v3",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})},A=e=>{let{className:t="h-4 w-4"}=e;return(0,r.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:(0,r.jsx)("path",{d:"m5 12.5 4.2 4.2L19 7",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})},S=e=>{let{className:t="h-4 w-4"}=e;return(0,r.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:(0,r.jsx)("path",{d:"M5 12h14m-6-6 6 6-6 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},I=e=>{let{className:t="h-4 w-4"}=e;return(0,r.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:(0,r.jsx)("path",{d:"M18 6 6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})};var z=e=>{let{feature:t,onClose:a,source:s="sidenav"}=e,l=(0,y.n)(),d=t?E[t]:null;if((0,c.useEffect)(()=>{t&&(null==l||l.track("UPGRADE_FUNNEL_SHOWN",{feature:t,source:s}).catch(()=>void 0))},[t,s,l]),!d)return null;let u="/pricing?utm_source=app&utm_medium=".concat(encodeURIComponent(s),"&utm_content=").concat(d.id),m=e=>{null==l||l.track("UPGRADE_FUNNEL_CTA_CLICKED",{feature:d.id,source:s,cta:e}).catch(()=>void 0)};return(0,r.jsx)(i.A,{reducedMotion:"user",children:(0,r.jsx)(g.Vq,{open:!0,onOpenChange:e=>{e||a()},children:(0,r.jsxs)(g.cZ,{"aria-describedby":void 0,className:"max-h-[92vh] w-[calc(100vw-2rem)] max-w-[880px] overflow-y-auto rounded-3xl border-0 bg-white p-0 shadow-[0_40px_120px_-30px_rgba(15,23,42,0.55)] sm:rounded-3xl [&>button:last-child]:hidden",children:[(0,r.jsx)(f.T,{children:(0,r.jsx)(g.$N,{children:"Upgrade to unlock ".concat(d.navLabel)})}),(0,r.jsx)("button",{type:"button",onClick:a,"aria-label":"Close",className:"absolute right-4 top-4 z-20 rounded-full bg-white/80 p-2 text-gray-500 backdrop-blur transition-colors hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand",children:(0,r.jsx)(I,{className:"h-4 w-4"})}),(0,r.jsxs)("div",{className:"grid gap-0 md:grid-cols-[1.02fr_0.98fr]",children:[(0,r.jsxs)(n.E.div,{variants:j,initial:"hidden",animate:"visible",className:"order-2 flex flex-col justify-center px-7 py-8 md:order-1 md:px-9 md:py-10",children:[(0,r.jsx)(n.E.div,{variants:w,children:(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-brand/20 bg-brand/[0.07] px-2.5 py-1 text-[12px] font-semibold uppercase tracking-[0.08em] text-brand",children:[(0,r.jsx)(M,{className:"h-3.5 w-3.5"}),d.eyebrow]})}),(0,r.jsx)(n.E.h2,{variants:w,className:"mt-4 text-[26px] font-bold leading-[1.15] tracking-[-0.02em] text-gray-900 md:text-[30px]",children:d.headline}),(0,r.jsx)(n.E.p,{variants:w,className:"mt-3 text-[15px] leading-6 text-gray-600",children:d.subhead}),(0,r.jsx)(n.E.ul,{variants:w,className:"mt-5 space-y-2.5",children:d.benefits.map(e=>(0,r.jsxs)("li",{className:"flex items-start gap-2.5",children:[(0,r.jsx)("span",{className:"mt-0.5 flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-full bg-brand/10 text-brand",children:(0,r.jsx)(A,{className:"h-[11px] w-[11px]"})}),(0,r.jsx)("span",{className:"text-[14px] leading-5 text-gray-700",children:e})]},e))}),(0,r.jsxs)(n.E.div,{variants:w,className:"mt-7 flex flex-col gap-2.5 sm:flex-row sm:items-center",children:[(0,r.jsxs)(o.default,{href:u,onClick:()=>{m("primary"),a()},className:"group inline-flex flex-1 items-center justify-center gap-2 rounded-xl bg-brand px-5 py-3.5 text-[15px] font-bold text-white shadow-[0_10px_28px_-10px_hsl(var(--brand)/0.75)] transition-all hover:bg-brand-emphasis hover:shadow-[0_16px_36px_-12px_hsl(var(--brand)/0.8)] focu
1s:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2",style:{boxShadow:"inset 0 1px 0 rgba(255,255,255,0.16)"},children:["Start 14-day free trial",(0,r.jsx)(S,{className:"h-4 w-4 transition-transform duration-200 group-hover:translate-x-0.5"})]}),(0,r.jsx)("button",{type:"button",onClick:()=>{m("secondary"),a()},className:"rounded-xl px-4 py-3.5 text-[15px] font-semibold text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand",children:"Not now"})]}),(0,r.jsxs)(n.E.p,{variants:w,className:"mt-4 text-[12.5px] leading-5 text-gray-500",children:["Plans from"," ",(0,r.jsx)("span",{className:"font-semibold text-gray-700",children:"$81/month"})," ","billed yearly \xb7 cancel any time \xb7 no card charged during the trial"]})]}),(0,r.jsxs)("div",{className:"relative order-1 overflow-hidden bg-gradient-to-br from-brand/[0.14] via-brand/[0.06] to-transparent px-7 py-9 md:order-2 md:px-8 md:py-10",children:[(0,r.jsx)("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 opacity-[0.35]",style:{backgroundImage:"linear-gradient(to right, rgba(15,23,42,0.06) 1px, transparent 1px), linear-gradient(to bottom, rgba(15,23,42,0.06) 1px, transparent 1px)",backgroundSize:"28px 28px",maskImage:"radial-gradient(120% 90% at 50% 20%, black 40%, transparent 100%)",WebkitMaskImage:"radial-gradient(120% 90% at 50% 20%, black 40%, transparent 100%)"}}),(0,r.jsx)("div",{"aria-hidden":"true",className:"pointer-events-none absolute -right-16 -top-16 h-56 w-56 rounded-full bg-brand/25 blur-3xl"}),(0,r.jsxs)("div",{className:"relative flex h-full flex-col justify-center",children:[d.preview,(0,r.jsx)(n.E.p,{initial:{opacity:0}
1,animate:{opacity:1},transition:{delay:.5,duration:.35},className:"mt-4 text-center text-[12px] font-medium text-gray-500",children:"Sample data â your numbers appear the moment you upgrade"})]})]})]})]})})})},W=a(10387),B=a(49159),V=a(94011),T=a(26016),H=a(62134);let R={Clarua:e=>{let{filled:t=!1,className:a="w-6 h-6"}=e;return(0,r.jsx)("svg",{viewBox:"0 0 512 512",className:a,"aria-hidden":"true",children:(0,r.jsxs)("g",{transform:"translate(256, 256)",fill:t?"currentColor":"none",stroke:t?"none":"currentColor",strokeWidth:t?0:28,strokeLinejoin:"round",children:[(0,r.jsx)("rect",{x:"-18",y:"-185",width:"36",height:"120",rx:"18"}),(0,r.jsx)("rect",{x:"-18",y:"-131",width:"36",height:"85",rx:"18",transform:"rotate(45)"}),(0,r.jsx)("rect",{x:"65",y:"-18",width:"120",height:"36",rx:"18"}),(0,r.jsx)("rect",{x:"-18",y:"46",width:"36",height:"85",rx:"18",transform:"rotate(45)"}),(0,r.jsx)("rect",{x:"-18",y:"65",width:"36",height:"120",rx:"18"}),(0,r.jsx)("rect",{x:"-18",y:"46",width:"36",height:"85",rx:"18",transform:"rotate(-45)"}),(0,r.jsx)("rect",{x:"-185",y:"-18",width:"120",height:"36",rx:"18"}),(0,r.jsx)("rect",{x:"-18",y:"-131",width:"36",height:"85",rx:"18",transform:"rotate(-45)"})]})})},Home:e=>{let{filled:t=!1,className:a="w-6 h-6"}=e;return(0,r.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:t?(0,r.jsx)("path",{fill:"currentColor",d:"M12 1.696L.622 8.807l1.06 1.696L3 9.679V19.5A2.5 2.5 0 0 0 5.5 22h5V14h3v8h5.5a2.5 2.5 0 0 0 2.5-2.5V9.679l1.318.824 1.06-1.696L12 1.696z"}):(0,r.jsx)("path",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9zM9 22V12h6v10"})})},Bell:e=>{let{filled:t=!1,className:a="w-6 h-6"}=e;return(0,r.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:t?(0,r.jsx)("path",{fill:"currentColor",d:"M11.996 2c-4.062 0-7.49 3.021-7.999 7.051L2.866 18H7.1c.463 2.282 2.481 4 4.9 4s4.437-1.718 4.9-4h4.236l-1.131-8.949C19.487 5.021 16.058 2 11.996 2zM9.171 18h5.658c-.412 1.165-1.523 2-2.829 2s-2.417-.835-2.829-2z"}):(0,r.jsx)("path",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9M13.73 21a2 2 0 0 1-3.46 0"})})},Message:e=>{let{filled:t=!1,className:a="w-6 h-6"}=e;return(0,r.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:t?(0,r.jsx)("path",{fill:"currentColor",d:"M1.998 5.5c0-1.381 1.119-2.5 2.5-2.5h15c1.381 0 2.5 1.119 2.5 2.5V12h-2v-1.537l-6.99 4.491L12 15.5l-1.008-.546L4 10.458V18h10v2H4.498c-1.381 0-2.5-1.119-2.5-2.5v-12zm2.5-.5c-.276 0-.5.224-.5.5v.973l8 5.143 8-5.143V5.5c0-.276-.224-.5-.5-.5h-15z"}):(0,r.jsx)("path",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10z"})})},Bookmark:e=>{let{filled:t=!1,className:a="w-6 h-6"}=e;return(0,r.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:t?(0,r.jsx)("path",{fill:"currentColor",d:"M4 4.5A2.5 2.5 0 0 1 6.5 2h11A2.5 2.5 0 0 1 20 4.5v18.44l-8-5.71-8 5.71V4.5z"}):(0,r.jsx)("path",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"})})},User:e=>{let{filled:t=!1,className:a="w-6 h-6"}=e;return(0,r.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:t?(0,r.jsx)("path",{fill:"currentColor",d:"M12 11.816c1.355 0 2.872-.15 3.84-1.256.814-.93 1.078-2.368.806-4.392-.38-2.825-2.117-4.512-4.646-4.512S7.734 3.343 7.354 6.168c-.272 2.024-.008 3.462.806 4.392.968 1.107 2.485 1.256 3.84 1.256zM8.84 6.368c.162-1.2.787-3.212 3.16-3.212s2.998 2.013 3.16 3.212c.207 1.55.057 2.627-.45 3.205-.455.52-1.266.743-2.71.743s-2.255-.223-2.71-.743c-.507-.578-.657-1.656-.45-3.205zm11.44 12.868c-.877-3.526-4.282-5.99-8.28-5.99s-7.403 2.464-8.28 5.99c-.172.692-.028 1.4.395 1.94.408.52 1.04.82 1.733.82h12.304c.693 0 1.325-.3 1.733-.82.424-.54.567-1.247.394-1.94zm-1.576 1.016c-.126.16-.316.252-.552.252H5.848c-.235 0-.426-.091-.552-.252-.137-.175-.18-.412-.12-.654.71-2.855 3.517-4.84 6.824-4.84s6.114 1.986 6.824 4.84c.06.242.017.479-.12.654z"}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("path",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),(0,r.jsx)("circle",{cx:"12",cy:"7",r:"4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]})})},Wallet:e=>{let{className:t="w-6 h-6"}=e;return(0,r.jsxs)("svg",{viewBox:"0 0 24 24",className:t,fill:"none",children:[(0,r.jsx)("path",{d:"M3 7.5A2.5 2.5 0 0 1 5.5 5H18a2 2 0 0 1 2 2v1.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("rect",{x:"3",y:"8.5",width:"18",height:"10.5",rx:"2.5",stroke:"currentColor",strokeWidth:"2"}),(0,r.jsx)("circle",{cx:"16.5",cy:"13.75",r:"1.25",fill:"currentColor"})]})},Create:e=>{let{filled:t=!1,className:a="w-6 h-6"}=e;return(0,r.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:t?(0,r.jsx)("path",{fill:"currentColor",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 11h-4v4h-2v-4H7v-2h4V7h2v4h4v2z"}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"2"}),(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",d:"M12 8v8M8 12h8"})]})})},More:e=>{let{className:t="w-6 h-6"}=e;
1return(0,r.jsxs)("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:t,children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"2"}),(0,r.jsx)("circle",{cx:"12",cy:"5",r:"2"}),(0,r.jsx)("circle",{cx:"12",cy:"19",r:"2"})]})},Settings:e=>{let{className:t="w-5 h-5"}=e;return(0,r.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}),(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1Z"})]})},Logout:e=>{let{className:t="w-5 h-5"}=e;return(0,r.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",className:t,children:(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9"})})},X:e=>{let{className:t="w-5 h-5"}=e;return(0,r.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",className:t,children:(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",d:"M18 6 6 18M6 6l12 12"})})},ChevronDown:e=>{let{className:t="w-4 h-4"}=e;return(0,r.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",className:t,children:(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"m6 9 6 6 6-6"})})},ChevronRight:e=>{let{className:t="w-4 h-4"}=e;return(0,r.jsx)("svg",{viewBox:"0 0 48 48",fill:"currentColor",className:t,children:(0,r.jsx)("path",{d:"M28.74 24 15.08 10.33a1 1 0 0 1 0-1.41l1.84-1.84a1 1 0 0 1 1.41 0L34.54 23.3a1 1 0 0 1 0 1.42l-16.2 16.21a1 1 0 0 1-1.42 0l-1.84-1.84a1 1 0 0 1 0-1.41L28.74 24Z"})})},PanelToggle:e=>{let{className:t="w-5 h-5"}=e;return(0,r.jsxs)("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:t,children:[(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.9993 1.66699C16.8403 1.66699 18.3327 3.15938 18.3327 5.00033V15.0003C18.3327 16.8413 16.8403 18.3337 14.9993 18.3337H4.99935C3.1584 18.3337 1.66602 16.8413 1.66602 15.0003V5.00033C1.66602 3.15938 3.1584 1.66699 4.99935 1.66699H14.9993ZM4.99935 3.33366C4.07887 3.33366 3.33268 4.07985 3.33268 5.00033V15.0003C3.33268 15.9208 4.07887 16.667 4.99935 16.667H14.9993C15.9198 16.667 16.666 15.9208 16.666 15.0003V5.00033C16.666 4.07985 15.9198 3.33366 14.9993 3.33366H4.99935Z"}),(0,r.jsx)("path",{d:"M4.16602 5.41699C4.16602 4.72664 4.72566 4.16699 5.41602 4.16699H7.08268C7.77304 4.16699 8.33268 4.72664 8.33268 5.41699V14.5837C8.33268 15.274 7.77304 15.8337 7.08268 15.8337H5.41602C4.72566 15.8337 4.16602 15.274 4.16602 14.5837V5.41699Z"})]})},Contacts:e=>{let{filled:t=!1,className:a="w-6 h-6"}=e;return(0,r.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:t?(0,r.jsx)("path",{fill:"currentColor",d:"M6 2h11a3 3 0 0 1 3 3v14a3 3 0 0 1-3 3H6a2 2 0 0 1-2-2v-1H3a1 1 0 1 1 0-2h1v-3H3a1 1 0 1 1 0-2h1V9H3a1 1 0 0 1 0-2h1V4a2 2 0 0 1 2-2Zm6.5 4.75a2.75 2.75 0 1 0 0 5.5 2.75 2.75 0 0 0 0-5.5ZM8.2 17.4c.55-1.85 2.25-3.15 4.3-3.15s3.75 1.3 4.3 3.15a.75.75 0 0 1-.72.95H8.92a.75.75 0 0 1-.72-.95Z"}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("path",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round",d:"M6 3h11a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Z"}),(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",d:"M3 8h2M3 12h2M3 16h2"}),(0,r.jsx)("circle",{cx:"12.5",cy:"9.5",r:"2.25",stroke:"currentColor",strokeWidth:"2"}),(0,r.jsx)("path",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",d:"M9 16.5c.6-1.6 1.9-2.5 3.5-2.5s2.9.9 3.5 2.5"})]})})},Income:e=>{let{filled:t=!1,className:a="w-6 h-6"}=e;return(0,r.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:t?(0,r.jsx)("path",{fill:"currentColor",d:"M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm8 3.25a.75.75 0 0 0-.75.75v.36c-1.16.22-2 1.13-2 2.27 0 1.32
11.06 2.05 2.5 2.42.98.25 1.25.5 1.25.95 0 .5-.5.85-1.25.85-.66 0-1.16-.24-1.47-.63a.87.87 0 0 0-1.27-.1.9.9 0 0 0-.08 1.24c.5.6 1.2.99 2.07 1.13V16a.75.75 0 0 0 1.5 0v-.4c1.24-.2 2.15-1.11 2.15-2.34 0-1.42-1.11-2.11-2.6-2.5-.92-.24-1.15-.46-1.15-.83 0-.4.4-.72 1.1-.72.53 0 .95.17 1.24.46a.87.87 0 0 0 1.26 0 .9.9 0 0 0 0-1.25 3.2 3.2 0 0 0-1.5-.84V8a.75.75 0 0 0-.75-.75Z"}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"2.5",fill:"none",stroke:"currentColor",strokeWidth:"2"}),(0,r.jsx)("path",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M14.2 9.6c-.5-.6-1.28-.95-2.2-.95-1.3 0-2.15.66-2.15 1.62 0 1.02.85 1.44 2.35 1.83 1.5.39 2.35.8 2.35 1.83 0 .96-.85 1.62-2.35 1.62-.98 0-1.8-.37-2.3-1.02M12 7.2v1.45M12 15.55V17"})]})})},Analytics:e=>{let{filled:t=!1,className:a="w-6 h-6"}=e;return(0,r.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:t?(0,r.jsx)("path",{fill:"currentColor",d:"M5 2.5A2.5 2.5 0 0 0 2.5 5v14A2.5 2.5 0 0 0 5 21.5h14a2.5 2.5 0 0 0 2.5-2.5V5A2.5 2.5 0 0 0 19 2.5H5Zm2.75 9.75a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0v-4a1 1 0 0 1 1-1Zm4.25-5a1 1 0 0 1 1 1v9a1 1 0 1 1-2 0v-9a1 1 0 0 1 1-1Zm4.25 2.75a1 1 0 0 1 1 1v6.25a1 1 0 1 1-2 0V11a1 1 0 0 1 1-1Z"}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2.5",fill:"none",stroke:"currentColor",strokeWidth:"2"}),(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",d:"M7.75 16.5v-3.75M12 16.5V8.25M16.25 16.5v-5.25"})]})})},Lock:e=>{let{className:t="w-3.5 h-3.5"}=e;return(0,r.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("rect",{x:"4.5",y:"10.5",width:"15",height:"10",rx:"2.5",fill:"currentColor",opacity:"0.16"}),(0,r.jsx)("rect",{x:"4.5",y:"10.5",width:"15",height:"10",rx:"2.5",stroke:"currentColor",strokeWidth:"2"}),(0,r.jsx)("path",{d:"M8.25 10.5V7.75a3.75 3.75 0 1 1 7.5 0v2.75",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}},D="h-[26px] w-[26px]",U="h-[52px] w-[52px]",F=new Date().getFullYear(),P="/api/v2/notifications/unread-count",Z=()=>{(0,m.j)(P)},O="sidenav:collapsed",$={type:"spring",stiffness:400,damping:40},J={type:"spring",stiffness:300,damping:33},K={type:"spring",stiffness:300,damping:30,mass:.8},q={duration:.3,ease:[.2,0,0,1]},X={type:"spring",damping:30,stiffness:280,mass:.9},G={type:"spring",damping:36,stiffness:350},Y={type:"spring",stiffness:400,damping:38},Q={scale:.97},ee={scale:1.05},et="hover:bg-gray-900/[0.04] dark:hover:bg-white/[0.06]",ea="bg-gray-900/[0.06] ring-1 ring-gray-900/[0.04] dark:bg-white/[0.09] dark:ring-white/[0.08]",er="focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-gray-950",en="text-[15px] leading-5",es="text-[13px] leading-4",ei="text-[13px] font-semibold leading-4",eo=async e=>{let{fetchWithRateLimitRetry:t}=await Promise.resolve().then(a.bind(a,22466)),r=await t(e,{credentials:"include"}),n=await r.json().catch(()=>({}));if(!r.ok){let e=Error((null==n?void 0:n.message)||"Failed to fetch user");throw e.status=r.status,e}return n},el=e=>{if(!e)return"";let t=e.trim().replace(/'::text/g,"").replace(/::text/g,"").replace(/^['"]|['"]$/g,"").replace(/^'?https:\/([^/])/,"https://$1"),a="SzuSp5K29QFsFnrI2fDbPQ";return a&&(t=t.replace(/^https?:\/\/(www\.)?instaloops\.com\/images\//,"https://imagedelivery.net/".concat(a,"/"))),t},ec=e=>"Startup"===e||"Pro"===e||"ULTRA"===e,ed=()=>{try{let e=window.localStorage.getItem("communityVisits");if(!e)return{};let t=JSON.parse(e);return t&&"object"==typeof t?t:{}}catch(e){return console.error("Failed to parse community visits:",e),{}}},eu=e=>"sidenav-drawer-".concat(e),em=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!!t&&(e===t||!a&&e.startsWith("".concat(t,"/")))},eh={name:"More",icon:{regular:R.More,solid:R.More},isDrawer:!0,drawerId:"more"},ex=e=>{if(null==e?void 0:e.is_group){var t;return(null===(t=e.group_name)||void 0===t?void 0:t.trim())||"Group chat"}let a=null==e?void 0:e.participant;return"".concat((null==a?void 0:a.first_name)||""," ").concat((null==a?void 0:a.last_name)||"").trim()||"Unknown user"},ep=e=>{try{return e.matches(":focus-visible")}catch(e){return!0}},eg=(0,c.memo)(e=>{let{label:t}=e,a=(0,c.useRef)(null),[n,s]=(0,c.useState)(null);return(0,c.useEffect)(()=>{var e;let t;let r=null===(e=a.current)||void 0===e?void 0:e.closest(".group");if(!r)return;let n=e=>{clearTimeout(t),t=setTimeout(()=>{let e=r.getBoundingClientRect();s({top:Math.min(Math.max(e.top+e.height/2,24),window.innerHeight-24),left:e.right+10})},e)},i=()=>{clearTimeout(t),s(null)},o=()=>n(350),l=()=>{ep(r)&&n(0)};return r.addEventListener("pointerenter",o),r.addEventListener("pointerleave",i),r.addEventListener("pointerdown",i),r.addEventListener("focus",l),r.addEventListener("blur",i),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i),()=>{clearTimeout(t),r.removeEventListener("pointerenter",o),r.removeEventListener("pointerleave",i),r.removeEventListener("pointerdown",i),r.removeEventListener("focus",l),r.removeEventListener("blur",i),window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i)}},[]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{ref:a,"aria-hidden":"true",className:"hidden"}),n?(0,d.createPortal)((0,r.jsxs)("span",{role:"tooltip","aria-hidden":"true",style:{to
1p:n.top,left:n.left},className:(0,v.cn)("pointer-events-none fixed z-[100] -translate-y-1/2 whitespace-nowrap","rounded-md bg-gray-900 px-2.5 py-1.5 text-[13px] font-medium text-white shadow-elevation-3","dark:bg-gray-100 dark:text-gray-900","duration-150 ease-emphasized animate-in fade-in-0 slide-in-from-left-1","motion-reduce:animate-none"),children:[t,(0,r.jsx)("span",{className:"absolute left-0 top-1/2 h-2 w-2 -translate-x-1 -translate-y-1/2 rotate-45 bg-gray-900 dark:bg-gray-100"})]}),document.body):null]})});eg.displayName="RailTooltip";let ef=(0,c.memo)(e=>{let{isCollapsed:t}=e;return(0,r.jsx)("div",{"aria-hidden":"true",className:(0,v.cn)("border-t border-gray-200/80 transition-all duration-300 ease-emphasized dark:border-white/10",t?"mx-auto w-10":"w-full")})});ef.displayName="RailDivider";let ev=(0,c.memo)(e=>{let{count:t}=e;return!t||t<=0?null:(0,r.jsx)("span",{"aria-hidden":"true",className:"absolute -right-1.5 -top-1.5 flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-brand px-1.5 text-[11px] font-bold leading-none text-brand-foreground shadow-sm ring-[2px] ring-white dark:ring-gray-950",children:t>20?"20+":t})});ev.displayName="NotificationBadge";let ey=(0,c.memo)(e=>{var t,a,s,i,l,c,d;let{item:u,isActive:m,user:h,isCollapsed:x,onClick:g}=e,f=m?u.icon.solid:u.icon.regular,y="".concat(null!==(l=null==h?void 0:null===(t=h.first_name)||void 0===t?void 0:t[0])&&void 0!==l?l:"").concat(null!==(c=null==h?void 0:null===(a=h.last_name)||void 0===a?void 0:a[0])&&void 0!==c?c:"").trim()||(null!==(d=null==h?void 0:null===(i=h.first_name)||void 0===i?void 0:null===(s=i[0])||void 0===s?void 0:s.toUpperCase())&&void 0!==d?d:"U"),b=u.badge&&u.badge>0?", ".concat(u.badge," unread"):"",j=u.isLocked?"".concat(u.name," â upgrade to unlock"):"".concat(u.name).concat(b),w=(0,r.jsxs)(n.E.div,{className:(0,v.cn)("relative inline-flex items-center gap-5 rounded-full","transition-colors duration-150 ease-emphasized",!m&&"group-hover:bg-gray-900/[0.04] group-focus-visible:bg-gray-900/[0.04] dark:group-hover:bg-white/[0.06] dark:group-focus-visible:bg-white/[0.06]",x?(0,v.cn)("justify-center",U):"px-4 py-3 pr-6"),whileTap:Q,transition:$,children:[m&&(0,r.jsx)(n.E.span,{layoutId:"nav-active-pill",className:(0,v.cn)("absolute inset-0 rounded-full",ea),transition:K}),(0,r.jsxs)("div",{className:(0,v.cn)("relative z-10 flex shrink-0 items-center justify-center","transition-transform duration-200 ease-emphasized","group-hover:scale-[1.04] group-focus-visible:scale-[1.04]","motion-reduce:transform-none motion-reduce:transition-none"),children:[u.isAvatar?(0,r.jsxs)(p.Avatar,{className:(0,v.cn)(D,"ring-2 transition-all duration-200 ease-emphasized",m?"ring-gray-900 dark:ring-gray-100":"ring-transparent group-hover:ring-gray-200 dark:group-hover:ring-white/20"),children:[(0,r.jsx)(p.AvatarImage,{src:el(null==h?void 0:h.profile_image),alt:""}),(0,r.jsx)(p.AvatarFallback,{className:"bg-gradient-to-br from-sky-400 to-blue-600 text-xs font-bold text-white",children:y.toUpperCase()})]}):(0,r.jsx)(f,{filled:m,className:(0,v.cn)(D,"transition-colors duration-150 ease-emphasized",m?"text-gray-900 dark:text-gray-50":"text-gray-700 group-hover:text-gray-900 dark:text-gray-400 dark:group-hover:text-gray-50")}),(0,r.jsx)(ev,{count:u.badge}),u.isLocked&&x&&(0,r.jsx)("span",{className:"dark:ring-white/15 absolute -bottom-1 -right-1.5 flex h-[15px] w-[15px] items-center justify-center rounded-full bg-white text-gray-400 ring-1 ring-gray-200 dark:bg-gray-950 dark:text-gray-500",children:(0,r.jsx)(R.Lock,{className:"h-[9px] w-[9px]"})})]}),!x&&(0,r.jsxs)("span",{className:"relative z-10 flex items-center gap-2",children:[(0,r.jsx)("span",{className:(0,v.cn)("whitespace-nowrap transition-colors duration-150 ease-emphasized","text-[20px] leading-6 tracking-[-0.01em]",m?"font-bold text-gray-900 dark:text-gray-50":"font-normal text-gray-800 group-hover:text-gray-900 dark:text-gray-300 dark:group-hover:text-gray-50"),children:u.name}),u.isLocked&&(0,r.jsx)("span",{className:"flex shrink-0 items-center text-gray-300 transition-colors duration-150 ease-emphasized group-hover:text-brand group-focus-visible:text-brand dark:text-gray-600",children:(0,r.jsx)(R.Lock,{className:"h-[15p
1x] w-[15px]"})})]}),x&&(0,r.jsx)(eg,{label:j})]}),k=(0,v.cn)("group block rounded-full text-gray-900 dark:text-gray-50",er,x&&"flex w-full justify-center");return u.isDrawer&&g?(0,r.jsx)("button",{type:"button",onClick:g,"aria-label":j,"aria-expanded":m,"aria-controls":u.drawerId?eu(u.drawerId):void 0,"aria-haspopup":"dialog",className:k,children:w}):u.isLocked&&g?(0,r.jsx)("button",{type:"button",onClick:g,"aria-label":j,className:k,children:w}):(0,r.jsx)(o.default,{href:u.href||"#","aria-label":j,"aria-current":m?"page":void 0,className:k,children:w})});ey.displayName="NavItem";let eb=(0,c.memo)(e=>{var t,a;let{community:s,isActive:i,onClick:l,href:c,isCollapsed:d}=e;return(0,r.jsx)(n.E.li,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{duration:.2,ease:"easeOut"},children:(0,r.jsxs)(o.default,{href:c,prefetch:!0,onClick:l,"aria-label":s.unread_count?"".concat(s.name,", ").concat(s.unread_count," new"):s.name,"aria-current":i?"page":void 0,className:(0,v.cn)("group relative flex items-center gap-3 rounded-full text-left","transition-colors duration-150 ease-emphasized",er,d?(0,v.cn)("mx-auto justify-center",U):"w-full px-3 py-2.5",i?ea:et),children:[(0,r.jsxs)(p.Avatar,{className:(0,v.cn)("h-8 w-8 shrink-0 ring-2 transition-all duration-200 ease-emphasized","group-hover:scale-105 group-focus-visible:scale-105","motion-reduce:transform-none motion-reduce:transition-none",i?"ring-gray-900/70 dark:ring-gray-100/70":"ring-transparent group-hover:ring-gray-200 dark:group-hover:ring-white/20"),children:[(0,r.jsx)(p.AvatarImage,{src:el(s.logo||s.profile_image),alt:""}),(0,r.jsx)(p.AvatarFallback,{className:"bg-gray-200 text-xs font-semibold text-gray-600 dark:bg-white/10 dark:text-gray-300",children:(null===(a=s.name)||void 0===a?void 0:null===(t=a[0])||void 0===t?void 0:t.toUpperCase())||"C"})]}),!d&&(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:(0,v.cn)("truncate text-gray-900 dark:text-gray-50",en,i?"font-bold":"font-medium"),children:s.name}),s.unread_count?(0,r.jsxs)("p",{className:(0,v.cn)("font-medium text-brand",es),children:[s.unread_count," new"]}):(0,r.jsx)("p",{className:(0,v.cn)("truncate text-gray-500 dark:text-gray-400",es),children:"owned"===s.type?"Owner":"Member"})]}),d&&(0,r.jsx)(eg,{label:s.name})]})})});eb.displayName="CommunityItem";let ej=(0,v.cn)("[scrollbar-width:thin]","[scrollbar-color:rgba(0,0,0,0.12)_transparent]","dark:[scrollbar-color:rgba(255,255,255,0.16)_transparent]"),ew=(0,c.memo)(e=>{let{title:t,onClose:a,children:n}=e;return(0,r.jsxs)("div",{className:"flex items-center justify-between border-b border-gray-200 px-4 py-4 dark:border-white/10",children:[(0,r.jsx)("h2",{className:"text-xl font-bold text-gray-900 dark:text-gray-50",children:t}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[n,(0,r.jsx)("button",{type:"button",onClick:a,className:(0,v.cn)("rounded-full p-1.5 transition-colors duration-150 ease-emphasized","hover:bg-gray-100 dark:hover:bg-white/10",er),"aria-label":"Close ".concat(t.toLowerCase()),children:(0,r.jsx)(R.X,{className:"h-4 w-4 text-gray-500 dark:text-gray-400"})})]})]})});ew.displayName="DrawerHeader";let ek=(0,c.memo)(e=>{let{label:t,onClick:a}=e;return(0,r.jsx)("button",{type:"button",onClick:a,className:(0,v.cn)("rounded-full px-2 py-1 text-sm font-medium text-brand transition-colors duration-150 ease-emphasized","hover:text-brand-emphasis",er),children:t})});ek.displayName="DrawerAction";let eN=(0,c.memo)(e=>{let{label:t}=e;return(0,r.jsxs)("div",{className:"flex items-center justify-center py-12",role:"status",children:[(0,r.jsx)("div",{className:"dark:border-white/15 h-8 w-8 animate-spin rounded-full border-2 border-gray-200 border-t-brand dark:border-t-brand"}),(0,r.jsx)(f.T,{children:t})]})});eN.displayName="DrawerLoading";let eC=(0,c.memo)(e=>{let{title:t,onRetry:a}=e;return(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center px-6 py-16 text-center",children:[(0,r.jsx)("p",{className:"mb-1 text-lg font-bold text-gray-900 dark:text-gray-50",children:t}),(0,r.jsx)("p",{className:"mb-4 text-sm text-gray-500 dark:text-gray-400",children:"Check your connection and try again."}),(0,r.jsx)("button",{type:"button",onClick:a,className:(0,v.cn)("rounded-full bg-gray-900 px-4 py-2 text-sm font-semibold text-white","transition-colors duration-150 ease-emphasized hover:bg-gray-800","dark:bg-gray-100 dark:text-gray-900 dark:hover:bg-white",er),children:"Try again"})]})});eC.displayName="DrawerError";let e_=(0,c.memo)(e=>{let{icon:t,title:a,description:n,children:s}=e;return(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center px-6 py-16",children:[(0,r.jsx)("div",{className:"mb-4 flex h-20 w-20 items-center justify-center rounded-full bg-gray-50 dark:bg-white/[0.06]",children:(0,r.jsx)(t,{className:"h-10 w-10 text-gray-300 dark:text-gray-600"})}),(0,r.jsx)("p",{className:"mb-1 text-lg font-bold text-gray-900 dark:text-gray-50",children:a}),(0,r.jsx)("p",{className:"max-w-[240px] text-center text-sm text-gray-500 dark:text-gray-400",children:n}),s]})});e_.displayName="DrawerEmpty";let eL=(0,v.cn)("flex w-full text-left transition-colors duration-150 ease-emphasized","hover:bg-gray-50 dark:hover:bg-white/[0.06]","focus:outline-none focus-visible:bg-gray-50 dark:focus-visible:bg-white/[0.06]","focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring"),eE=(0,c.memo)(e=>{let{onClose:t}=e,a=(0,l.useRouter)(),[s,i]=(0,c.useState)([]),[o,d]=(0,c.useState)(!0),[m,h]=(0,c.useState)("all"),[x,g]=(0,c.useState)(!1),[f,y]=(0,c.useState)(0);(0,c.useEffect)(()=>{(async()=>{d(!0),g(!1);try{let e=await fetch("/api/v2/notifications?limit=50",{credentials:"include"}),t=await e.json();t.success&&t.data?i(t.data.notifications||[]):g(!0)}catch(e){console.error("Failed to fetch notifications:",e),g(!0)}finally{d(!1)}})()},[f]);let b=async()=>{try{let e=await fetch("/api/v2/notifications",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({mark_all:!0})});if(!e.ok)throw Error("Request failed (".concat(e.status,")"));i(e=>e.map(e=>({...e,is_read:!0}))),Z()}catch(e){console.error("Failed to mark as read:",e),u.Am.error("Couldn't mark notifications as read")}},j=(0,c.useCallback)(e=>{let r=e.items.filter(e=>!e.is_read).map(e=>e.id);r.length>0&&(i(e=>e.map(e=>r.includes(e.id||e.notification_id)?{...e,is_read:!0}:e)),fetch("/api/v2/notifications",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({notification_ids:r})}).then(()=>Z()).catch(()=>{}));let n=(0,T.T)(e.latest);a.push(n||"/notifications"),t()},[a,t]),w=(0,c.useMemo)(()=>{let e="mentions"===m?s.filter(e=>
1"mention"===e.notification_type):s;return(0,V.$l)(e)},[m,s]);return(0,r.jsxs)("div",{className:"flex h-full flex-col",children:[(0,r.jsx)(ew,{title:"Notifications",onClose:t,children:(0,r.jsx)(ek,{label:"Mark all read",onClick:b})}),(0,r.jsx)("div",{role:"tablist","aria-label":"Filter notifications",className:"flex border-b border-gray-200 dark:border-white/10",children:["all","mentions"].map(e=>(0,r.jsxs)("button",{type:"button",role:"tab","aria-selected":m===e,onClick:()=>h(e),className:(0,v.cn)("relative flex-1 py-3 text-center text-sm font-semibold","transition-colors duration-150 ease-emphasized","focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",m===e?"text-gray-900 dark:text-gray-50":"text-gray-500 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-white/[0.06]"),children:["all"===e?"All":"Mentions",m===e&&(0,r.jsx)("span",{className:"absolute inset-x-0 bottom-0 flex justify-center",children:(0,r.jsx)(n.E.span,{layoutId:"notif-filter-underline",transition:K,className:"h-1 w-14 rounded-full bg-brand"})})]},e))}),(0,r.jsx)("div",{className:(0,v.cn)("flex-1 overflow-y-auto scroll-smooth",ej),children:o?(0,r.jsx)(eN,{label:"Loading notifications"}):x?(0,r.jsx)(eC,{title:"Couldn't load notifications",onRetry:()=>y(e=>e+1)}):0===w.length?(0,r.jsx)(e_,{icon:R.Bell,title:"Nothing to see here â yet",description:"mentions"===m?"When someone mentions you, it'll show up here.":"When you get notifications, they'll show up here."}):(0,r.jsx)("div",{children:w.map(e=>{var t,a;let n=e.items.length>1,s=n?(0,V.RT)(e):(0,V.$4)(e.latest.actor)||e.latest.title||"",i=n?e.latest.message||"":(0,V.jh)(e.latest),o=e.unreadCount>0;return(0,r.jsxs)("button",{type:"button",onClick:()=>j(e),className:(0,v.cn)(eL,"items-start gap-3 px-4 py-3",o&&"bg-brand-subtle/60 dark:bg-brand/[0.12]"),children:[(0,r.jsxs)(p.Avatar,{className:"h-10 w-10 shrink-0",children:[(0,r.jsx)(p.AvatarImage,{src:el(null===(t=e.latest.actor)||void 0===t?void 0:t.profile_image),alt:""}),(0,r.jsx)(p.AvatarFallback,{className:"bg-gradient-to-br from-sky-400 to-blue-600 text-sm font-semibold text-white",children:(null==s?void 0:null===(a=s[0])||void 0===a?void 0:a.toUpperCase())||"U"})]}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("p",{className:"text-[15px] leading-[1.4] text-gray-900 dark:text-gray-50",children:[s&&(0,r.jsxs)("span",{className:"font-bold",children:[s," "]}),(0,r.jsx)("span",{className:"text-gray-700 dark:text-gray-300",children:i})]}),(0,r.jsxs)("p",{className:"mt-0.5 flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400",children:[e.latest.created_at&&(0,H.Sy)(e.latest.created_at),n&&(0,r.jsx)("span",{className:"rounded-full bg-gray-100 px-1.5 py-0.5 text-xs font-medium text-gray-600 dark:bg-white/10 dark:text-gray-300",children:e.items.length})]})]}),o&&(0,r.jsx)("span",{"aria-label":"Unread",className:"mt-2 h-2 w-2 shrink-0 rounded-full bg-brand"})]},e.key)})})})]})});eE.displayName="NotificationsDrawer";let eM=(0,c.memo)(e=>{let{onClose:t}=e,a=(0,l.useRouter)(),[n,s]=(0,c.useState)([]),[i,o]=(0,c.useState)(!0),[d,u]=(0,c.useState)(!1),[m,h]=(0,c.useState)(0);return(0,c.useEffect)(()=>{(async()=>{o(!0),u(!1);try{let e=await fetch("/api/v2/chat/conversations?limit=50",{credentials:"include"}),t=await e.json();t.success&&t.data?s(t.data.conversations||[]):u(!0)}catch(e){console.error("Failed to fetch conversations:",e),u(!0)}finally{o(!1)}})()},[m]),(0,r.jsxs)("div",{className:"flex h-full flex-col",children:[(0,r.jsx)(ew,{title:"Messages",onClose:t,children:(0,r.jsx)(ek,{label:"See all",onClick:()=>{a.push("/community/chat"),t()}})}),(0,r.jsx)("div",{className:(0,v.cn)("flex-1 overflow-y-auto scroll-smooth",ej),children:i?(0,r.jsx)(eN,{label:"Loading messages"}):d?(0,r.jsx)(eC,{title:"Couldn't load messages",onRetry:()=>h(e=>e+1)}):0===n.length?(0,r.jsx)(e_,{icon:R.Message,title:"Welcome to your inbox!",description:"Drop a line, share posts and more with private conversations.",children:(0,r.jsx)("button",{type:"button",onClick:()=>{a.push("/community/chat"),t()},className:(0,v.cn)("mt-4 rounded-full bg-brand px-5 py-2.5 font-bold text-brand-foreground","transition-colors duration-150 ease-emphasized hover:bg-brand-emphasis",er),children:"Write a message"})}):(0,r.jsx)("div",{children:n.map(e=>{var n,s,i,o;let l=e.id||e.conversation_id,c=ex(e);return(0,r.jsxs)("button",{type:"button",onClick:()=>{a.push("/community/chat?id=".concat(l)),Z(),t()},className:(0,v.cn)(eL,"items-center gap-3 px-4 py-3"),children:[(0,r.jsxs)(p.Avatar,{className:"h-12 w-12 shrink-0",children:[(0,r.jsx)(p.AvatarImage,{src:el(null===(n=e.participant)||void 0===n?void 0:n.profile_image),alt:""}),(0,r.jsx)(p.AvatarFallback,{className:"bg-gradient-to-br from-sky-4
100 to-blue-600 font-semibold text-white",children:(null===(s=c[0])||void 0===s?void 0:s.toUpperCase())||"U"})]}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("p",{className:"truncate font-semibold text-gray-900 dark:text-gray-50",children:c}),(0,r.jsx)("span",{className:"ml-2 shrink-0 text-xs text-gray-500 dark:text-gray-400",children:(null===(i=e.last_message)||void 0===i?void 0:i.created_at)&&(0,H.Sy)(e.last_message.created_at)})]}),(0,r.jsx)("p",{className:(0,v.cn)("mt-0.5 truncate text-sm",e.unread_count>0?"font-medium text-gray-900 dark:text-gray-50":"text-gray-500 dark:text-gray-400"),children:(null===(o=e.last_message)||void 0===o?void 0:o.content)||"No messages yet"})]}),e.unread_count>0&&(0,r.jsx)("span",{className:"flex h-5 min-w-[20px] shrink-0 items-center justify-center rounded-full bg-brand px-1.5 text-xs font-bold text-brand-foreground",children:e.unread_count>99?"99+":e.unread_count})]},l)})})})]})});eM.displayName="MessagesDrawer";let eA=(0,c.memo)(e=>{let{onClose:t}=e,a=(0,l.useRouter)(),[n,s]=(0,c.useState)([]),[i,o]=(0,c.useState)(!0),[d,u]=(0,c.useState)(!1),[m,h]=(0,c.useState)(0);return(0,c.useEffect)(()=>{(async()=>{o(!0),u(!1);try{var e;let t=await fetch("/api/v2/community/posts/saved?limit=50",{credentials:"include"}),a=await t.json();a.success&&(null===(e=a.data)||void 0===e?void 0:e.posts)?s(a.data.posts):u(!0)}catch(e){console.error("Failed to fetch bookmarks:",e),u(!0)}finally{o(!1)}})()},[m]),(0,r.jsxs)("div",{className:"flex h-full flex-col",children:[(0,r.jsx)(ew,{title:"Bookmarks",onClose:t}),(0,r.jsx)("div",{className:(0,v.cn)("flex-1 overflow-y-auto scroll-smooth",ej),children:i?(0,r.jsx)(eN,{label:"Loading bookmarks"}):d?(0,r.jsx)(eC,{title:"Couldn't load bookmarks",onRetry:()=>h(e=>e+1)}):0===n.length?(0,r.jsx)(e_,{icon:R.Bookmark,title:"Save posts for later",description:"Bookmark posts to easily find them again."}):(0,r.jsx)("div",{children:n.map(e=>{var n,s;return(0,r.jsxs)("button",{type:"button",onClick:()=>{a.push("/post/".concat(e.post_id)),t()},className:(0,v.cn)(eL,"items-start gap-3 px-4 py-3"),children:[e.image_url&&(0,r.jsx)("div",{className:"h-16 w-16 shrink-0 overflow-hidden rounded-xl bg-gray-100 dark:bg-white/10",children:(0,r.jsx)("img",{src:el(e.image_url),alt:"",className:"h-full w-full object-cover"})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"line-clamp-2 text-[15px] font-semibold text-gray-900 dark:text-gray-50",children:e.title||e.description||"Untitled post"}),(0,r.jsxs)("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:[null===(n=e.posted_by)||void 0===n?void 0:n.first_name," ",null===(s=e.posted_by)||void 0===s?void 0:s.last_name]})]})]},e.post_id)})})})]})});eA.displayName="BookmarksDrawer";let eS=(0,c.memo)(e=>{let{label:t,href:a,icon:i,hasSubmenu:o,submenuItems:d,onClick:u,onClose:m}=e,[h,x]=(0,c.useState)(!1),p=(0,l.useRouter)();return(0,r.jsxs)(n.E.li,{className:"list-none",initial:{opacity:0,y:-5},animate:{opacity:1,y:0},transition:{duration:.15,ease:"easeOut"},children:[(0,r.jsxs)(n.E.button,{type:"button",onClick:()=>{o?x(!h):u?u():a&&(p.push(a),m())},"aria-expanded":o?h:void 0,className:(0,v.cn)(eL,"items-center justify-between px-4 py-3",en),whileTap:Q,transition:$,children:[(0,r.jsxs)("span",{className:"flex items-center gap-3",children:[i&&(0,r.jsx)(i,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"}),(0,r.jsx)("span",{className:"font-medium text-gray-900 dark:text-gray-50",children:t})]}),o&&(0,r.jsx)(n.E.span,{className:"flex",animate:{rotate:h?90:0},transition:J,children:(0,r.jsx)(R.ChevronRight,{className:"h-4 w-4 text-gray-400 dark:text-gray-500"})})]}),(0,r.jsx)(s.M,{initial:!1,children:o&&h&&d&&(0,r.jsx)(n.E.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1,transition:{height:Y,opacity:{duration:.2}}},exit:{height:0,opacity:0,transition:{height:Y,opacity:{duration:.15}}},className:"overflow-hidden bg-gray-50/50 dark:bg-white/[0.03]",children:d.map((e,t)=>(0,r.jsx)(n.E.button,{type:"button",initial:{opacity:0,x:-10}
1,animate:{opacity:1,x:0,transition:{delay:.04*t,duration:.15}},onClick:()=>{e.onClick?e.onClick():e.href&&(p.push(e.href),m())},className:(0,v.cn)(eL,"items-center gap-3 py-2.5 pl-12 pr-4","transition-[transform,background-color] duration-150 ease-emphasized","hover:translate-x-1 focus-visible:translate-x-1","motion-reduce:transform-none"),children:(0,r.jsx)("span",{className:"text-[14px] text-gray-700 dark:text-gray-300",children:e.label})},e.label))})})]})});eS.displayName="MoreMenuItem";let eI=(0,c.memo)(e=>{let{onClose:t,handleLogout:a,isLogoutPending:s,onCreatePost:i}=e;(0,l.useRouter)();let o=[{label:"Create",hasSubmenu:!0,icon:R.Create,submenuItems:[{label:"Note",onClick:()=>{t(),null==i||i()}},{label:"Article",href:"/create/post"},{label:"Drafts",href:"/drafts"},{label:"Video",href:"/create/upload"},{label:"Podcast",href:"/create/upload?type=podcast"},{label:"Live",href:"/create/meeting"},{label:"Recording studio",href:"/create/upload?type=recording"}]},{label:"Wallet",href:"/wallet",icon:R.Wallet},{label:"Settings",hasSubmenu:!0,icon:R.Settings,submenuItems:[{label:"Account",href:"/settings"},{label:"Privacy and safety",href:"/settings/privacy"},{label:"Notifications",href:"/settings/notifications"},{label:"Muted words",href:"/settings/muted-words"}]}];return(0,r.jsxs)("div",{className:"flex h-full flex-col",children:[(0,r.jsx)(ew,{title:"More",onClose:t}),(0,r.jsxs)(n.E.ul,{className:"flex-1 overflow-y-auto py-2",initial:"hidden",animate:"visible",variants:{visible:{transition:{staggerChildren:.05}}},children:[o.map(e=>(0,r.jsx)(eS,{label:e.label,href:e.href,icon:e.icon,hasSubmenu:e.hasSubmenu,submenuItems:e.submenuItems,onClose:t},e.label)),(0,r.jsx)("div",{className:"mx-4 my-2 border-t border-gray-100 dark:border-white/10"}),a&&(0,r.jsx)(eS,{label:s?"Logging out...":"Log out",icon:R.Logout,onClick:()=>{t(),a()},onClose:t})]})]})});eI.displayName="MoreDrawer";let ez=e=>{let{className:t="w-5 h-5"}=e;return(0,r.jsxs)("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:t,children:[(0,r.jsx)("circle",{cx:"5",cy:"12",r:"2"}),(0,r.jsx)("circle",{cx:"12",cy:"12",r:"2"}),(0,r.jsx)("circle",{cx:"19",cy:"12",r:"2"})]})},eW=(0,c.memo)(e=>{var t,a,s,i,o,l,c;let{user:d,isCollapsed:u,onClick:m}=e,h="".concat(null!==(o=null==d?void 0:null===(t=d.first_name)||void 0===t?void 0:t[0])&&void 0!==o?o:"").concat(null!==(l=null==d?void 0:null===(a=d.last_name)||void 0===a?void 0:a[0])&&void 0!==l?l:"").trim()||(null!==(c=null==d?void 0:null===(i=d.first_name)||void 0===i?void 0:null===(s=i[0])||void 0===s?void 0:s.toUpperCase())&&void 0!==c?c:"U"),x="".concat((null==d?void 0:d.first_name)||""," ").concat((null==d?void 0:d.last_name)||"").trim()||"User",g=(null==d?void 0:d.user_name)||"user",f=(0,r.jsxs)(p.Avatar,{className:(0,v.cn)("h-10 w-10 shrink-0 ring-2 ring-transparent","transition-all duration-200 ease-emphasized","group-hover:ring-gray-200 dark:group-hover:ring-white/20","group-hover:scale-105 group-focus-visible:scale-105","motion-reduce:transform-none motion-reduce:transition-none"),children:[(0,r.jsx)(p.AvatarImage,{src:el(null==d?void 0:d.profile_image),alt:""}),(0,r.jsx)(p.AvatarFallback,{className:"bg-gradient-to-br from-sky-400 to-blue-600 text-sm font-bold text-white",children:h.toUpperCase()})]});return u?(0,r.jsxs)(n.E.button,{type:"button",onClick:m,className:(0,v.cn)("group flex items-center justify-center rounded-full",U,"transition-colors duration-150 ease-emphasized",et,er),"aria-label":"Account menu for ".concat(x),"aria-haspopup":"dialog",whileTap:{scale:.95},transition:$,children:[f,(0,r.jsx)(eg,{label:x})]}):(0,r.jsxs)(n.E.button,{type:"button",onClick:m,className:(0,v.cn)("group flex w-full items-center gap-3 rounded-full p-3","transition-colors duration-150 ease-emphasized",et,er),"aria-label":"Account menu for ".concat(x),"aria-haspopup":"dialog",whileTap:Q,transition:$,children:[f,(0,r.jsxs)("span",{className:"min-w-0 flex-1 text-left",children:[(0,r.jsx)("span",{className:(0,v.cn)("block truncate font-bold text-gray-900 dark:text-gray-50",en),children:x}),(0,r.jsxs)("span",{className:(0,v.cn)("block truncate text-gray-500 dark:text-gray-400",en),children:["@",g]})]}),(0,r.jsx)(ez,{className:(0,v.cn)("h-[18px] w-[18px] shrink-0 text-gray-400 dark:text-gray-500","transition-colors duration-200 ease-emphasized","group-hover:text-gray-700 group-focus-visible:text-gray-700","dark:group-hover:text-gray-200 dark:group-focus-visible:text-gray-200")})]})});
1eW.displayName="AccountButton";let eB=(0,c.memo)(e=>{let{isOpen:t,onClose:a,children:i,sidenavWidth:o,label:l,panelId:d}=e,u=(0,c.useRef)(null);return(0,c.useEffect)(()=>{var e;if(!t)return;let a=document.activeElement;return null===(e=u.current)||void 0===e||e.focus(),()=>{var e;return null==a?void 0:null===(e=a.focus)||void 0===e?void 0:e.call(a)}},[t]),(0,c.useEffect)(()=>{if(!t)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[t]),(0,c.useEffect)(()=>{if(!t)return;let e=e=>{u.current&&!u.current.contains(e.target)&&a()},r=e=>{"Escape"===e.key&&a()};return document.addEventListener("mousedown",e),document.addEventListener("keydown",r),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",r)}},[t,a]),(0,r.jsx)(s.M,{mode:"wait",children:t&&(0,r.jsx)(n.E.div,{ref:u,id:d,role:"dialog","aria-modal":"true","aria-label":l,tabIndex:-1,initial:{x:0},animate:{x:o,transition:X},exit:{x:0,transition:G},className:(0,v.cn)("fixed bottom-0 left-0 top-0 z-20 border-r border-gray-100 bg-white","shadow-elevation-4 focus:outline-none","dark:border-white/10 dark:bg-gray-950"),style:{width:400},children:(0,r.jsx)(n.E.div,{initial:{opacity:0}
1,animate:{opacity:1,transition:{delay:.08,duration:.2}},className:"h-full",children:i})})})});eB.displayName="DrawerWrapper";let eV=(0,c.memo)(e=>{var t,a,d;let{handleLogout:u,isLogoutPending:m,user:p}=e,y=(0,l.usePathname)();(0,l.useRouter)();let{data:b}=(0,W.Z)(),{data:j}=(0,B.Z)(),{data:w}=(0,h.ZP)("/api/v2/me",eo,{revalidateOnFocus:!1,dedupingInterval:1e4}),k=!!(null!==(d=null!==(a=null==p?void 0:p.id)&&void 0!==a?a:null==w?void 0:null===(t=w.data)||void 0===t?void 0:t.id)&&void 0!==d?d:null==w?void 0:w.id),{data:N}=(0,h.ZP)(k?P:null,eo,{refreshInterval:6e4,dedupingInterval:3e4,revalidateOnFocus:!1,shouldRetryOnError:e=>{let t=null==e?void 0:e.status;return 401!==t&&403!==t&&429!==t},onErrorRetry:(e,t,a,r,n)=>{let{retryCount:s}=n;(null==e?void 0:e.status)===429||s>=3||setTimeout(()=>r({retryCount:s}),Math.min(5e3*2**s,3e4))}}),C=(0,c.useMemo)(()=>(function(e){var t,a,r,n,s,i,o;if(!e)return null;let l=null!==(t=e.data)&&void 0!==t?t:e;return l?{id:null!==(a=l.id)&&void 0!==a?a:l.user_id,first_name:null!==(r=l.first_name)&&void 0!==r?r:"",last_name:null!==(n=l.last_name)&&void 0!==n?n:"",profile_image:null!==(s=l.profile_image)&&void 0!==s?s:null,user_name:null!==(i=l.user_name)&&void 0!==i?i:null,account_type:null!==(o=l.account_type)&&void 0!==o?o:null}:null})(w),[w]),_=(0,c.useMemo)(()=>{var e,t,a,r,n,s,i,o,l;return{first_name:null!==(t=null!==(e=null==p?void 0:p.first_name)&&void 0!==e?e:null==C?void 0:C.first_name)&&void 0!==t?t:"",last_name:null!==(r=null!==(a=null==p?void 0:p.last_name)&&void 0!==a?a:null==C?void 0:C.last_name)&&void 0!==r?r:"",profile_image:null!==(s=null!==(n=null==C?void 0:C.profile_image)&&void 0!==n?n:null==p?void 0:p.profile_image)&&void 0!==s?s:null,user_name:null!==(o=null!==(i=null==C?void 0:C.user_name)&&void 0!==i?i:null==p?void 0:p.user_name)&&void 0!==o?o:null,id:null!==(l=null==p?void 0:p.id)&&void 0!==l?l:null==C?void 0:C.id}},[p,C]),L=ec(null==C?void 0:C.account_type),E=void 0!==w&&!L,M=L?"/community/new":"/pricing",[A,S]=(0,c.useState)([]),[I,V]=(0,c.useState)(!0),[T,H]=(0,c.useState)(!1),[D,Z]=(0,c.useState)(null),[K,X]=(0,c.useState)(!1),[G,Y]=(0,c.useState)(null),[ea,en]=(0,c.useState)(!1),[es,el]=(0,c.useState)(!1);(0,c.useEffect)(()=>{try{en("1"===window.localStorage.getItem(O))}catch(e){}let e=window.matchMedia("(max-width: 1279px)");el(e.matches);let t=e=>el(e.matches);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let ex=(0,c.useCallback)(()=>{en(e=>{let t=!e;try{window.localStorage.setItem(O,t?"1":"0")}catch(e){}return t})},[]);(0,c.useEffect)(()=>{let e=e=>{if("["!==e.key||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target;t&&("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)||ex()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[ex]);let ep=null!==D||ea||es,ev=ep?88:275;(0,c.useEffect)(()=>(document.documentElement.style.setProperty("--sidenav-width","".concat(ev,"px")),()=>{document.documentElement.style.removeProperty("--sidenav-width")}),[ev]);let ej=(0,c.useMemo)(()=>{var e;let t=null==_?void 0:null===(e=_.user_name)||void 0===e?void 0:e.trim();return t?"/@".concat(t):"/@"},[null==_?void 0:_.user_name]),ew=(0,c.useRef)(null);null===ew.current&&(ew.current=ed());let ek=(0,c.useRef)("");ek.current="".concat(_.first_name||""," ").concat(_.last_name||"").trim(),(0,c.useEffect)(()=>{var e;if(!(null==j?void 0:j.data)||!(null==b?void 0:b.data)){V(!1);return}let t=new Map;j.data.forEach(e=>{var a;t.set(e.community_id,{community_id:e.community_id,name:e.name,slug:e.slug,logo:e.logo,profile_image:e.logo,type:"owned",unread_count:null!==(a=e.unread_count)&&void 0!==a?a:0,owner_name:ek.current})}),b.data.forEach(e=>{if(!t.has(e.community_id)){var a;t.set(e.community_id,{community_id:e.community_id,name:e.name,slug:e.slug,logo:e.logo,profile_image:e.logo,type:"member",unread_count:null!==(a=e.unread_count)&&void 0!==a?a:0,owner_name:e.owner_name||""})}});let a=null!==(e=ew.current)&&void 0!==e?e:{};S(Array.from(t.values()).sort((e,t)=>{let r=a[e.community_id]||0,n=a[t.community_id]||0;
1return r!==n?n-r:e.name.localeCompare(t.name)})),V(!1)},[j,b]);let eN=(0,c.useCallback)(e=>{var t;let a=null!==(t=ew.current)&&void 0!==t?t:{};a[e.community_id]=Date.now();try{window.localStorage.setItem("communityVisits",JSON.stringify(a))}catch(e){console.error("Failed to persist community visits:",e)}},[]),eC=(0,c.useCallback)(e=>{Z(t=>t===e?null:e)},[]),e_=(0,c.useCallback)(()=>{Z(null)},[]),eL=(0,c.useMemo)(()=>{var e,t;return[{name:"Home",href:"/community",icon:{regular:R.Home,solid:R.Home}},{name:"Clarua",href:"/clarua",icon:{regular:R.Clarua,solid:R.Clarua}},{name:"Notifications",icon:{regular:R.Bell,solid:R.Bell},isDrawer:!0,drawerId:"notifications",badge:(null==N?void 0:null===(e=N.data)||void 0===e?void 0:e.notifications)||0},{name:"Messages",icon:{regular:R.Message,solid:R.Message},isDrawer:!0,drawerId:"messages",badge:(null==N?void 0:null===(t=N.data)||void 0===t?void 0:t.messages)||0},{name:"Bookmarks",icon:{regular:R.Bookmark,solid:R.Bookmark},isDrawer:!0,drawerId:"bookmarks"}]},[N]),eS=(0,c.useMemo)(()=>[{name:"Contacts",href:"/contacts",icon:{regular:R.Contacts,solid:R.Contacts},isLocked:E,premiumFeature:"contacts"},{name:"Income",href:"/income",icon:{regular:R.Income,solid:R.Income},isLocked:E,premiumFeature:"income"},{name:"Analytics",href:"/analytics",icon:{regular:R.Analytics,solid:R.Analytics},isLocked:E,premiumFeature:"analytics"}],[E]),ez=(0,c.useMemo)(()=>[{name:"Profile",href:ej,icon:{regular:R.User,solid:R.User},isAvatar:!0}],[ej]),eV=(0,c.useMemo)(()=>T?A:A.slice(0,5),[A,T]),eT=Math.max(A.length-5,0);return(0,r.jsxs)(i.A,{reducedMotion:"user",children:[(0,r.jsx)(n.E.aside,{className:(0,v.cn)("fixed bottom-0 left-0 top-0 z-30 hidden md:flex","border-r border-gray-200 bg-white dark:border-white/10 dark:bg-gray-950",ep&&"shadow-elevation-4"),initial:!1,animate:{width:ev},transition:q,"aria-label":"Primary sidebar navigation",children:(0,r.jsxs)("div",{className:"flex w-full flex-col items-end",children:[(0,r.jsxs)(n.E.div,{className:(0,v.cn)("flex w-full shrink-0",ep?"flex-col items-center gap-0.5 px-2 py-2":"items-center justify-between px-3 py-3"),initial:!1,animate:{opacity:1},transition:{duration:.2},children:[(0,r.jsx)(n.E.div,{whileHover:ee,whileTap:{scale:.95},transition:$,children:(0,r.jsx)(o.default,{href:"/","aria-label":"Instaloops â go to home",className:(0,v.cn)("inline-flex items-center justify-center rounded-full","transition-colors duration-150 ease-emphasized","hover:bg-gray-100/80 dark:hover:bg-white/[0.08]",er,ep?U:"p-3"),children:(0,r.jsx)(s.M,{mode:"wait",children:ep?(0,r.jsx)(n.E.img,{src:"https://idanijjeygvcdmdhcmqs.supabase.co/storage/v1/object/public/public-assets/instaloops/Instaloops_emblem.png",alt:"Instaloops",className:"h-7 w-7",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.15}},"icon"):(0,r.jsx)(n.E.img,{src:"https://idanijjeygvcdmdhcmqs.supabase.co/storage/v1/object/public/public-assets/instaloops/instaloops-blu.png",alt:"Instaloops",className:"h-7 w-auto",initial:{opacity:0,x:-10},animate:{opacity:1,x:0},exit:{opacity:0,x:-10},transition:{duration:.2}},"logo")})})}),null===D&&!es&&(0,r.jsxs)(n.E.button,{type:"button",onClick:ex,"aria-label":ep?"Expand sidebar":"Collapse sidebar","aria-expanded":!ep,"aria-keyshortcuts":"[",title:"".concat(ep?"Expand":"Collapse"," sidebar ( [ )"),className:(0,v.cn)("group relative rounded-full p-2 text-gray-400 dark:text-gray-500","transition-colors duration-150 ease-emphasized","hover:bg-gray-100/80 hover:text-gray-700","dark:hover:bg-white/[0.08] dark:hover:text-gray-200",er),whileHover:ee,whileTap:{scale:.92},transition:$,children:[(0,r.jsx)(R.PanelToggle,{className:"h-5 w-5"}),ep&&(0,r.jsx)(eg,{label:"Expand sidebar"})]})]}),(0,r.jsx)("nav",{className:(0,v.cn)("w-full flex-1 overflow-y-auto scroll-smooth px-2 py-1","[scrollbar-width:thin]","[scrollbar-color:rgba(0,0,0,0.14)_transparent]","dark:[scrollbar-color:rgba(255,255,255,0.18)_transparent]","[&::-webkit-scrollbar]:w-1.5","[&::-webkit-scrollbar-track]:bg-transparent","[&::-webkit-scrollbar-thumb]:rounded-full","[&::-webkit-scrollbar-thumb]:bg-gray-900/15 dark:[&::-webkit-scrollbar-thumb]:bg-white/20","[&::-webkit-scrollbar-thumb]:hover:bg-gray-900/25 dark:[&::-webkit-scrollbar-thumb]:hover:bg-white/30"),children:(0,r.jsxs)("div",{className:"flex h-full flex-col",children:[(0,r.jsx)("ul",{className:"space-y-1",children:eL.map(e=>{let t=e.isDrawer?D===e.drawerId:em(y,e.href,!0);return(0,r.jsx)("li",{children:(0,r.jsx)(ey,{item:e,isActive:t,user:_,isCollapsed:ep,onClick:e.isDrawer?()=>eC(e.drawerId):void 0})},e.name)})}),(0,r.jsxs)("section",{"aria-labelledby":"sidenav-workspace-heading",className:"mt-3",children:[(0,r.jsx)(ef,{isCollapsed:ep}),(0,r.jsx)("p",{id:"sidenav-workspace-heading",className:(0,v.cn)("px-4 pb-1 pt-3 text-gray-500 dark:text-gray-400",ei,ep&&"sr-only"),children:"Worksp
1ace"}),(0,r.jsx)("ul",{className:(0,v.cn)("space-y-1",ep&&"pt-3"),children:eS.map(e=>{let t=e.premiumFeature,a=!e.isLocked&&em(y,e.href);return(0,r.jsx)("li",{children:(0,r.jsx)(ey,{item:e,isActive:a,user:_,isCollapsed:ep,onClick:e.isLocked&&t?()=>Y(t):void 0})},e.name)})})]}),(0,r.jsxs)("ul",{className:"mt-4 space-y-1",children:[ez.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(ey,{item:e,isActive:em(y,e.href),user:_,isCollapsed:ep})},e.name)),(0,r.jsx)("li",{children:(0,r.jsx)(ey,{item:eh,isActive:"more"===D,user:_,isCollapsed:ep,onClick:()=>eC("more")})})]}),(0,r.jsx)("div",{className:(0,v.cn)("mt-5",ep&&"flex justify-center"),children:ep?(0,r.jsx)(n.E.div,{whileHover:{scale:1.06},whileTap:{scale:.94},transition:$,children:(0,r.jsxs)(o.default,{href:M,"aria-label":"Create Community",className:(0,v.cn)("group relative flex items-center justify-center rounded-full",U,"bg-brand text-brand-foreground","shadow-[inset_0_1px_0_rgba(255,255,255,0.16),0_6px_18px_-6px_hsl(var(--brand)/0.55)]","transition-[background-color,box-shadow] duration-200 ease-emphasized","hover:bg-brand-emphasis hover:shadow-[inset_0_1px_0_rgba(255,255,255,0.16),0_10px_26px_-6px_hsl(var(--brand)/0.65)]",er),children:[(0,r.jsx)(R.Create,{filled:!0,className:"h-[26px] w-[26px]"}),(0,r.jsx)(eg,{label:"Create Community"})]})}):(0,r.jsx)(n.E.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:$,children:(0,r.jsx)(o.default,{href:M,"aria-label":"Create Community",className:(0,v.cn)("flex min-h-[52px] w-full items-center justify-center whitespace-nowrap rounded-full px-4","bg-brand text-[17px] font-bold text-brand-foreground","shadow-[inset_0_1px_0_rgba(255,255,255,0.16),0_6px_18px_-6px_hsl(var(--brand)/0.55)]","transition-[background-color,box-shadow] duration-200 ease-emphasized","hover:bg-brand-emphasis hover:shadow-[inset_0_1px_0_rgba(255,255,255,0.16),0_10px_26px_-6px_hsl(var(--brand)/0.65)]",er),children:"Create Community"})})}),!I&&A.length>0&&(0,r.jsxs)(n.E.section,{"aria-labelledby":"sidenav-communities-heading",className:"mt-5",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:.1},children:[(0,r.jsx)(ef,{isCollapsed:ep}),(0,r.jsx)("p",{id:"sidenav-communities-heading",className:(0,v.cn)("px-4 pb-2 pt-4 text-gray-500 dark:text-gray-400",ei,ep&&"sr-only"),children:"Your communities"}),(0,r.jsxs)("ul",{className:(0,v.cn)(ep?"space-y-1 pt-3":"space-y-0.5"),children:[(0,r.jsx)(s.M,{initial:!1,children:eV.map(e=>{let t=e.slug?"/".concat(e.slug):"",a="/community/".concat(e.community_id),n=t&&(y===t||y.startsWith("".concat(t,"/")))||y===a||y.startsWith("".concat(a,"/"));return(0,r.jsx)(eb,{community:e,isActive:n,href:t||a,onClick:()=>eN(e),isCollapsed:ep},e.community_id)})}),eT>0||T?(0,r.jsx)("li",{children:(0,r.jsxs)(n.E.button,{type:"button",onClick:()=>H(e=>!e),"aria-expanded":T,"aria-label":T?"Show fewer communities":"Show all ".concat(A.length," communities"),className:(0,v.cn)("group relative flex items-center rounded-full","transition-colors duration-150 ease-emphasized",et,er,ep?(0,v.cn)("mx-auto justify-center",U):"mt-1 w-full gap-3 px-3 py-2.5"),whileTap:Q,transition:$,children:[(0,r.jsx)("span",{className:(0,v.cn)("flex h-8 w-8 shrink-0 items-center justify-center rounded-full","bg-gray-100 text-[13px] font-semibold text-gray-600","dark:bg-white/10 dark:text-gray-300","transition-transform duration-200 ease-emphasized","group-hover:scale-105 group-focus-visible:scale-105","motion-reduce:transform-none"),children:T?(0,r.jsx)(n.E.span,{className:"flex",animate:{rotate:180},transition:J,children:(0,r.jsx)(R.ChevronDown,{className:"h-4 w-4"})}):"+".concat(eT)}),!ep&&(0,r.jsx)("span",{className:"text-[14px] font-medium text-gray-900 dark:text-gray-50",children:T?"Show less":"View all ".concat(A.length)}),ep&&(0,r.jsx)(eg,{label:T?"Show less":"View all ".concat(A.length)})]})}):null]})]}),(0,r.jsx)("div",{className:"flex-1"})]})}),(0,r.jsxs)(n.E.div,{className:(0,v.cn)("w-full pb-3 pt-2",ep?"flex justify-center px-2":"px-2"),initial:!1,animate:{opacity:1},transition:{duration:.2},children:[(0,r.jsx)(eW,{user:_,isCollapsed:ep,onClick:()=>eC("more")}),!ep&&(0,r.jsxs)("p",{className:(0,v.cn)("select-none px-4 pt-2 text-gray-400 dark:text-gray-500","text-[12px] leading-4"),children:["\xa9 ",F," Instaloops"]})]})]})}),(0,r.jsx)(s.M,{children:D&&(0,r.jsx)(n.E.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 z-10 bg-black/20 dark:bg-black/50",onClick:e_,"aria-hidden":"true"})}),(0,r.jsx)(eB,{isOpen:"notifications"===D,onClose:e_,panelId:eu("notifications"),sidenavWidth:ev,label:"Notifications",children:"notifications"===D&&(0,r.jsx)(eE,{onClose:e_})}),(0,r.jsx)(eB,{isOpen:"messages"===D,onClose:e_,panelId:eu("messages"),sidenavWidth:ev,label:"Messages",children:"messages"===D&&(0,r.jsx)(eM,{onClose:e_})}),(0,r.jsx)(eB,{isOpen:"bookmarks"===D,onClose:e_,panelId:eu("bookmarks"),sidenavWidth:ev,label:"Bookmarks",children:"bookmarks"===D&&(0,r.jsx)(eA,{onClose:e_})}),(0,r.jsx)(eB,{isOpen:"more"===D,onClose:e_,panelId:eu("more"),sidenavWidth:ev,label:"More",children:"more"===D&&(0,r.jsx)(eI,{onClose:e_,handleLogout:u,isLogoutPending:m,onCreatePost:()=>X(!0)})}),(0,r.jsx)(g.Vq,{open:K,onOpenChange:X,children:(0,r.jsxs)(g.cZ,{className:"max-w-[600px] gap-0 overflow-hidden rounded-xl border-0 bg-white p-0 [&>button:last-child]:hidden",children:[(0,r.jsx)(f.T,{children:(0,r.jsx)(g.$N,{children:"New post"})}),(0,r.jsx)(x.Z,{onClose:()=>X(!1)})]})}),(0,r.jsx)(z,{feature:G,onClose:()=>Y(null),source:"sidenav"})]})});eV.displayName="DesktopSideNav";var eT=eV},94011:function(e,t,a){a.d(t,{$4:function(){return n},$l:function(){return d},RT:function(){return c},jh:function(){return o}});let r=e=>"string"==typeof e&&e.length>0?e:void 0,n=e=>e&&("".concat(e.first_name||""," ").concat(e.last_name||"").trim()||e.user_name)||"",s=e=>(null==e?void 0:e.user_id)||(null==e?void 0:e.id)||n(e)||"",i=e=>{let t=e.metadata||{},a=e.notification_type||"unknown",n=r(t.conversation_id);if(n)return"".concat(a,":conversation:").concat(n);let s=r(t.room_id);if(s)return"".concat(a,":room:").concat(s);let i=r(t.post_id)||("post"===e.entity_type?r(e.entity_id):void 0);return i?"".concat(a,":post:").concat(i):"follow"===a?"follow:new":"".concat(a,":single:").concat(e.id)},o=e=>{let t=e.message||e.title||"",a=n(e.actor);return a&&t.toLowerCase().startsWith(a.toLowerCase())?t.slice(a.length).trimStart():t},l={like:"liked your post",comment_like:"liked your comment",follow:"started following you",comment:"commented on your post",reply:"replied to you",post:"shared new posts",repost:"reposted your post",mention:"mentioned you",message:"sent you messages",message_reaction:"reacted to your message",community_chat:"posted in the chat",announcement:"posted an announcement",ai_service_alert:"reported a service problem"},c=e=>{let t=e.actors.map(n).filter(Boolean),a=l[e.latest.notification_type]||"sent you notifications";if(0===t.length)return"".concat(e.items.length," new ").concat(1===e.items.length?"update":"updates");if(1===t.length)return"".concat(t[0]," ").concat(a);if(2===t.length)return"".concat(t[0]," and ").concat(t[1]," ").concat(a);let r=t.length-2;return"".concat(t[0],", ").concat(t[1]," and ").concat(r," ").concat(1===r?"other":"others"," ").concat(a)};function d(e){let t=new Map;for(let a of e){let e=i(a),r=t.get(e);if(!r){t.set(e,{key:e,latest:a,items:[a],actors:a.actor?[a.actor]:[],unreadCount:a.is_read?0:1});continue}r.items.push(a),a.is_read||(r.unreadCount+=1),new Date(a.created_at).getTime()>new Date(r.latest.created_at).getTime()&&(r.latest=a);let n=s(a.actor);n&&!r.actors.some(e=>s(e)===n)&&r.actors.push(a.actor)}return Array.from(t.values()).sort((e,t)=>new Date(t.latest.created_at).getTime()-new Date(e.latest.created_at).getTime())}},26016:function(e,t,a){a.d(t,{T:function(){return n}});let r=e=>"string"==typeof e&&e.length>0?e:void 0;function n(e){let t=e.metadata||{},a=r(t.conversation_id);if(a)return"/community/chat?id=".concat(encodeURIComponent(a));let n=r(e.community_id)||r(t.community_id),s=r(t.room_id);if(n&&s)return"/chats?tab=community&community=".concat(encodeURIComponent(n),"&room=").concat(encodeURIComponent(s));let i=r(t.post_id)||("post"===e.entity_type?r(e.entity_id):void 0);if(i)return"/post/".concat(encodeURIComponent(i));if("user"===e.entity_type){let e=r(t.actor_user_name);if(e)return"/profile/".concat(encodeURIComponent(e.replace(/^@/,"")))}return null}}}]);
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.