1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[96900],{265:(e,t,r)=>{r.d(t,{default:()=>h});var s=r(95155),a=r(58276),n=r(41641),i=r(33210),l=r(98500),o=r.n(l),c=r(12115),d=r(80642),u=r(67192);let m="/Logos/slive-simbolo.svg",x=e=>{e.currentTarget.src.endsWith(m)||(e.currentTarget.onerror=null,e.currentTarget.src=m)},h=({smartMenu:e,menuCategory:t})=>{let[r,l]=(0,c.useState)(!1),h=(0,c.useRef)(null),p=()=>l(!1);(0,c.useEffect)(()=>{let e=e=>{h.current&&!h.current.contains(e.target)&&p()};return r&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[r]);let f=({item:e})=>{if("folder"===e.type)return(0,s.jsx)("div",{className:"grid h-14 w-14 grid-cols-2 grid-rows-2 gap-[3px] p-0.5",children:e.items?.slice(0,4).map(e=>(0,s.jsx)("img",{src:e.iconURL||m,onError:x,alt:e.name,className:"h-full w-full object-contain object-center"},e.id))});let t=e.url||"",r=t.startsWith("/")||t.startsWith("http")?t:`/${t}`;return(0,s.jsx)(o(),{href:r,"aria-label":e.name,children:(0,s.jsx)("img",{src:e.iconURL||m,onError:x,alt:e.name,draggable:!1,className:"h-14 w-14 object-contain object-center"})})},g=({items:e})=>(0,s.jsx)("div",{className:"grid grid-cols-3 gap-x-1 gap-y-4",children:e.map((e,t)=>(0,s.jsxs)("div",{onClick:p,className:"flex cursor-pointer flex-col items-center gap-1.5 rounded-2xl py-1 transition-transform active:scale-95",children:[(0,s.jsx)(f,{item:e}),(0,s.jsx)("span",{className:"line-clamp-2 text-center text-xs font-semibold leading-tight text-foreground/85",children:e.name})]},t))});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.N,{children:!r&&(0,s.jsx)(u.P.div,{className:"fixed right-0 top-32 z-[500]",initial:{x:"60%"},animate:{x:0},exit:{x:"100%"},transition:{duration:.3},children:(0,s.jsx)("button",{onClick:()=>l(!0),"aria-label":"Abrir aplicaciones",className:"liquid-glass relative flex h-16 items-center overflow-hidden rounded-l-2xl rounded-r-none px-2 transition-transform hover:scale-105",children:(0,s.jsx)(n.A,{className:"relative z-10 h-7 w-7 text-foreground/80"})})})}),(0,s.jsx)(d.N,{children:r&&(0,s.jsx)(u.P.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},onClick:p,"aria-hidden":!0,className:"fixed inset-0 z-[499] bg-slate-900/40 md:hidden"},"smart-menu-scrim")}),(0,s.jsx)(d.N,{children:r&&(0,s.jsxs)(u.P.aside,{ref:h,initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",stiffness:260,damping:30},className:"fixed right-0 top-0 z-[500] flex h-full w-[80vw] max-w-sm flex-col overflow-hidden rounded-l-3xl bg-card/95 md:hidden",children:[(0,s.jsx)("div",{className:"liquid-glass pointer-events-none absolute inset-0 rounded-l-3xl","aria-hidden":!0}),(0,s.jsxs)("div",{className:"relative z-10 flex items-center justify-between px-5 pb-3 pt-5",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:"Aplicaciones"}),(0,s.jsx)("button",{onClick:p,"aria-label":"Cerrar",className:"flex h-9 w-9 items-center justify-center rounded-full bg-foreground/10 text-foreground/80 transition-colors hover:bg-foreground/20",children:(0,s.jsx)(i.A,{className:"h-5 w-5"})})]}),(0,s.jsxs)(a.ScrollArea,{className:"relative z-10 flex-1 px-4 pb-6 font-sans",children:[t&&t.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(g,{items:t}
1),(0,s.jsx)("div",{className:"my-4 h-px bg-foreground/20"})]}),e&&e.length>0&&(0,s.jsx)(g,{items:e})]})]})})]})}},4369:(e,t,r)=>{r.d(t,{Y:()=>l});var s=r(85705),a=r(35625),n=r(12115),i=r(51738);let l=({currentUser:e})=>{let{socket:t,isConnected:r}=(0,s.F)(),l=(0,a.jE)(),[o,c]=(0,n.useState)(0),{refetch:d}=(0,i.j)({currentUser:e,isRead:!0}),u=(e,t)=>{l.setQueryData(e,e=>{if(!e||!e.pages||0===e.pages.length)return{pages:[{notifications:[t]}]};let r=[...e.pages];return r[0]={...r[0],notifications:[t,...r[0].notifications]},{...e,pages:r}})};return(0,n.useEffect)(()=>{if(t)return t.on("notification",async e=>{c(e=>e+1),"like"===e.socialType||"comment"===e.socialType?u(["socialNotifications"],e):u(["notifications",{isRead:!0}],e),await d()}),()=>{t.off("notification")}},[t,d]),{notificationCount:o}}},8221:(e,t,r)=>{r.d(t,{A:()=>m});var s=r(95155),a=r(57795),n=r(33679),i=r(42876),l=r(96006),o=r(85328),c=r(86190),d=r(37882);let u=(e,t,r)=>e?t?.name:r.name,m=({chat:e,handleChatClose:t,isOrganization:r=!1,className:m})=>{let{data:x}=(0,d.useSession)(),h=e?.type,p="private-chat"===h;if(e&&x){let d;if("space-chat"===h)return(0,s.jsx)("section",{className:"flex flex-col flex-1 h-full",children:(0,s.jsx)(o.default,{currentUser:x.user,groupId:e.id,handleChatClose:t,previewType:h,headerClasses:(0,c.cn)("sticky top-0 z-[20] bg-background",m)})});let f=(d=e?.participants.find(e=>e.user.id!==x.user.id)?.user,e?.type==="private-chat"?d||x.user:null),g=u(p,f,e),v=p?f?.profilePicture:e.imageUrl,j=u(p,f,e),b={currentUser:x,receiverId:p?f.id:null,chatId:e.id,type:p?"privateChat":"topicChat"};return(0,s.jsxs)("section",{className:"flex flex-col flex-1 h-full",children:[(0,s.jsx)(n.yX,{title:g,imageUrl:v,altText:j,handleChatClose:t,classes:(0,c.cn)("sticky top-0 z-[20] bg-background",m),type:h,chatId:f?f.id:e.id,subtitle:p?(0,s.jsx)(l.default,{userId:f.id,currentUser:x}):null}),(0,s.jsx)(a.default,{currentUser:x.user,chatId:e.id,receiver:f,isGroupChat:!p,isPreview:!0},p?"private":"group"),(0,s.jsx)(i.default,{...b,isOrganization:r})]})}}},9791:(e,t,r)=>{r.d(t,{E:()=>o,U:()=>c});var s=r(95155),a=r(49619),n=r(99428),i=r(32656),l=r(86190);function o(e){return e===i.H5.ERROR?"bg-destructive-tint text-foreground chat-edge border-l-2 border-l-destructive":e===i.H5.NOTICE?"bg-info-tint text-foreground chat-edge border-l-2 border-l-info":"chat-agent-surface text-foreground chat-edge border-l-2 border-l-primary"}let c=({isAstro:e,className:t,markClassName:r})=>(0,s.jsx)("span",{className:(0,l.cn)("flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-primary-100",t),children:e?(0,s.jsx)(n.A,{className:(0,l.cn)("h-3.5 w-3.5",r)}):(0,s.jsx)(a.A,{size:12,"aria-hidden":"true",className:(0,l.cn)("text-primary",r)})})},11317:(e,t,r)=>{r.d(t,{N:()=>a});var s=r(9339);let a=(0,s.createServerReference)("00cbf4306659aa4db8118a9145fb1125041fc2e6a8",s.callServer,void 0,s.findSourceMapURL,"getOrganizationByOwnerId")},13939:(e,t,r)=>{r.d(t,{S:()=>a});var s=r(12115);let a=(e="search")=>{let[t,r]=(0,s.useState)(""),[a,n]=(0,s.useState)(!1),[i,l]=(0,s.useState)(null),[o,c]=(0,s.useState)(!1),d=(0,s.useRef)(null),u=()=>{n(!1)};return(0,s.useEffect)(()=>{let e=e=>{d.current&&!d.current.contains(e.target)&&u()};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}},[a]),(0,s.useEffect)(()=>{if(t.length<2){l(null),c(!1);return}c(!0);let e=new AbortController,r=setTimeout(async()=>{try{let r=await fetch(`/api/search?keyword=${encodeURIComponent(t)}`,{signal:e.signal}),s=await r.json();e.signal.aborted||l(s?.Data??null)}catch(e){"AbortError"!==e.name&&console.error("Search error:",e)}finally{e.signal.aborted||c(!1)}},200);return()=>{e.abort(),clearTimeout(r)}},[t]),{query:t,setQuery:r,isSearchFocus:a,setIsSearchFocus:n,results:i,isLoading:o,resetSearch:u,searchBarRef:d}}},16376:(e,t,r)=>{r.d(t,{QueryProvider:()=>l});var s=r(95155),a=r(26430),n=r(35625),i=r(12115);let l=({children:e})=>{let[t]=(0,i.useState)(()=>new a.E);return(0,s.jsx)(n.Ht,{client:t,children:e})}},23910:(e,t,r)=>{r.d(t,{A:()=>g});var s=r(95155),a=r(12115),n=r(73321),i=r(11697),l=r(50910),o=r(37882),c=r(2614),d=r(1852),u=r(66162),m=r(68189),x=r(42067),h=r(1445),p=r(75823),f=r(86190);function g({onReserved:e,className:t}){let r=(0,n.useRouter)(),v=(0,i.Ym)(),{update:j}=(0,o.useSession)(),b=(0,l.c)("registration.organizationSize"),N="organization-user-count",[w,y]=(0,a.useState)(String(u.HG)),S=(0,a.useRef)(!1),[E,A]=(0,a.useState)(!1),[C,T]=(0,a.useState)(u.HG),k=(0,a.useRef)(null),I=(0,a.useRef)(!0);(0,a.useEffect)(()=>{I.current=!0;let e=(0,u.Oz)();return k.current=e,e.then(e=>{I.current&&(T(e.minimumSeats),S.current||y(String(e.minimumSeats)))}),()=>
1{I.current=!1}},[]);let L=Number(w),R=""!==w.trim()&&Number.isFinite(L),P=R&&L<C,O=R&&L>u.kk,z=R&&!P&&!O,_=null;P?_=b("minError",{count:C}):O&&(_=b("maxError",{count:u.kk}));let U=async()=>{if(z&&!E)try{A(!0);let t=await (0,u.Zj)({users:Math.round(L),locale:v,update:j,offer:k.current});if(!t.ok)return void c.toast.error(t.message||b("reserveError"));"function"==typeof e&&e(),r.replace(t.path)}catch(e){if(await (0,d.LO)(e))return;c.toast.error(e?.message||b("reserveError"))}finally{I.current&&A(!1)}};return(0,s.jsxs)("div",{className:(0,f.cn)("mx-auto flex w-full max-w-[480px] flex-col gap-7",t),children:[(0,s.jsxs)("header",{className:"text-center",children:[(0,s.jsx)("h1",{className:"m-0 text-[28px] font-extrabold tracking-tight text-foreground",children:b("title")}),(0,s.jsx)("p",{className:"m-0 mx-auto mt-2 max-w-[46ch] text-[15px] text-muted-foreground",children:b("subtitle")})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)(h.J,{htmlFor:N,children:b("fieldLabel")}),(0,s.jsx)(x.Input,{id:N,type:"number",inputMode:"numeric",min:C,max:u.kk,value:w,onChange:e=>{S.current=!0,y(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),U())},placeholder:b("placeholder",{count:C}),className:"text-lg font-semibold",disabled:E,autoFocus:!0}),_?(0,s.jsx)("p",{className:"text-sm font-semibold text-destructive",children:_}):(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:b("note",{count:C})})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)(m.Button,{type:"button",size:"lg",className:"w-full",disabled:!z||E,onClick:U,children:E?(0,s.jsx)(p.k,{className:"h-5 w-5 text-primary-foreground"}):b("ctaContinue")}),E&&(0,s.jsx)("span",{"aria-live":"polite",className:"text-center text-[12.5px] text-muted-foreground",children:b("redirecting")})]})]})}},34623:(e,t,r)=>{r.d(t,{A:()=>g});var s=r(95155),a=r(68189),n=r(6071),i=r(89626),l=r(80723),o=r(73321),c=r(33810),d=r(50910),u=r(86190),m=r(8151),x=r(44018),h=r(12115),p=r(68989);let f=({side:e="top"})=>{let{showAppNav:t,setShowAppNav:r}=(0,x.o)(),l=(0,d.c)("SHARED")(t?"HIDE_PANEL":"SHOW_PANEL");return(0,s.jsx)(c.TooltipProvider,{children:(0,s.jsxs)(c.Tooltip,{children:[(0,s.jsx)(c.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(a.Button,{variant:"ghost",size:"icon",onClick:()=>{r(e=>!e)},"aria-label":l,"aria-expanded":t,className:(0,u.cn)("bg-transparent text-primary hover:bg-muted hover:text-primary rounded-xl",{"cursor-w-resize":t,"cursor-e-resize":!t}),children:t?(0,s.jsx)(n.A,{}):(0,s.jsx)(i.A,{})})}),(0,s.jsx)(c.TooltipContent,{side:e,children:(0,s.jsx)("p",{children:l})})]})})},g=({side:e="top",className:t,backUrl:r=null,isGlobal:n=!1,collapsibleChatList:i=!1})=>{let x=(0,m.Rg)((0,o.usePathname)()),g=(0,o.useRouter)(),v=(0,d.c)("SHARED"),[j,b]=(0,h.useState)(!1);(0,h.useEffect)(()=>{(async()=>{let e=x.split("/"),t=e.length>1?e[2]:"";if(t){let e=await (0,p.z)(t);b(e?.length>0)}})()},[x]);let N=x.startsWith("/apps/"),w="/chat"===x||x.startsWith("/chat/");return n&&(N&&j||i&&w)?(0,s.jsx)(f,{side:e}):(0,s.jsx)(c.TooltipProvider,{children:(0,s.jsxs)(c.Tooltip,{children:[(0,s.jsx)(c.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(a.Button,{onClick:()=>{r?g.push(r):g.back()},type:"button",variant:"ghost",size:"icon",className:(0,u.cn)("bg-transparent text-primary hover:bg-muted hover:text-primary rounded-xl",t),children:(0,s.jsx)(l.A,{})})}),(0,s.jsx)(c.TooltipContent,{side:e,children:(0,s.jsx)("p",{children:v("BACK")})})]})})}},34680:(e,t,r)=>{r.d(t,{A:()=>Z});var s=r(95155),a=r(51738),n=r(4369),i=r(8151),l=r(16639),o=r(73321),c=r(12115),d=r(8221),u=r(9339);let m=(0,u.createServerReference)("40603d29af79981ec19e6d9f45efe326ab5f8b195b",u.callServer,void 0,u.findSourceMapURL,"UpdateNotificationStatus");var x=r(35625),h=r(20740),p=r(96271);function f(e){return e?.type===p.ZQ.SPACE||e?.type===p.ZQ.TOPIC}var g=r(68189),v=r(57657),j=r(95106),b=r(33810),N=r(96205),w=r(33969),y=r(94938),S=r(72034),E=r(71524),A=r(7964),C=r(60285),T=r(2614),k=r(11697),I=r(50910),L=r(49651),R=r(42876);let P=({notification:e,setOpenModal:t})=>{let[r,a]=(0,c.useState)(null),n=(0,x.jE)();(0,c.useEffect)(()=>{(async()=>{let{user:e}=await (0,L.H)();a(e)})()},[]);let i=async()=>{try{t(!1),await m(e._id),n.invalidateQueries(["notifications"])}catch(e){console.error(e)}};return(0,s.jsxs)(v.DialogContent,{className:"sm:max-w-md bg-background",children:[(0,s.jsx)(B,{notification:e,isPreview:!1}),(0,s.jsx)(R.default,{currentUser:r,receiverId:e.sender.id,type:"quickReply",handleSentMessage:i})]})};var O=r(5772),z=r(99701),_=r(99824),U=r(28169);let M=({options:e})=>(0,s.jsx)(j.DropdownMenuContent,{align:"end",children:e.map((e,t)=>(0,s.jsxs)(j.DropdownMenuItem,{className:"gap-2 items-center",onClick:t=>{t.stopPropagation(),e.onClick(t)},children:[(0,s.jsx)(e.icon,{size:14,className:"text-muted-foreground"}),e.label]},t))}),B=({notification:e,isPreview:t=!1,conversation:r=null,handleChatOpen:a=null,setOpenModal:n=null,handleNavigateToPost:i=null})=>{let{_id:l,content:o,dateSent:d,notificationType:u,sender:h,subject:p,socialType:v="",isRead:S=!1}=e,L=(0,x.jE)(),R=(0,k.Ym)(),P=(0,I.c)("INVITATION_NOTIFICATION"),B=(0,I.c)("MESSAGE_NOTIFICATION"),D=f(r),$=(0,c.useCallback)(async()=>{try{await m(e._id),L.invalidateQueries({queryKey:["notifications"]}),T.toast.success("Notification has been marked as read")}catch(e){console.error(e)}},[e._id,L]),F=(0,c.useCallback)(async(t,r)=>{try{let{Error:t,Message:s}=await (0,w.R)(e.invitationToken,r);await m(e._id),L.invalidateQueries({queryKey:["notifications"]}),t?T.toast.error(s[R]):T.toast.success(0===r?P("ACCEPTED"):P("DECLINED"))}catch(e){console.error(e)}},[e._id,L,R,P]),G=[...D?[]:[{label:B("QUICK_REPLY"),icon:E.A,onClick:()=>n(!0)}],{label:B("MARK_AS_READ"),icon:A.A,onClick:e=>{e.stopPropagation(),$(e)}}],H="message"===u?G:[],V="invitation"===u?e.organization:null,q=(0,c.useCallback)(async()=>
1{if(t&&"message"===u)return void a(r,e,l);if(v&&"notification"===u)return void i(o?.Id||"",l);if("invitation"!==u&&!S)try{await m(l),L.invalidateQueries({queryKey:["notifications"]})}catch(e){console.error(e)}},[t,u,v,a,i,o,l,S,L,r,e]),W=(0,c.useCallback)(e=>{e.stopPropagation(),F(e,0)}),Q=(0,c.useCallback)(e=>{e.stopPropagation(),F(e,1)});return(0,s.jsxs)("div",{className:`bg-muted flex flex-row items-center gap-4 py-2 text-start text-sm rounded-lg relative ${t&&"hover:bg-accent cursor-pointer m-3 p-3"}`,onClick:q,children:[t&&H.length>0&&(0,s.jsx)(b.TooltipProvider,{children:(0,s.jsx)(b.Tooltip,{children:(0,s.jsxs)(j.DropdownMenu,{children:[(0,s.jsx)(b.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(j.DropdownMenuTrigger,{asChild:!0,className:"absolute top-0 right-0 px-2 py-1 text-muted-foreground rounded-full",children:(0,s.jsxs)(g.Button,{variant:"ghost",size:"icon",className:"hover:bg-accent/30",children:[(0,s.jsx)(C.A,{size:20,className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"More"})]})})}),(0,s.jsx)(b.TooltipContent,{side:"bottom",className:"text-xs",children:(0,s.jsx)("p",{children:"Options"})}),(0,s.jsx)(M,{notification:e,setOpenModal:n,options:H})]})})}),v?(0,s.jsx)(y.A,{src:V?V.picture:h.picture,alt:h.name,sx:{width:35,height:35},className:"bg-background",variant:"rounded"}):(0,s.jsx)(z.f,{overlap:"circular",anchorOrigin:{vertical:"top",horizontal:"right"},variant:"dot",invisible:S,children:(0,s.jsx)(y.A,{src:V?V.picture:h.picture,alt:h.name,sx:{width:35,height:35},className:"bg-background",variant:"rounded"})}),(0,s.jsxs)("div",{className:"flex flex-col gap-1 w-4/5",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"font-bold",children:h.name})," ","message"===u?(0,s.jsx)("span",{children:D?B("SENT_IN",{conversation:r?.name??""}):B("SENT_YOU")}):"invitation"===u&&V?(0,s.jsxs)("span",{children:["Invited you to join"," ",(0,s.jsx)("span",{className:"font-bold",children:V.name})," "]}):(0,s.jsx)("span",{children:p})]}),(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:(0,s.jsx)(N.default,{value:d})})]}),(0,s.jsx)("div",{children:"message"===u&&(0,s.jsx)("p",{className:`text-muted-foreground text-sm truncate ${!t&&"bg-muted rounded-lg w-fit p-2"} `,children:"string"==typeof o?(0,_.JJ)((0,U.Qm)(o)):o})}),"invitation"===u&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{className:"text-primary-foreground bg-primary rounded-md px-2 py-1 text-xs",onClick:W,children:"Accept"}),(0,s.jsx)("button",{className:"text-primary border border-primary rounded-md px-2 py-0.5 text-xs",onClick:Q,children:"Decline"})]})]}),v&&(0,s.jsx)(z.f,{overlap:"circular",anchorOrigin:{vertical:"top",horizontal:"right"},variant:"dot",invisible:S,children:o?.ImageUrl&&(0,s.jsx)(O.default,{src:o?.ImageUrl,alt:v,width:55,height:55,className:"rounded-sm"})})]})},D=({notification:e,isSkeleton:t,conversation:r=null,handleChatOpen:a,isPreview:n=!0,handleNavigateToPost:i})=>{if(t)return(0,s.jsxs)("div",{className:"bg-card flex flex-row gap-4 border py-2 text-start text-sm hover:bg-accent cursor-pointer m-3 p-3 rounded-md shadow-md ",children:[(0,s.jsx)("div",{className:"relative",children:(0,s.jsx)(S.A,{variant:"circular",width:40,height:40})}),(0,s.jsxs)("div",{className:"flex flex-col gap-1 w-4/5",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)(S.A,{variant:"text",width:100,height:20}),(0,s.jsx)(S.A,{variant:"text",width:50,height:20})]}),(0,s.jsx)("div",{children:(0,s.jsx)(S.A,{variant:"text",width:200,height:20})})]})]});let[l,o]=(0,c.useState)(!1),{notificationType:d,socialType:u=""}=e;return(0,s.jsxs)(v.Dialog,{open:l,onOpenChange:o,children:[(0,s.jsx)(B,{notification:e,isPreview:n,conversation:r,handleChatOpen:a,setOpenModal:o,handleNavigateToPost:i}),"message"===d&&!f(r)&&(0,s.jsx)(P,{notification:e,setOpenModal:o})]})};var $=r(43629);let F=()=>{let e=(0,I.c)("components.SideMenuNotifications.SideMenuTabs"),t=[{label:e("messages"),value:"notifications"},{label:e("astroSlive"),value:"astro"}];return(0,s.jsx)($.TabsList,{className:"overflow-x-auto overflow-y-hidden bg-white-base",children:t.map(e=>(0,s.jsx)($.TabsTrigger,{value:e.value,className:"notificationTab bg-white-base data-[state=active]:bg-white-base px-0 w-4",children:(0,s.jsx)("p",{className:"max-sm:hidden text-sm ",children:e.label})},e.value))})};var G=r(45105),H=r(44018);let V=({currentUser:e})=>{let[t,r]=(0,c.useState)(!1),{chat:a}=(0,H.o)();return(0,c.useEffect)(()=>{null!==a.chat&&r(a.chat)},[a]),(0,s.jsx)(s.Fragment,{children:t?(0,s.jsx)(d.A,{chat:t,handleChatClose:()=>r(!1)}):(0,s.jsx)("div",{children:(0,s.jsx)(G.A,{currentUser:e,isPreview:!0,handleChatOpen:e=>{r(e)},className:"top-0"})})})};var q=r(33947),W=r(42268),Q=r(37882),K=r(42083);let Y=()=>(0,s.jsxs)("div",{className:"text-center p-10",children:[(0,s.jsx)("p",{className:"font-semibold text-lg",children:"Something went wrong"}),(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:"Please try refreshing the page"}),(0,s.jsx)("button",{className:"text-primary border border-primary rounded-md px-2 py-0.5 text-xs mt-2",onClick:()=>window.location.reload(),children:"Refresh"})]});function X({currentUser:e,allNotifications:t,preview:r}){let[a,n]=(0,c.useState)(null),i=(0,x.jE)(),l=(0,o.useRouter)(),{chats:u}=(0,h.F)({currentUser:e}),f=u?.Data,g=async(t,s,a)=>
1{try{await m(a),i.invalidateQueries({queryKey:["notifications"]})}catch(e){}!r&&t?n(t):l.push(function(e,t,r){if(e)return(0,p.gU)(e,r);let s=t?.sender?.id;return s?`/chat/${s}`:"/chat"}(t,s,e?.id))},v=async(e,t)=>{l.push(`/post/${e}`),await m(t),i.invalidateQueries({queryKey:["notifications"]})};return a?(0,s.jsx)(d.A,{chat:a,handleChatClose:()=>{n(null)}}):(0,s.jsx)("section",{className:"flex flex-col gap-10 items-center text-center p-4",children:(0,s.jsx)("div",{className:"w-full",children:t&&t.length>0?t.map(e=>{let t;return(0,s.jsx)(D,{notification:e,conversation:(t=e?.chatId)?(Array.isArray(f)?f:[]).find(e=>e?.id===t)??null:null,handleChatOpen:"message"===e.notificationType&&g,handleNavigateToPost:v,preview:r},e._id)}):(0,s.jsxs)("div",{className:"p-10",children:[(0,s.jsx)("p",{className:"text-lg font-semibold",children:"No notifications to attend yet."}),(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:"Notifications will appear here when you receive a message or an invitation."})]})})})}let Z=({currentUser:e,preview:t=!1})=>{(0,n.Y)({currentUser:e});let r=(0,o.usePathname)(),d=(0,o.useRouter)(),u="/feed"===(0,i.Rg)(r),m=(0,I.c)("components.SideMenuNotifications.NotificationsBox"),{setShowPanel:x}=(0,H.o)(),{data:h}=(0,Q.useSession)(),[p,f]=(0,c.useState)("notifications"),[v,j]=(0,c.useState)(null);(0,c.useEffect)(()=>{try{let e=sessionStorage.getItem("NB_OPEN_TAB");"astro"===e&&(f("astro"),sessionStorage.removeItem("NB_OPEN_TAB"))}catch{}},[]);let{data:b,status:N}=(0,a.j)({currentUser:e,isRead:!0}),w=(b?.pages?.[0]?.notifications?.filter(Boolean)||[]).slice(0,30);return((0,c.useEffect)(()=>{u&&f("notifications")},[r,u]),t)?(0,s.jsx)(l.tU,{defaultValue:"notifications",children:(0,s.jsxs)("div",{className:"font-sans flex flex-auto flex-col w-full h-full overflow-y-auto custom-scrollbar",children:["pending"===N&&(0,s.jsx)("div",{children:Array.from({length:10},(e,t)=>(0,s.jsx)(D,{isSkeleton:!0},t))}),"error"===N&&(0,s.jsx)(Y,{}),"success"===N&&(0,s.jsx)(X,{currentUser:e,allNotifications:w,preview:!0})]})}):(0,s.jsx)("div",{className:"border border-border h-[80vh] rounded-2xl relative font-sans",children:(0,s.jsxs)(l.tU,{value:p,defaultValue:"notifications",onValueChange:f,className:"flex flex-col h-full overflow-hidden",children:[(0,s.jsxs)("div",{className:"bg-white-base sticky top-0 right-0 rounded-t-2xl px-4 pt-4 h-fit flex flex-col z-[100] gap-4",children:[(0,s.jsx)("h2",{className:"font-sans text-lg font-semibold",children:"New"}),(0,s.jsx)(F,{})]}),(0,s.jsx)(l.av,{value:"notifications",className:"flex-1 overflow-y-auto custom-scrollbar roun
1ded-2xl",children:(0,s.jsx)(V,{currentUser:e})}),(0,s.jsxs)(l.av,{value:"astro",className:"flex-1 overflow-y-auto custom-scrollbar rounded-2xl",children:[(0,s.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between gap-2 border-b border-border bg-white-base px-4 py-2",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:m("scopeHint")}),v&&(0,s.jsxs)(g.Button,{type:"button",variant:"ghost",size:"sm",onClick:()=>{let t=h?.user?.accountSelected??e?.accountSelected,r=(0,K.iG)({accountType:t?.type,subscriptionStatus:h?.subscriptionStatus??h?.user?.subscriptionStatus??t?.subscriptionStatus??null})?K.l$:K.gV,s=v?`${r}?conversationId=${encodeURIComponent(v)}`:r;x?.(!1),d.push(s)},className:"h-7 shrink-0 gap-1 px-2 text-xs text-primary",children:[m("continueInChat"),(0,s.jsx)(W.A,{className:"h-3.5 w-3.5"})]})]}),(0,s.jsx)(q.default,{compact:!0,showAgentPanelToggle:!1,origin:"notificationsBox",setConversationID:j})]})]})})}},38035:(e,t,r)=>{r.d(t,{A:()=>j});var s=r(95155),a=r(8151),n=r(93928),i=r(33790),l=r(80688),o=r(32782),c=r(8292),d=r(31910),u=r(37882),m=r(11697),x=r(50910),h=r(12115),p=r(2614),f=r(9339);let g=(0,f.createServerReference)("7ce3a0fe563138056caf4484244d423e745ce95fe2",f.callServer,void 0,f.findSourceMapURL,"getRoles");var v=r(70733);let j=({BoxSX:e,setOpenModal:t,setIsCreateModal:r,setOrganizationCode:f,organizationCode:j})=>{let[b,N]=(0,h.useState)([]),[w,y]=(0,h.useState)(""),[S,E]=(0,h.useState)(""),[A,C]=(0,h.useState)([]),[T,k]=(0,h.useState)({error:!1,message:""}),I=(0,u.useSession)(),L=(0,m.Ym)(),R=(0,x.c)("MEMBERS"),{user:P}=I.data,O=()=>{r(!0),t(!1),f(null)},z=async()=>{let{accessToken:e}=I.data;try{let t=await (0,n.U)({token:e,body:{emails:A},organizationCode:j,role:w});if(t.Error)throw Error(t.Message[L]);p.toast.success(R("INVITATIONS_SENT")),O()}catch(e){p.toast.error(e.message)}},_=0===A.length||!w,U=async()=>{let{accountSelected:e}=P;try{let{Data:{list:t}}=await g(e.id);N(t)}catch(e){p.toast.error(e.message)}};return(0,h.useEffect)(()=>{U()},[P]),(0,s.jsxs)(l.A,{sx:e,children:[(0,s.jsx)(o.A,{"aria-label":"close",onClick:O,sx:{position:"absolute",top:0,right:0},children:(0,s.jsx)(i.default,{})}),(0,s.jsx)("div",{className:"my-5",children:(0,s.jsx)("h2",{className:"text-3xl font-semibold",children:"Invite Members"})}),(0,s.jsxs)("form",{className:"flex flex-col gap-5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-lg mb-2",children:R("EMAILS")}),(0,s.jsx)("p",{className:"text-gray-1",children:"Enter or paste one or more email addresses, separated by spaces or commas"}),(0,s.jsxs)("div",{className:"my-5",children:[(0,s.jsx)(c.A,{type:"text",placeholder:R("EMAILS_PH"),value:S,onChange:e=>{E(e.target.value),k({error:!1,message:""})},onKeyDown:e=>{if("Enter"===e.key||","===e.key||" "===e.key){var t;e.preventDefault();let r=S.trim();(0,a.B9)(r)?((t=r)&&!A.includes(t)&&C([...A,t]),E("")):k({error:!0,message:R("INVALID_EMAIL")})}},fullWidth:!0}),T.error&&(0,s.jsx)("p",{className:"text-destructive text-sm",children:T.message}),(0,s.jsx)("div",{className:"mt-2 overflow-y-auto max-h-32",children:A.map((e,t)=>(0,s.jsx)(d.A,{label:e,onDelete:()=>{C(A.filter(t=>t!==e))},color:"primary",style:{margin:"5px 4px"}},t))})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-md",children:R("ROLE")}),(0,s.jsxs)(v.l6,{value:w,onValueChange:e=>y(e),children:[(0,s.jsx)(v.bq,{className:"w-[180px]",children:(0,s.jsx)(v.yv,{placeholder:R("FILTERS.ROLE_PH")})}),(0,s.jsx)(v.gC,{className:"z-[1350]",children:(0,s.jsxs)(v.s3,{children:[(0,s.jsx)(v.TR,{children:R("ROLES")}),b.filter(e=>"0"!==String(e.roleId)&&"Owner"!==e.name).map(e=>(0,s.jsx)(v.eb,{value:e.roleId,className:"cursor-pointer",children:e.name},e.roleId))]})})]})]}),(0,s.jsx)("div",{className:"flex items-center justify-end gap-x-6",children:(0,s.jsx)("button",{type:"button",disabled:_,className:`flex items-center justify-center px-4 py-2 text-sm font-semibold leading-6 text-white ${!_?"primary_btn":"bg-muted rounded-lg text-foreground"}`,onClick:z,children:R("SEND_INVITATIONS")})})]})]})}},43887:(e,t,r)=>{r.d(t,{A:()=>a});var s=r(12115);
1let a=function(e,t,r=null){let[a,n]=(0,s.useState)(!0),[i,l]=(0,s.useState)(0),o=(0,s.useRef)(!0),c=(0,s.useRef)(0),d=(0,s.useRef)(!1),u=(0,s.useRef)(r),m=(0,s.useCallback)((t="smooth")=>{let r=e?.current;r&&(r.scrollTo({top:r.scrollHeight,behavior:t}),o.current=!0,n(!0),l(0))},[e]);return(0,s.useEffect)(()=>{let t=e?.current;if(!t)return;let r=()=>{let e=t.scrollHeight-t.scrollTop-t.clientHeight<=24;o.current=e,n(e),e&&l(0)};return r(),t.addEventListener("scroll",r,{passive:!0}),()=>t.removeEventListener("scroll",r)},[e]),(0,s.useEffect)(()=>{u.current!==r&&(u.current=r,d.current=!1,c.current=0,l(0));let s=c.current;if(c.current=t,!d.current&&t>0){if(!e?.current)return;d.current=!0,m("auto");return}if(!(t<=s)){if(o.current)return void m("smooth");l(e=>e+(t-s))}},[t,r,m,e]),{isAtBottom:a,newCount:i,scrollToBottom:m}}},51738:(e,t,r)=>{r.d(t,{j:()=>o});var s=r(36578),a=r(85705),n=r(86570),i=r(25366),l=r(17906);let o=({currentUser:e,isRead:t})=>{let{isConnected:r}=(0,a.F)(),o=(0,n.l)(r),c=async()=>{let r=s.A.stringifyUrl({url:`${l.H$}/socketnotification/notification/${e.email}`,query:{isread:t}},{skipNull:!0}),a=await fetch(r);return await a.json()},{data:d,status:u,refetch:m,fetchNextPage:x,hasNextPage:h,isFetchingNextPage:p}=(0,i.q)({queryKey:["notifications",{isRead:t}],queryFn:c,getNextPageParam:e=>e?.nextCursor,refetchInterval:o});return{data:d,status:u,fetchNextPage:x,hasNextPage:h,isFetchingNextPage:p,refetch:m}}},57795:(e,t,r)=>{r.d(t,{default:()=>b});var s=r(95155),a=r(36578),n=r(85705),i=r(86570),l=r(25366),o=r(17906);let c=({currentUser:e,receiverId:t,chatQueryId:r})=>{let{isChatConnected:s}=(0,n.F)(),c=(0,i.l)(s),d=async()=>{let r=a.A.stringifyUrl({url:`${o.H$}/chats/messages/${t}`},{skipNull:!0});return(await fetch(r,{headers:{Authorization:`Bearer ${e.jwt||e.user.jwt}`}})).json()},{data:u,status:m,fetchNextPage:x,hasNextPage:h,isFetchingNextPage:p}=(0,l.q)({queryKey:[r],queryFn:d,getNextPageParam:e=>e?.nextCursor,refetchInterval:c});return{data:u,status:m,fetchNextPage:x,hasNextPage:h,isFetchingNextPage:p}};var d=r(35625),u=r(12115),m=r(43887),x=r(73144),h=r(50910),p=r(78518),f=r(71485),g=r(52745),v=r(32656),j=r(86190);let b=({currentUser:e,receiver:t,chatId:r,isGroupChat:a=!1})=>{let i=(0,h.c)("applications.chat.pane"),l=a?p.$:c,o=a?{currentUser:e,topicId:r,chatQueryId:`topic-chat-${r}`}:{currentUser:e,receiverId:t?.id,chatQueryId:`private-chat-${r||t?.id}`},{data:b}=l(o),N=(0,d.jE)(),{chatSocket:w}=(0,n.F)(),y=b?.pages?.[0]?.Data?.messages,S=(0,u.useMemo)(()=>(y||[]).filter(e=>e?.deleted!==!0),[y]),E=(0,u.useRef)(null),A=(0,u.useRef)(null),{isAtBottom:C,newCount:T,scrollToBottom:k}=(0,m.A)(A,S.length,o.chatQueryId),I=(0,u.useRef)(null);(0,u.useEffect)(()=>{a&&r&&0!==S.length&&I.current!==r&&(I.current=r,N.invalidateQueries(["notifications"]),N.invalidateQueries(["chats"]))},[a,r,S.length]),(0,u.useEffect)(()=>{let t=S[S.length-1];t&&t?.sender?.id!==e?.id&&!a&&(w?.emit("message-read",{chatId:t?.chatId,senderId:t?.sender?.id,receiverId:t?.receiver?.id}),N.invalidateQueries(["notifications"]),N.invalidateQueries(["chats"]))},[S]);let[L,R]=(0,u.useState)(null),P=(0,u.useRef)(null),O=(0,u.useRef)(null),z=(0,u.useRef)(null),_=(0,u.useRef)(null),U=(0,u.useRef)(null),M=(0,u.useRef)(S);return M.current=S,(0,u.useEffect)(()=>{if(!a||!r)return;let e=e=>{if(String(e?.detail?.chatId??"")===String(r)){var t;P.current=new Set((Array.isArray(t=M.current)?t:[]).filter(e=>(0,v.HC)(e)).map(e=>String(e?.id??""))),z.current&&clearTimeout(z.current),O.current&&clearTimeout(O.current),U.current&&clearTimeout(U.current),U.current=null,_.current=null,z.current=setTimeout(()=>{z.current=null,_.current=Date.now(),R("working")},400),O.current=setTimeout(()=>{O.current=null,R(e=>"working"===e?"timedOut":e)},3e4)}};return window.addEventListener(v.xe,e),()=>{window.removeEventListener(v.xe,e)}},[a,r]),(0,u.useEffect)(()=>{if("working"!==L&&!z.current)return;let e=P.current;if(!e||!S.some(t=>(0,v.HC)(t)&&!e.has(String(t?.id??""))))return;if(O.current&&(clearTimeout(O.current),O.current=null),z.current){clearTimeout(z.current),z.current=null;return}let t=500-(Date.now()-(_.current??0));if(t>0){U.current=setTimeout(()=>{U.current=null,_.current=null,R(null)},t);return}_.current=null,R(null)},[S,L]),(0,u.useEffect)(()=>(R(null),P.current=null,_.current=null,()=>{for(let e of[O,z,U])e.current&&(clearTimeout(e.current),e.current=null)}),[r]),(0,s.jsxs)("div",{className:"relative flex min-h-0 flex-1 flex-col bg-chat-flow chat-grain font-geist",children:[(0,s.jsx)("main",{ref:A,className:(0,j.cn)("flex-1 overflow-auto custom-scrollbar px-4 md:px-8 py-2 pb-20 md:pb-6","relative z-[1] chat-scroll-fade"),children:0!==S.length||L?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(f.A,{messages:S,currentUser:e,type:a?"groupChat":"privateChat",className:"pb-2"}),L&&(0,s.jsx)(g.r4,{state:L}),(0,s.jsx)("div",{ref:E})]}):(0,s.jsxs)("div",{className:"flex h-full flex-col items-center justify-center text-center px-6",children:[(0,s.jsx)("p",{className:"text-base font-semibold text-foreground",children:i("emptyThread.title")}),(0,s.jsx)("p",{className:"mt-1 text-sm text-chat-ink-2",children:i("emptyThread.description")})]})}),(0,s.jsx)(x.A,{visible:!C,count:T,onClick:()=>k()})]})}},62012:(e,t,r)=>{r.r(t),r.d(t,{default:()=>i});var s=r(95155),a=r(12115);let n=["fill","sizes","priority","quality","placeholder","blurDataURL","loader","unoptimized","overrideSrc"],i=e=>{let{src:t,fallbackSrc:r="/Images/placeholder.svg",...i}=e,[l,o]=(0,a.useState)(t);(0,a.useEffect)(()=>{t!==l&&o(t)},[t]);let c={...i};for(let e of n)delete c[e];return(0,s.jsx)("img",{...c,src:l,onError:()=>{o(r)}})}},68989:(e,t,r)=>{r.d(t,{z:()=>a});var s=r(9339);let a=(0,s.createServerReference)("40607bf3288b2702f91725ee5edc0c99a99ae6d8ba",s.callServer,void 0,s.findSourceMapURL,"getNavElements")},72259:(e,t,r)=>{r.d(t,{default:()=>_});
1var s=r(95155),a=r(12115),n=r(73321),i=r(80688),l=r(12502),o=r(17906),c=r(37882),d=r(90795),u=r(76765),m=r(33810),x=r(98500),h=r.n(x),p=r(86190),f=r(50910);let g=({item:e,isActive:t,forceTooltipOpen:r=!1})=>{let a=(0,f.c)("LEFT_SIDE_NAV");return(0,s.jsx)(m.TooltipProvider,{children:(0,s.jsxs)(m.Tooltip,{open:r||void 0,children:[(0,s.jsx)(m.TooltipTrigger,{asChild:!0,children:(0,s.jsxs)(h(),{href:e.href,"aria-label":e.label,"data-tour":e.tourId,"aria-current":t?"page":void 0,className:(0,p.cn)("relative flex h-10 w-10 items-center justify-center rounded-xl transition-colors",t?"bg-primary-100":"hover:bg-muted"),children:[t&&(0,s.jsx)("span",{"aria-hidden":!0,className:"absolute -left-2.5 h-6 w-1 rounded-full bg-primary"}),"stl-icons"===e.icons.source?(0,s.jsx)("img",{src:t?e.icons.active:e.icons.inactive,height:30,alt:`${e.label} icon`,width:30}):t?(0,s.jsx)(e.icons.active,{sx:{color:"hsl(var(--brand))",width:30,height:30}}):(0,s.jsx)(e.icons.inactive,{sx:{color:"hsl(var(--brand))",width:30,height:30}})]})}),(0,s.jsx)(m.TooltipContent,{side:"right",className:"text-sm",children:(0,s.jsxs)("p",{children:[a("NAVIGATE_TO")," ",e.label]})})]})})},v=({item:e,isMobile:t,forceTooltipOpen:r=!1})=>{let a=(0,n.usePathname)().includes(e.href);return t?(0,s.jsx)(u.A,{label:e.label,icon:(0,s.jsx)(g,{item:e,isActive:a,forceTooltipOpen:r})}):(0,s.jsx)(g,{item:e,isActive:a,forceTooltipOpen:r})};var j=r(34623),b=r(68189),N=r(89363);let w=()=>{let e=(0,f.c)("TOP_NAV");return(0,s.jsx)(m.TooltipProvider,{children:(0,s.jsxs)(m.Tooltip,{children:[(0,s.jsx)(m.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(b.Button,{variant:"icon",children:(0,s.jsx)(h(),{href:"/apps/account-settings",children:(0,s.jsx)(N.A,{size:30})})})}),(0,s.jsx)(m.TooltipContent,{side:"right",className:"text-sm",children:(0,s.jsx)("p",{children:e("SETTINGS")})})]})})};r(5772);var y=r(14210),S=r(7890),E=r(80642),A=r(67192);let C=e=>{if(!e)return!1;let t=e.split("?")[0].split("/").filter(Boolean);if(t.includes("onboarding"))return!0;let r=t.indexOf("chat");return -1!==r&&"member-onboarding"!==t[r+1]&&t.length>r+1},T=({Button:e,forceTooltipOpen:t=!1})=>{let r=(0,n.usePathname)(),a=(0,f.c)("LEFT_SIDE_NAV"),i=r.includes(e.href);return(0,s.jsx)(m.TooltipProvider,{children:(0,s.jsxs)(m.Tooltip,{open:t||void 0,children:[(0,s.jsx)(m.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(h(),{href:e.href,"aria-label":e.label,"data-tour":e.tourId,children:(0,s.jsxs)("div",{className:(0,p.cn)("flex items-center space-x-2 p-1.5 rounded-lg"),children:["stl-icons"===e.icons.source?(0,s.jsx)("img",{src:i?e.icons.active:e.icons.inactive,height:28,alt:`${e.label} icon`,width:28}):i?(0,s.jsx)(e.icons.active,{sx:{color:"hsl(var(--brand))",width:28,height:28}}):(0,s.jsx)(e.icons.inactive,{sx:{color:"hsl(var(--brand))",width:28,height:28}}),i&&(0,s.jsx)("p",{className:"text-md font-semibold text-primary",children:e.label})]})})}),(0,s.jsx)(m.TooltipContent,{side:"top",className:"text-sm",children:(0,s.jsxs)("p",{children:[a("NAVIGATE_TO")," ",e.label]})})]})})},k=({AppsToShow:e,BusinessSpace:t,type:r,activeTooltipIndex:i=-1})=>{let{scrollYProgress:l}=(0,y.L)(),o=(0,f.c)("TOP_NAV"),[c,d]=(0,a.useState)(!0),u=(0,n.usePathname)(),m=a.useMemo(()=>C(u),[u]);return((0,S.L)(l,"change",e=>{if(!m&&"number"==typeof e){let t=e-l.getPrevious();0===l.get()||1===t||t<0?d(!0):d(!1)}}),m)?null:(0,s.jsx)(E.N,{mode:"wait",children:(0,s.jsxs)(A.P.div,{initial:{opacity:1,y:100},animate:{y:100*!c,opacity:+!!c},transition:{duration:.2},className:"fixed bottom-2 left-5 right-5 w-auto text-center py-1 rounded-xl z-10 flex flex-col items-center justify-evenly bottonNav-glassmorphism font-sans",children:["personal"!==r&&(0,s.jsxs)("p",{className:"text-xs font-bold text-primary p-0.5",children:[o("WORKING_IN"),": ",t]}),(0,s.jsx)("div",{className:"flex items-center justify-evenly w-full",children:e.map((e,t)=>(0,s.jsx)(T,{Button:e,forceTooltipOpen:i===t},e.id))})]})})};var I=r(42083);let L=null,R=null,P=async()=>{let e=window.AudioContext||window.webkitAudioContext;if(!e)return null;if(L||(L=new e),"suspended"===L.state)try{await L.resume()}catch(e){}return L},O=async(e,t)=>{if(R)return R;let r=await fetch(t,{cache:"force-cache"}),s=await r.arrayBuffer();return R=await new Promise(function(t,r){e.decodeAudioData(s,t,r)})},z=async()=>{let e="/Assets/audio/tuqueque.wav";try{let t=await P();if(!t){let t=new Audio(e);t.volume=.25;try{await t.play()}catch(e){}return}let r=await O(t,e),s=t.createBufferSource();s.buffer=r;let a=t.createGain();a.gain.value=.25,s.connect(a).connect(t.destination),s.start(0)}catch(e){console.warn("Audio playback failed:",e)}},_=({accountSelected:e})=>{let{type:t="personal",name:r="",subscriptionStatus:u=null}=e,{data:m}=(0,c.useSession)(),x=m?.subscriptionStatus??m?.user?.subscriptionStatus??m?.user?.accountSelected?.subscriptionStatus??null??u,h="PENDING_PAYMENT"===x||"PAYMENT_FAILED"===x,[p,f]=(0,a.useState)(-1),[g,b]=(0,a.useState)(!1),N=(0,d.A)("(min-width: 900px)"),y=C((0,n.usePathname)()),S=(0,a.useRef)(!1),E=(0,I.iG)({accountType:t,subscriptionStatus:x}),A=[{id:3,label:"Apps",tourId:"nav-apps",href:"/apps",icons:{active:"/Icons/MenuFilledIcon.svg",inactive:"/Icons/MenuIcon.svg",source:"stl-icons"}},{id:4,label:"Chat",href:"/chat",icons:{active:"/Icons/icon_chat_active.svg",inactive:"/Icons/icon_chat.svg",source:"stl-icons"}},{id:5,label:"Astro Slive",tourId:"nav-astro",href:E?I.l$:I.gV,icons:{active:"/Icons/icon_astro_active.svg",inactive:"/Icons/icon_astro.svg",source:"stl-icons"}}].filter(e=>(!E||4!==e.id)&&(h?4===e.id:"personal"===t?3!==e.id&&2!==e.id&&5!==e.id:0!==e.id));return(0,a.useEffect)(()=>
1{if(S.current||localStorage.getItem("sidenav-tooltip-tour-seen")||!N&&y)return;let e=setTimeout(()=>{S.current=!0,b(!0),f(0),z()},500);return()=>clearTimeout(e)},[N,y]),(0,a.useEffect)(()=>{let e=async()=>{let t=await P();try{await t?.resume?.()}catch(e){}window.removeEventListener("pointerdown",e),window.removeEventListener("keydown",e)};return window.addEventListener("pointerdown",e,{once:!0}),window.addEventListener("keydown",e,{once:!0}),()=>{window.removeEventListener("pointerdown",e),window.removeEventListener("keydown",e)}},[]),(0,a.useEffect)(()=>{if(g&&p>=0&&p<A.length){let e=setTimeout(()=>{let e=p+1;e<A.length?(f(e),z()):(f(-1),b(!1),localStorage.setItem("sidenav-tooltip-tour-seen","true"))},1e3);return()=>clearTimeout(e)}},[p,g,A.length]),(0,s.jsxs)("div",{className:"relative z-50",children:[(0,s.jsx)(i.A,{sx:o.HH,children:(0,s.jsx)(k,{AppsToShow:A,BusinessSpace:r,type:t,activeTooltipIndex:!N&&g?p:-1})}),(0,s.jsx)(i.A,{sx:{...o.LV},children:(0,s.jsx)(l.Ay,{sx:{flexShrink:0,"& .MuiDrawer-paper":{width:64,boxSizing:"border-box",overflowX:"hidden",justifyContent:"space-between",zIndex:40,border:"none",backgroundColor:"hsl(var(--surface-rail))"}},variant:"permanent",anchor:"left",children:(0,s.jsx)("div",{className:"flex flex-col items-center py-2 md:pt-5 gap-8 h-screen justify-between",children:(0,s.jsxs)("div",{className:"flex flex-col justify-between items-center h-full gap-6 overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center gap-6",children:[(0,s.jsx)(j.A,{isGlobal:!0,collapsibleChatList:E}),A.map((e,t)=>(0,s.jsx)(v,{item:e,isMobile:!1,forceTooltipOpen:N&&g&&p===t},e.id))]}),(0,s.jsx)("div",{className:"flex flex-col items-center gap-4",children:(0,s.jsx)(w,{})})]})})})})]})}},78550:(e,t,r)=>{r.d(t,{default:()=>f});var s,a=r(95155),n=r(80688),i=r(72034),l=r(12115);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)({}
1).hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e}).apply(null,arguments)}let c=function(e){return l.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),s||(s=l.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16M20.998 21l-4.35-4.35"})))};var d=r(13939),u=r(98500),m=r.n(u);r(5772);var x=r(8151),h=r(73321),p=r(50910);r(68189);let f=({isInApp:e=!1})=>{let t=(0,h.useRouter)(),r=(0,p.c)("TOP_NAV"),s={Account:r("PERSONAL_SPACE"),Organization:r("BUSINESS_SPACE"),Application:r("APPLICATION")},{query:l,setQuery:o,isSearchFocus:u,setIsSearchFocus:f,results:g,resetSearch:v,searchBarRef:j}=(0,d.S)("SearchGlobal"),b=e=>{e.preventDefault(),l.length>0&&(t.push(`/search?${new URLSearchParams({query:l}).toString()}`),v())};return(0,a.jsxs)(n.A,{className:"relative hidden md:block",ref:j,children:[(0,a.jsxs)("form",{className:e?"group relative mr-10":"relative",onSubmit:b,children:[(0,a.jsx)("input",{type:"text",placeholder:r("SEARCH"),onChange:e=>o(e.target.value),onSubmit:()=>b(l),value:l,onFocus:()=>f(!0),className:`${e?"w-0":"md:w-64 lg:w-96"} h-9 pr-9 rounded-lg bg-white-base placeholder:text-muted-foreground placeholder:text-md focus:outline-none focus:ring-2 focus:ring-stellarPrimary focus:border-transparent ${e?"group-hover:md:w-64 group-hover:lg:w-96 duration-500 ease-in-out group-hover:ps-5 ":"ps-5"} ${u?"md:w-64 lg:w-96 ps-5":""}`}),(0,a.jsx)("div",{className:"absolute inset-y-0 -right-0.5 flex items-center pr-2 pointer-events-none "+(e?"group-hover duration-500 ease-in-out":""),children:(0,a.jsx)(c,{height:24,width:24})})]}),u&&(0,a.jsx)("div",{className:"results-container",children:0===l.length?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:r("SEARCH_PLACEHOLDER")}):(0,a.jsx)("div",{className:"flex flex-col gap-4",children:g?(0,a.jsx)("div",{className:"flex ",children:Object.entries(g).length>0?(0,a.jsxs)("div",{className:"flex flex-col gap-4 w-full",children:[Object.keys(g).map((e,n)=>(0,a.jsx)("div",{children:g[e].slice(0,3).map((e,n)=>(0,a.jsx)("div",{children:(0,a.jsxs)("div",{onClick:()=>{"Organization"===e.type?t.push(`/organizations/${e.id}`,{scroll:!0}):"Application"===e.type?t.push(`/apps/marketplace/app/${e.aplicationCode}`,{scroll:!1}):t.push(`/profile/${e.id}`,{scroll:!0}),v()},className:"flex items-center gap-3 cursor-pointer hover:bg-white-base p-2 rounded-md w-full",children:[(0,a.jsx)("img",{src:(0,x.AY)(e.profileImageURL??e.imageURL)?e.profileImageURL??e.imageURL:"/Icons/Default_pfp.svg",alt:e.name,width:50,height:50,className:`w-10 h-10 bg-muted object-cover object-center ${"Application"!=e.type?"rounded-lg":" "}`}),(0,a.jsxs)("div",{className:"flex flex-col text-ellipsis overflow-hidden",children:[(0,a.jsx)("p",{className:"text-sm font-bold",children:e.name}),(0,a.jsxs)("p",{className:"text-sm text-muted-foreground",children:[s[e.type]," ",e.isFollow&&`⢠${r("FOLLOWING")}`]})]})]})},e.id??n))},n)),(0,a.jsx)(m(),{href:`/search?${new URLSearchParams({query:l}).toString()}`,className:"text-center hover:bg-white-base p-2 rounded-md w-full text-primary font-bold",onClick:()=>v(),children:r("SEE_ALL_RESULTS")})]}):(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:r("NO_RESULTS")})}):(0,a.jsx)(a.Fragment,{children:[void 0,void 0,void 0].map((e,t)=>(0,a.jsxs)("div",{className:"flex justify-between items-center gap-3",children:[(0,a.jsx)(i.A,{variant:"rounded",width:30,height:25}),(0,a.jsx)(i.A,{variant:"rounded",width:"100%",height:15})]},t))})})})]})}},84015:(e,t,r)=>{r.d(t,{B:()=>ew,default:()=>ey});var s=r(95155),a=r(12115),n=r(73321),i=r(42131),l=r(82752);let o=(0,i.Ay)(l.A)({"& .MuiPaper-root":{backgroundColor:"hsl(var(--card))",borderRadius:"20px",color:"hsl(var(--card-foreground))",width:"20rem",boxShadow:"0 6px 20px rgba(45, 52, 60, 0.10)",border:"1px solid hsl(var(--border))"}});var c=r(7034),d=r(66016),u=r(29680),m=r(24451),x=r(80688),h=r(32782),p=r(66890),f=r(37882),g=r(98500),v=r.n(g),j=r(72034),b=r(33810),N=r(50910),w=r(62012),y=r(51006),S=r(73331),E=r.n(S),A=r(41159),C=r(94514),T=r(50049),k=r(6296),I=r(66088),L=r(2614),R=r(86190);let P=({accountList:e,onClose:t,accountSelected:r,setIsSwitching:a=()=>{}})=>{if(!e)return(0,s.jsx)("div",{className:"flex flex-col items-center justify-center w-full h-full mt-1",children:(0,s.jsx)("p",{className:"text-muted-foreground text-md",children:"No companies found"})});let i=e.map(e=>({id:e.id,name:e.name,imageURL:e.imageURL})),l=(0,n.useRouter)(),{update:o}=(0,f.useSession)(),c=(0,N.c)("TOP_NAV"),d=async({space:s,company:n})=>{t(),a(!0);try{let t=await (0,y.e)(s.id,n.id);if(t?.Error)throw Error(t?.Message?.en||"ChangeAccount failed");let a=e.find(e=>e.id===n.id)??t?.Data?.accountSelected?.companyName??n,i=await o({accountSelected:{...r,companyName:a},jwt:t.Data.token});if(i?.user?.jwt!==t.Data.token)throw Error("Session update failed - please retry.");l.refresh()}catch(e){L.toast.error("Error changing business"),console.error(e)}finally{a(!1)}};return(0,s.jsxs)("div",{className:"overflow-x-auto md:overflow-y-auto",children:[(0,s.jsx)("p",{className:"px-2 pb-1.5 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:c("BUSINESS_NAME")}),(0,s.jsx)("ol",{className:"list-none m-0 p-0 flex flex-nowrap md:flex-col gap-4 md:gap-0 items-center",children:i.length>0?i.map((e,t)=>(0,s.jsxs)("li",{className:(0,R.cn)("w-full flex items-center gap-3 px-3 py-2 rounded-lg cursor-pointer transition-colors hover:bg-muted",e.id===r?.companyName?.id?"bg-primary/10 text-primary font-semibold":""),onClick:async()=>{await d({space:r,company:e})},children:[(0,s.jsx)("div",{className:"h-10 w-10 shrink-0 rounded-lg overflow-hidden border border-border bg-background relative",children:E()(e.imageURL)?(0,s.jsx)(w.default,{src:e.imageURL,fill:!0,alt:e.name,className:"object-cover",fallbackSrc:"/Images/placeholder.svg"}):(0,s.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,s.jsx)(A.A,{size:20,className:"text-muted-foreground"})})}),(0,s.jsx)("p",{className:"truncate text-sm font-medium text-foreground",children:e.name}),e.id===r?.companyName?.id&&(0,s.jsx)(C.A,{size:16,className:"ml-auto text-primary"})]},e.id||t)):(0,s.jsx)("div",{className:"flex flex-col items-center justify-center w-full h-full mt-1",children:(0,s.jsx)("p",{className:"text-muted-foreground text-md",children:"No companies found"})})})]})},O=({session:e,companyNames:t=[]})=>{let[r,i]=(0,a.useState)(null),[o,c]=(0,a.useState)(!1),{accountSelected:d}=e||{},{type:u}=d||{},m=!!r,h=(0,n.useRouter)(),{update:p}=(0,f.useSession)(),g=(0,N.c)("TOP_NAV"),v=()=>{i(null)},w=e=>{p({accountSelected:{...d,companyName:e}}).then(()=>{h.refresh()})};if((0,a.useEffect)(()=>{let e=t?.list;
1if(!d||!e||0===e.length)return;let r=d?.companyName;r||1!==e.length?r?.id&&!e.some(e=>e.id===r.id)&&w(e[0]):w(e[0])},[t?.list]),e)return(0,s.jsxs)("div",{className:"shrink-0",children:[(0,s.jsx)(x.A,{id:"workspace-selector","aria-controls":m?"workspace-menu":void 0,"aria-haspopup":"true","aria-expanded":m?"true":void 0,sx:{display:{xs:"none",md:"flex"},flexDirection:"column",textAlign:"left",gap:.5},children:e?(0,s.jsxs)("div",{className:"flex flex-col w-full justify-start items-end whitespace-nowrap",children:[(0,s.jsxs)("p",{className:"font-semibold text-lg truncate max-w-[150px] lg:max-w-none",children:[e.name," ",e.lastname]}),(0,s.jsx)(b.TooltipProvider,{children:(0,s.jsxs)("div",{className:"flex items-center justify-end text-muted-foreground text-sm space-x-0.5",children:["organization"===u&&(0,s.jsxs)("div",{className:"flex",children:[(0,s.jsxs)(b.Tooltip,{children:[(0,s.jsx)(b.TooltipTrigger,{asChild:!0,children:(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(T.A,{size:13,className:"text-muted-foreground"}),(0,s.jsx)("p",{children:d.name})]})}),(0,s.jsx)(b.TooltipContent,{side:"top",className:"text-xs",children:(0,s.jsx)("p",{children:g("BUSINESS_SPACE_TOOLTIP")})})]}),(0,s.jsx)("span",{className:"mx-1",children:"/"})]}),(0,s.jsxs)(b.Tooltip,{children:[(0,s.jsx)(b.TooltipTrigger,{asChild:!0,children:(0,s.jsxs)("span",{className:(0,R.cn)("flex flex-row items-center","organization"!==u||o?"cursor-default":"cursor-pointer"),onClick:!o&&t?.list&&t?.list.length>0?e=>{i(e.currentTarget)}:null,children:["organization"===u&&(o?(0,s.jsx)(k.A,{size:13,className:"mr-1 text-muted-foreground animate-spin"}):(0,s.jsx)(A.A,{size:13,className:"mr-1 text-muted-foreground"})),(0,s.jsx)("p",{children:o?g("CHANGING_BUSINESS_NAME"):"organization"===u?`${d?.companyName?.name?d.companyName.name:g("CHANGE_BUSINESS_NAME")}`:g("PERSONAL_SPACE")}),!o&&"organization"===u&&t?.list&&t?.list.length>0&&(0,s.jsx)(I.A,{size:16})]})}),(0,s.jsx)(b.TooltipContent,{side:"top",className:"text-xs",children:(0,s.jsx)("p",{children:g("CHANGE_BUSINESS_NAME_TOOLTIP")})})]})]})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(j.A,{animation:"wave",width:60}),(0,s.jsx)(j.A,{animation:"wave",width:80})]})}),(0,s.jsx)(l.A,{id:"workspace-menu",anchorEl:r,open:"organization"===u&&m,onClose:v,"aria-labelledby":"workspace-selector",anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{display:{xs:"none",md:"flex"},"& .MuiPaper-root":{width:300,borderRadius:3,boxShadow:"none",border:"1px solid hsl(var(--border))",marginTop:"6px",overflow:"hidden"},"& .MuiList-root":{padding:"6px"}},children:t?.list&&t?.list.length>0&&(0,s.jsx)(P,{accountList:t?.list.length>0?t?.list:[],HandleAnchorEL:v,accountSelected:d,onClose:v,setIsSwitching:c})})]})};var z=r(94938);let _=({clickable:e,currentUser:t})=>{let[r,n]=(0,a.useState)(null);return(0,s.jsx)(x.A,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:t&&(0,s.jsxs)(x.A,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,s.jsx)(h.A,{sx:{padding:0},"aria-controls":"avatar-menu","aria-haspopup":"true",onClick:e&&(e=>{n(e.currentTarget)}),children:(0,s.jsx)(z.A,{src:t.accountSelected?t.accountSelected.profileImageURL:t.profileImageURL,alt:"Profile",sx:{width:35,height:35}})}),(0,s.jsx)(ew,{session:t,anchorEl:r,handleClose:()=>{n(null)}})]})})};var U=r(13939),M=r(5772),B=r(8151);let D=({toggleSearch:e})=>{let t=(0,a.useRef)(null),r=(0,n.useRouter)(),{query:i,setQuery:l,results:o,resetSearch:c}=(0,U.S)(),d=(0,N.c)("TOP_NAV"),m={Account:d("PERSONAL_SPACE"),Organization:d("BUSINESS_SPACE"),Application:d("APPLICATION")};return(0,a.useEffect)(()=>{let r=r=>{t.current&&!t.current.contains(r.target)&&e()};return document.addEventListener("click",r),()=>{document.removeEventListener("click",r)}},[e]),(0,s.jsx)("div",{className:"fixed md:hidden inset-0 bg-black bg-opacity-60 z-50",children:(0,s.jsxs)("div",{className:"fixed top-0 left-0 w-full bg-background p-2",ref:t,children:[(0,s.jsxs)("div",{className:"flex justify-center items-center mb-3 mt-4",children:[(0,s.jsxs)("form",{className:"relative",children:[(0,s.jsx)("input",{type:"text",placeholder:`${d("SEARCH")}`,className:"w-full h-8 px-4 pr-10 rounded-full bg-muted placeholder:text-muted-foreground placeholder:text-md focus:outline-none focus:ring-2 focus:ring-stellarPrimary focus:border-transparent",autoFocus:!0,onChange:e=>l(e.target.value),onSubmit:()=>{i.preventDefault(),i.length>0&&(r.push(`/search?${new URLSearchParams({query:i}).toString()}`),e())},value:i}),(0,s.jsx)("div",{className:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none",children:(0,s.jsx)(u.A,{sx:{fontSize:"24px",color:"hsl(var(--muted-foreground))"}})})]}),(0,s.jsx)(_,{})]}),(0,s.jsx)("div",{className:"bg-background p-4",children:0===i.length?(0,s.jsxs)("p",{className:"text-sm text-muted-foreground text-center",children:[d("SEARCH_PLACEHOLDER")," ",(0,s.jsx)("span",{className:"font-semibold",children:d("TAP_TO_CLOSE")})]}):(0,s.jsx)("div",{className:"flex flex-col gap-4 max-h-80 overflow-y-auto",children:o?(0,s.jsx)("div",{className:"flex ",children:Object.entries(o).length>0?(0,s.jsxs)("div",{className:"flex flex-col gap-4 w-full",children:[Object.keys(o).map((t,a)=>(0,s.jsx)("div",{children:o[t].slice(0,2).map((t,a)=>(0,s.jsx)("div",{children:(0,s.jsxs)("div",{onClick:()=>{"Organization"===t.type?r.push(`/organizations/${t.id}`,{scroll:!0}):"Application"===t.type?r.push(`/apps/marketplace/app/${t.aplicationCode}`,{scroll:!1}):r.push(`/profile/${t.id}`,{scroll:!0}),e()},className:"flex items-center gap-3 cursor-pointer hover:bg-muted p-2 rounded-md w-full",children:[(0,s.jsx)("img",{src:(0,B.AY)(t.profileImageURL??t.imageURL)?t.profileImageURL??t.imageURL:"/Icons/Default_pfp.svg",alt:t.name,width:50,height:50,className:`w-10 h-10 bg-muted object-cover object-center ${"Application"!=t.type?"rounded-full":" "}`}),(0,s.jsxs)("div",{className:"flex flex-col text-ellipsis overflow-hidden",children:[(0,s.jsx)("p",{className:"text-sm font-bold",children:t.name}),(0,s.jsxs)("p",{className:"text-sm text-muted-foreground",children:[m[t.type]," ",t.isFollow&&`⢠${d("FOLLOWING")}`]})]})]})},t.id??a))},a)),(0,s.jsx)(v(),{href:`/search?${new URLSearchParams({query:i}).toString()}`,className:"text-center hover:bg-muted p-2 rounded-md w-full text-primary font-bold",onClick:()=>{e(),c()},children:d("SEE_ALL_RESULTS")})]}):(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:d("NO_RESULTS")})}):(0,s.jsx)(s.Fragment,{children:[void 0,void 0,void 0].map((e,t)=>(0,s.jsxs)("div",{className:"flex justify-between items-center gap-3",children:[(0,s.jsx)(j.A,{variant:"rounded",width:30,height:25}),(0,s.jsx)(j.A,{variant:"rounded",width:"100%",height:15})]},t))})})})]})})};var $=r(11317),F=r(56380);let G=({session:e})=>{let[t,r]=(0,a.useState)([]),[s,n]=(0,a.useState)(!1),[i,l]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let t=async()=>
1{l(!0);try{let t=await (0,$.N)();if(!t||t.Error||t.error){let e="string"==typeof t?.Message?t.Message:t?.Message?.en??"";throw e.includes("Invalid Token")&&(0,F.L3)(),Error(e)}{let s=t.Data||[];r(s);let a=e?.user?.id??e?.id??null;n(!!a&&s.some(e=>e.ownerProfile?.id===a))}}catch(e){console.error(e)}finally{l(!1)}};e&&t()},[e]),{organizations:t,loading:i,userOwnsOrganization:s}};var H=r(43392),V=r(33790),q=r(23910);let W=({setOpenModal:e})=>(0,s.jsxs)(x.A,{children:[(0,s.jsx)(h.A,{"aria-label":"close",onClick:()=>e(!1),sx:{position:"absolute",top:0,right:0},children:(0,s.jsx)(V.default,{})}),(0,s.jsx)(q.A,{})]});var Q=r(38035);let K={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",bgcolor:"background.paper",boxShadow:24,p:4,borderRadius:2,textAlign:"start",width:"30rem","@media (max-width: 600px)":{width:"90%",p:2}},Y=({open:e,setOpenModal:t})=>{let[r,n]=(0,a.useState)(!0),[i,l]=(0,a.useState)(null);return(0,s.jsx)(H.A,{open:e,onClose:()=>{t(!1),n(!0),l(null)},"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",children:r&&!i?(0,s.jsx)(x.A,{sx:K,children:(0,s.jsx)(W,{setOpenModal:t,setIsCreateModal:n,setOrganizationCode:l})}):(0,s.jsx)(x.A,{sx:K,children:(0,s.jsx)(Q.A,{setOpenModal:t,setIsCreateModal:n,setOrganizationCode:l,organizationCode:i})})})};
1var X=r(67192),Z=r(92289),J=r(95106),ee=r(68189),et=r(34680),er=r(99701);r(4369);var es=r(51738),ea=r(9339);let en=(0,ea.createServerReference)("40f7ca6e0f4307c75d550dc603328d447a174caacb",ea.callServer,void 0,ea.findSourceMapURL,"UpdateNotificationStatusbyEmail"),ei=({currentUser:e,mobileOnly:t=!1})=>{let{data:r,status:a,refetch:n}=(0,es.j)({currentUser:e,isRead:!0}),i=(0,N.c)("TOP_NAV"),l=r?.pages[0].notifications?.filter(e=>null!==e)?.filter(e=>!e.isRead)?.length;return(0,s.jsxs)(J.DropdownMenu,{onOpenChange:async t=>{if(t)try{await en(e.email),await n()}catch(e){console.error("Could not mark notifications as read:",e)}},children:[(0,s.jsx)(J.DropdownMenuTrigger,{asChild:!0,children:(0,s.jsx)(ee.Button,{variant:"ghost",size:"icon","aria-label":i("NOTIFICATIONS"),className:`relative h-8 w-8 rounded-full text-muted-foreground items-center${t?" md:hidden":""}`,children:l>0?(0,s.jsx)(er.f,{overlap:"circular",anchorOrigin:{vertical:"top",horizontal:"left"},variant:"dot",children:(0,s.jsx)(Z.A,{size:28})}):(0,s.jsx)(Z.A,{size:28})})}),(0,s.jsxs)(J.DropdownMenuContent,{className:"max-w-sm max-h-[35rem] md:max-h-96 overflow-y-auto custom-scrollbar font-sans",align:"end",forceMount:!0,children:[(0,s.jsx)("p",{className:"text-xl font-semibold px-4 py-2",children:i("NOTIFICATIONS")}),(0,s.jsx)(et.A,{currentUser:e,preview:!0})]})]})};var el=r(49387),eo=r(87164),ec=r(90051),ed=r(22368),eu=r(1610),em=r(1164),ex=r(41313),eh=r(41641),ep=r(51914),ef=r(98981),eg=r(51726),ev=r(96035),ej=r(44018);let eb=({currentUser:e})=>{let{data:t,status:r,refetch:n}=(0,es.j)({currentUser:e,isRead:!0}),i=t?.pages[0].notifications?.filter(e=>null!==e)?.filter(e=>!e.isRead)?.length,[l,o]=(0,a.useState)(!1),{showPanel:c,setShowPanel:d}=(0,ej.o)();if((0,a.useEffect)(()=>{o(!0)},[]),!l)return null;let u=async()=>{let t=!c;if(d(t),t)try{await en(e.email),await n()}catch(e){console.error("Could not mark notifications as read:",e)}};return(0,s.jsx)(b.TooltipProvider,{children:(0,s.jsxs)(b.Tooltip,{children:[(0,s.jsx)(b.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(ee.Button,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 rounded-full text-primary items-center hidden md:block",onClick:u,children:i>0?(0,s.jsx)(er.f,{overlap:"circular",anchorOrigin:{vertical:"top",horizontal:"left"},variant:"dot",children:(0,s.jsx)(ev.A,{size:28})}):(0,s.jsx)(ev.A,{size:28})})}),(0,s.jsx)(b.TooltipContent,{children:(0,s.jsx)("p",{children:"Toggle panel"})})]})})},eN=({currentUser:e,onClose:t})=>{let r,i=(0,N.c)("TOP_NAV.MOBILE_POPUP"),l=[e],o=(0,n.useRouter)(),[c,d]=(0,a.useState)(!1),{showDisclaimer:u}=(0,eo.V)(),{data:m}=(0,f.useSession)(),[x,h]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let t=m||{user:e};h((0,ec.jp)(t))},[m,e]);let{organizations:p,userOwnsOrganization:g}=G({session:e}),v=(0,a.useCallback)(e=>{o.push(e),t()},[o,t]),j=(0,a.useCallback)(()=>{o.push("/changeorg"),o.refresh()},[o]),b=(0,a.useCallback)(()=>{x?u():(0,ec._G)()},[x,u]);p&&l.push(...p);let w=(0,a.useMemo)(()=>[{label:i("PROFILE"),icon:(0,s.jsx)(ed.A,{size:18}),path:`/profile/${e.id}`},e.accountSelected?.type!=="personal"&&{label:i("BUSINESS_SPACE_PROFILE"),icon:(0,s.jsx)(eu.A,{size:18}),path:`/organizations/${e?.accountSelected?.id}`},{label:i("SETTINGS"),icon:(0,s.jsx)(em.A,{size:18}),path:"/apps/account-settings"},{label:i("LOGOUT"),icon:(0,s.jsx)(ex.A,{size:18}),onClick:b}].filter(Boolean),[e,i,b]);return(0,s.jsxs)(X.P.aside,{className:"fixed md:hidden inset-0 bg-black bg-opacity-60 z-50",initial:{x:"100%"},animate:{x:0},transition:{duration:.5},children:[(0,s.jsxs)("nav",{className:"bg-background h-screen font-sans flex flex-col items-center w-full space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between p-4 w-full",children:[(0,s.jsx)(eh.A,{onClick:t,size:26}),(0,s.jsx)(ei,{currentUser:e})]}),(0,s.jsxs)("section",{className:"flex flex-col gap-2 items-center",children:[(0,s.jsxs)("div",{className:"relative w-fit m-auto",children:[(0,s.jsx)(M.default,{src:e.profileImageURL,width:"120",height:"120",alt:"Profile Picture",className:"rounded-full border-4 border-primary-100"}),(0,s.jsx)(ee.Button,{variant:"outline",size:"iconMd",className:"rounded-full absolute right-0 bottom-0 border-none bg-primary-100",onClick:()=>v("/apps/account-settings"),children:(0,s.jsx)(el.A,{size:16})})]}),(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsxs)("p",{className:"text-xl text-primary font-semibold",children:[(r=new Date().getHours())<12?i("GOOD_MORNING"):r<18?i("GOOD_AFTERNOON"):i("GOOD_EVENING"),", ",e.name,"!"]}),e.accountSelected&&(0,s.jsxs)("div",{className:"flex gap-2 items-center justify-center text-muted-foreground",children:[e.accountSelected?.type!=="personal"?(0,s.jsx)(T.A,{size:15}):(0,s.jsx)(ed.A,{size:15}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:e.accountSelected?.type==="personal"?"Personal Space":e.accountSelected?.name})]})]})]}),(0,s.jsxs)("section",{className:"flex flex-col gap-2 items-center py-2",children:[p.length>0&&(0,s.jsxs)("div",{className:"grid gap-2",children:[(0,s.jsx)(ee.Button,{type:"button",variant:"outline",className:"space-x-2 border-none bg-muted text-foreground",onClick:()=>j(),children:(0,s.jsx)("div",{className:"flex flex-col items-start",children:(0,s.jsx)("p",{className:"text-sm font-semibold",children:i("CHANGE_BUSINESS_SPACE")})})}),!g&&(0,s.jsxs)(ee.Button,{type:"button",variant:"outline",className:"space-x-2 border-none bg-primary-100 text-primary",onClick:()=>v("/onboarding?create=true"),children:[(0,s.jsx)(ep.A,{size:18}),(0,s.jsx)("div",{className:"flex flex-col items-start",children:(0,s.jsx)("p",{className:"text-sm font-semibold",children:i("NEW_BUSINESS_SPACE")})})]})]}),0===p.length&&(0,s.jsxs)(ee.Button,{type:"button",variant:"outline",className:"space-x-2 border-none bg-primary-100 text-primary",onClick:()=>v("/apps"),children:[(0,s.jsx)(ep.A,{size:18}),(0,s.jsx)("div",{className:"flex flex-col items-start",children:(0,s.jsx)("p",{className:"text-sm font-semibold",children:i("NEW_BUSINESS_SPACE")})})]})]}),(0,s.jsx)("section",{className:"w-full",children:(0,s.jsxs)("ol",{className:"flex flex-col gap-1 text-muted-foreground items-center",children:[(0,s.jsx)(eg.Separator,{className:"w-11/12 mt-3 mb-3"}),w.map((e,t)=>(0,s.jsx)("li",{className:"px-8 py-2 flex flex-col w-full",onClick:e.onClick||(()=>v(e.path)),children:(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsxs)("div",{className:"flex gap-4 items-center",children:[(0,s.jsx)("div",{className:"bg-primary-100 p-2 rounded-md text-primary",children:e.icon}),(0,s.jsx)("p",{children:e.label})]}),(0,s.jsx)(ef.A,{size:18,className:"text-primary"})]})},t))]})})]}),(0,s.jsx)(Y,{open:c,setOpenModal:d})]})},ew=({anchorEl:e,handleClose:t,session:r})=>{let i=(0,n.useRouter)(),l=(0,N.c)("TOP_NAV"),{showDisclaimer:u}=(0,eo.V)(),{organizations:x,userOwnsOrganization:h}=G({session:r}),[f,g]=(0,a.useState)(!1);(0,a.useEffect)(()=>{g((0,ec.jp)(r))},[r]);let j=(0,a.useCallback)(()=>{f?u():(0,ec._G)()},[f,u]);if(r){let{accountSelected:a}=r,n=a&&"organization"===a.type;return(0,s.jsxs)(o,{className:"flex flex-col font-sans py-6 px-4",id:"avatar-menu",elevation:0,anchorEl:e,open:!!e,onClose:t,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{marginTop:"10px",marginLeft:"10px","& .MuiPaper-root":{boxShadow:"0 6px 20px rgba(45, 52, 60, 0.10)"}},MenuListProps:{style:{paddingLeft:"1.25rem",paddingRight:"1.25rem",paddingBottom:"1.5rem"}},children:[(0,s.jsx)("div",{className:"flex flex-row justify-end",children:(0,s.jsx)(m.A,{sx:{justifyContent:"flex-end"},children:(0,s.jsx)(c.A,{onClick:()=>t()})})}),(0,s.jsxs)("div",{className:"w-full flex flex-col text-center ",children:[(0,s.jsxs)("div",{className:"relative w-fit m-auto",children:[(0,s.jsxs)(p.Avatar,{className:"h-20 w-20",children:[(0,s.jsx)(p.AvatarImage,{src:r?.profileImageURL,alt:r?.name||""}),(0,s.jsx)(p.AvatarFallback,{children:r?.name?.[0]??"?"})]}),(0,s.jsx)(ee.Button,{variant:"secondary",size:"iconSm",className:"rounded-full absolute right-0 bottom-0",onClick:()=>i.push("/apps/account-settings"),children:(0,s.jsx)(el.A,{size:14})})]}),(0,s.jsxs)("p",{className:"text-xl text-primary font-semibold mt-2.5 px-2 leading-tight break-words",children:[l("GREETING")," ",r.name,"!"]}),(0,s.jsx)(v(),{className:"text-sm text-muted-foreground break-words px-2",href:a&&"organization"!==a.type?`/profile/${r.id}`:`/organizations/${a?.id}`,children:a&&"organization"!==a.type?r.email:l.rich("USER_BUSINESS_SPACE",{name:a?.name,b:e=>(0,s.jsx)("strong",{className:"font-semibold text-foreground",children:e})})}),(0,s.jsx)(ee.Button,{className:"mt-5 w-full",size:"lg",onClick:t,children:(0,s.jsx)(v(),{href:`${n?"/organizations":"/profile"}/${a?a.id:r.id}`,children:l(n?"BUSINESS_SPACE_PROFILE":"MY_PROFILE")})}),x.length>0?(0,s.jsxs)("div",{className:"grid gap-3",children:[(0,s.jsxs)(ee.Button,{className:"mt-3 flex flex-row gap-4 items-center justify-start w-full bg-muted hover:bg-muted/80 border border-border rounded-xl h-14 px-3",onClick:()=>{i.push("/changeorg"),i.refresh()},children:[(0,s.jsx)("div",{className:"h-10 w-10 shrink-0 rounded-lg bg-primary/10 flex items-center justify-center",children:(0,s.jsx)("img",{src:"/Icons/MenuUserIcon.svg",width:"40",height:"40",alt:"Slive",className:"w-6 h-6"})}),(0,s.jsxs)("div",{className:"flex flex-col text-start my-auto",children:[(0,s.jsx)("p",{className:"text-foreground text-sm font-semibold",children:l("CHANGE_BUSINESS_SPACE")}),(0,s.jsx)("p",{className:"text-muted-foreground text-xs truncate",children:`${"personal"===a.type?l("PERSONAL_SPACE"):a.name}`})]})]}),!h&&(0,s.jsx)(ee.Button,{className:"w-full bg-muted hover:bg-muted/80 border border-border text-foreground font-semibold",onClick:t,children:(0,s.jsx)(v(),{href:"/onboarding?create=true",children:l("MOBILE_POPUP.NEW_BUSINESS_SPACE")})})]}):(0,s.jsxs)(v(),{href:"/onboarding?create=true",className:"gray-btn mt-3 flex flex-row gap-4 items-center w-full bg-muted hover:bg-muted/80 border border-border rounded-xl h-14 px-3",onClick:t,children:[(0,s.jsx)("div",{className:"h-10 w-10 shrink-0 rounded-lg bg-primary/10 flex items-center justify-center",children:(0,s.jsx)("img",{src:"/Icons/MenuUserIcon.svg",width:"40",height:"40",alt:"Slive",className:"w-6 h-6"})}),(0,s.jsx)("div",{className:"flex flex-col",children:(0,s.jsx)("p",{className:"text-primary-900 text-base",children:l("MOBILE_POPUP.NEW_BUSINESS_SPACE")})})]}
1),(0,s.jsxs)("button",{onClick:j,className:"font-medium mt-5 w-full flex items-center justify-center gap-2 font-sans",children:[(0,s.jsx)(d.A,{style:{color:"hsl(var(--brand))"}}),(0,s.jsx)("span",{className:"text-foreground font-semibold",children:l("LOGOUT")})]})]})]})}},ey=({currentUser:e,companyNames:t,handlePanelButton:r=!1,showNotifications:i=!1,notificationsMobileOnly:l=!1})=>{let[o,c]=(0,a.useState)(!1),[d,m]=(0,a.useState)(!1),[f,g]=(0,a.useState)(null),{accountSelected:v}=e,j=(0,n.usePathname)(),b=(0,a.useMemo)(()=>!!j&&(!!("/chat"===j||j.startsWith("/chat/"))||/^\/[a-zA-Z]{2}(?:-[a-zA-Z]{2})?\/chat(\/|$)/.test(j)),[j]),N=()=>{c(!o)},w=()=>{m(!d)};if(e)return(0,s.jsxs)("div",{className:"flex gap-2 md:gap-4 items-center shrink-0",children:[(0,s.jsx)("div",{className:"flex gap-2 items-center md:hidden",children:(0,s.jsx)(ee.Button,{type:"button",variant:"outline",className:"bg-muted rounded-lg p-2 border-none h-8",onClick:N,children:(0,s.jsx)(u.A,{sx:{fontSize:"24px",color:"hsl(var(--muted-foreground))"}})})}),(0,s.jsx)(x.A,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:(0,s.jsx)(x.A,{sx:{display:"flex",alignItems:"center",gap:1},children:(0,s.jsxs)("div",{className:"flex flex-row gap-2 md:gap-3 items-center",children:[v?.type==="organization"?(0,s.jsx)(O,{session:e,companyNames:t}):(0,s.jsx)(O,{session:e}),(0,s.jsx)(h.A,{sx:{padding:0},"aria-controls":"avatar-menu","aria-haspopup":"true",onClick:e=>{window.innerWidth<=900?w():g(e.currentTarget)},children:(0,s.jsxs)(p.Avatar,{children:[(0,s.jsx)(p.AvatarImage,{src:e?.profileImageURL,alt:e?.name||""}),(0,s.jsx)(p.AvatarFallback,{children:e?.name?.[0]??"?"})]})}),i&&(0,s.jsx)(ei,{currentUser:e,mobileOnly:l}),r&&(0,s.jsx)("div",{className:b?"invisible":void 0,children:(0,s.jsx)(eb,{currentUser:e})}),(0,s.jsx)(ew,{session:e,anchorEl:f,handleClose:()=>{g(null)},currentUserId:e.id})]})})}),o&&(0,s.jsx)(D,{toggleSearch:N}),d&&(0,s.jsx)(eN,{currentUser:e,onClose:w})]})}},93406:(e,t,r)=>{r.d(t,{FloatingNav:()=>v});var s=r(95155),a=r(12115),n=r(62321),i=r(46004),l=r(80642),o=r(67192),c=r(28245),d=r(18310),u=r(98500),m=r.n(u),x=r(73321),h=r(86190);let p="/Logos/slive-simbolo.svg",f=e=>{e.currentTarget.src.endsWith(p)||(e.currentTarget.onerror=null,e.currentTarget.src=p)};function g({mouseX:e,item:t,onNavigate:r}){let c=(0,a.useRef)(null),[d,u]=(0,a.useState)(!1),x=(0,n.G)(e,e=>{let t=c.current?.getBoundingClientRect()??{x:0,width:0};return e-t.x-t.width/2}),h={mass:.1,stiffness:260,damping:20},v=(0,n.G)(x,[-130,0,130],[1,1.45,1]),j=(0,i.z)(v,h),b=(0,n.G)(x,[-130,0,130],[0,-14,0]),N=(0,i.z)(b,h),w="folder"===t.type,y=t.url||"",S=y.startsWith("/")||y.startsWith("http")?y:`/${y}`,E=w?(0,s.jsx)("div",{className:"grid h-12 w-12 grid-cols-2 grid-rows-2 gap-[3px] rounded-2xl bg-card/10 p-1 ring-1 ring-inset ring-white/10",children:t.items?.slice(0,4).map(e=>(0,s.jsx)("img",{src:e.iconURL||p,onError:f,alt:e.name,className:"h-full w-full object-contain object-center"},e.id))}):(0,s.jsx)(m(),{href:S,"data-id":t.id?.toString(),"aria-label":t.name,onClick:r,children:(0,s.jsx)("img",{src:t.iconURL||p,onError:f,alt:t.name,draggable:!1,className:"h-12 w-12 object-contain object-center"})});return(0,s.jsxs)("div",{ref:c,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:"group relative flex shrink-0 flex-col items-center justify-end",children:[(0,s.jsx)(l.N,{children:d&&(0,s.jsxs)(o.P.span,{initial:{opacity:0,y:8,scale:.85},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:8,scale:.85},transition:{duration:.15},className:"pointer-events-none absolute -top-11 z-20 whitespace-nowrap rounded-lg border border-white/10 bg-dark-4/95 px-2.5 py-1 text-xs font-semibold text-white backdrop-blur",children:[t.name,(0,s.jsx)("span",{className:"absolute -bottom-1 left-1/2 h-2 w-2 -translate-x-1/2 rotate-45 border-b border-r border-white/10 bg-dark-4/95"})]})}),(0,s.jsx)(o.P.div,{style:{scale:j,y:N,transformOrigin:"bottom center",willChange:"transform"},className:"p-0.5",children:E})]})}let v=({smartMenu:e,menuCategory:t,className:r})=>{let[u,m]=(0,a.useState)(!1),[p,f]=(0,a.useState)(!1),[v,j]=(0,a.useState)(!1),b=(0,c.d)(1/0),N=(0,x.usePathname)(),w=(0,d.I)(),y=(0,c.d)(0),S=(0,i.z)(y,{mass:.2,stiffness:220,damping:26}),E=w?y:S,A=(0,n.G)(E,[0,1],[16,26]),C=(0,n.G)(E,[0,1],[16,20]),T=(0,n.G)(E,[.12,1],[0,1]),k=(0,n.G)(E,[0,1],[64,48]),I=(0,n.G)(E,[0,1],[.25,.75]),L=(0,n.G)(E,[0,1],[0,-4]),R=(0,c.d)(0),P=(0,i.z)(R,{mass:.2,stiffness:180,damping:22}
1),O=w?R:P,z=v&&!w,_=(0,a.useRef)(null),U=(0,a.useRef)(null),M=(0,a.useRef)(!1),B=(0,a.useRef)({open:null,close:null,idle:null}),D=(0,a.useCallback)(e=>{B.current[e]&&(clearTimeout(B.current[e]),B.current[e]=null)},[]),$=(0,a.useCallback)(()=>{D("open"),D("close"),D("idle"),M.current=!1,m(!1),j(!1),y.set(0),R.set(0),b.set(1/0)},[D,R,b,y]),F=(0,a.useCallback)(()=>{D("idle"),B.current.idle=setTimeout($,5e3)},[D,$]),G=(0,a.useCallback)(()=>{D("open"),D("close"),m(!0),F()},[F,D]),H=(0,a.useCallback)(()=>{D("close"),D("open"),B.current.open=setTimeout(G,220)},[D,G]),V=(0,a.useCallback)(()=>D("open"),[D]),q=(0,a.useCallback)(e=>{y.set(e),j(e>.02)},[y]),W=(0,a.useCallback)(()=>{M.current=!0,D("close"),D("idle")},[D]),Q=(0,a.useCallback)(()=>{M.current=!1,D("close"),B.current.close=setTimeout($,180)},[D,$]);(0,a.useEffect)(()=>{let e=B.current;return()=>{["open","close","idle"].forEach(t=>{e[t]&&clearTimeout(e[t])})}},[]),(0,a.useEffect)(()=>{if(!u)return;let e=e=>!!(_.current?.contains(e)||U.current?.contains(e)),t=e=>{"Escape"===e.key&&$()},r=t=>{e(t.target)||$()},s=t=>{t.target!==document.body&&(e(t.target)||$())},a=()=>{document.hidden&&$()};return document.addEventListener("keydown",t),document.addEventListener("pointerdown",r,!0),document.addEventListener("focusin",s),document.addEventListener("visibilitychange",a),document.documentElement.addEventListener("mouseleave",$),window.addEventListener("blur",$),window.addEventListener("scroll",$,{passive:!0,capture:!0}),window.addEventListener("wheel",$,{passive:!0}),()=>{document.removeEventListener("keydown",t),document.removeEventListener("pointerdown",r,!0),document.removeEventListener("focusin",s),document.removeEventListener("visibilitychange",a),document.documentElement.removeEventListener("mouseleave",$),window.removeEventListener("blur",$),window.removeEventListener("scroll",$,{capture:!0}),window.removeEventListener("wheel",$)}},[u,$]),(0,a.useEffect)(()=>{$()},[N,$]),(0,a.useEffect)(()=>{if(u)return;let e=0,t=t=>{let{clientX:r,clientY:s}=t;e||(e=requestAnimationFrame(()=>{e=0;let t=r-window.innerWidth/2,a=Math.min(1,Math.max(0,(220-Math.hypot(t,s-window.innerHeight))/164));q(a);let n=Math.max(-1,Math.min(1,t/90));R.set(10*n*a)}))},r=()=>{q(0),R.set(0)};return window.addEventListener("mousemove",t,{passive:!0}),document.documentElement.addEventListener("mouseleave",r),window.addEventListener("blur",r),()=>{window.removeEventListener("mousemove",t),document.documentElement.removeEventListener("mouseleave",r),window.removeEventListener("blur",r),e&&cancelAnimationFrame(e)}},[R,u,q]),(0,a.useEffect)(()=>{let e=e=>!!(e&&("INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable)),t=t=>f(e(t.target)),r=t=>f(e(t.relatedTarget));return f(e(document.activeElement)),document.addEventListener("focusin",t),document.addEventListener("focusout",r),()=>{document.removeEventListener("focusin",t),document.removeEventListener("focusout",r)}},[]);let K=e=>w?{duration:0}:e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.P.div,{style:{x:O,y:L},className:(0,h.cn)("pointer-events-none fixed inset-x-0 bottom-0 z-[4000] mx-auto flex w-fit items-end justify-center pb-1 transition-opacity duration-300",p&&!v?"opacity-40":"opacity-100"),children:(0,s.jsx)(o.P.div,{animate:z?{y:[0,-2.5,0]}:{y:0},transition:z?{duration:2.4,ease:"easeInOut",repeat:1/0,repeatType:"mirror"}:{duration:.2},children:(0,s.jsx)(l.N,{children:!u&&(0,s.jsxs)(o.P.button,{ref:U,type:"button","aria-label":"Abrir men\xfa de aplicaciones","aria-expanded":!1,onFocus:()=>q(1),onBlur:()=>q(0),onClick:G,onMouseEnter:H,onMouseLeave:V,initial:{y:30,opacity:0},animate:{y:0,opacity:1},exit:{y:30,opacity:0},transition:K({type:"spring",stiffness:320,damping:32}),style:{height:A,paddingLeft:C,paddingRight:C},className:"pointer-events-auto relative flex items-center justify-center rounded-full",children:[v&&(0,s.jsx)(o.P.span,{"aria-hidden":!0,style:{opacity:T},className:"liquid-glass pointer-events-none absolute inset-0 overflow-hidden rounded-full"}),(0,s.jsx)(o.P.span,{style:{width:k,opacity:I},className:"relative z-10 h-1.5 rounded-full bg-foreground"})]})})})}),(0,s.jsx)(l.N,{children:u&&(0,s.jsxs)(o.P.div,{ref:_,onMouseEnter:W,onMouseLeave:Q,onMouseMove:e=>{W(),b.set(e.pageX)},initial:{y:130},animate:{y:0},exit:{y:130},transition:K({type:"spring",stiffness:260,damping:28}),className:(0,h.cn)("fixed bottom-5 inset-x-0 mx-auto h-[80px] w-fit max-w-[96vw] px-5 pb-3 pt-3.5 z-[5000]",r),children:[(0,s.jsx)("div",{className:"liquid-glass pointer-events-none absolute inset-0 rounded-[28px]","aria-hidden":!0}),(0,s.jsxs)("div",{className:"relative z-10 flex h-full items-end gap-5",children:[t&&t.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"flex items-end gap-5",children:t.map(e=>(0,s.jsx)(g,{mouseX:b,item:e,onNavigate:$},e.id))}),(0,s.jsx)("div",{className:"mb-2 h-9 w-px shrink-0 bg-foreground
1/25"})]}),e&&e.length>0&&(0,s.jsx)("div",{className:"flex items-end gap-5",children:e.map(e=>(0,s.jsx)(g,{mouseX:b,item:e,onNavigate:$},e.id))})]})]})})]})}},93928:(e,t,r)=>{r.d(t,{U:()=>a});var s=r(9339);let a=(0,s.createServerReference)("4000b410e77730a4fbc358211538c2244e3072b3c3",s.callServer,void 0,s.findSourceMapURL,"inviteUsersToOrganization")}}]);
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.