import{c as F,u as R,b as B,d as G,e as v,i as E,r as W,j as i,P as $,f as M,g as w,l as Q,h as _,k as L,p as q,m as D,G as H,n as J,B as K,F as O,S as U}from"./index-26FXPGkN.js";import V from"./index-BBpliREt.js";import"./IconChevronLeft-FAloe5QL.js";const C=e=>w.dispatch(Q.actions.setWithoutSidebar(e)),te=()=>{const e=F.c(41),{t}=R(),h=B(),[T]=G();let I;e[0]!==T?(I=T.get("uid")||"",e[0]=T,e[1]=I):I=e[1];const a=I;let x;e[2]!==a?(x={uid:a},e[2]=a,e[3]=x):x=e[3];const{data:l,isError:z}=v.useLinkInfoQuery(x),[j]=v.useApplyLinkMutation(),s=l==null?void 0:l.Entity,y=l==null?void 0:l.Link.AccessType,g=s==null?void 0:s.AccessType;let N;e[4]!==g||e[5]!==y?(N=E(y)&&E(g)&&y<=g,e[4]=g,e[5]=y,e[6]=N):N=e[6];const n=N;let k;e[7]!==j||e[8]!==n||e[9]!==h||e[10]!==(s==null?void 0:s.Id)||e[11]!==t||e[12]!==a?(k=()=>{if(n){h(_(L.folder,{folderId:(s==null?void 0:s.Id)||0}));return}j({uid:a}).unwrap().then(p=>{w.dispatch(q.util.invalidateTags(["Project"])),h(_(L.folder,{folderId:p.Id}))}).catch(()=>D({message:t("members.links.invalid")}))},e[7]=j,e[8]=n,e[9]=h,e[10]=s==null?void 0:s.Id,e[11]=t,e[12]=a,e[13]=k):k=e[13],s==null||s.Id;const P=k;let A;if(e[14]===Symbol.for("react.memo_cache_sentinel")?(A=[],e[14]=A):A=e[14],W.useEffect(Y,A),z){let p;return e[15]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(V,{}),e[15]=p):p=e[15],p}if(!s)return null;let o;e[16]!==s.Color||e[17]!==s.IconId||e[18]!==s.Name?(o=i.jsx($,{name:s.Name,color:s.Color,icon:s.IconId,size:48}),e[16]=s.Color,e[17]=s.IconId,e[18]=s.Name,e[19]=o):o=e[19];let r;e[20]!==s.Name?(r=i.jsx(M,{fz:32,fw:500,children:s.Name}),e[20]=s.Name,e[21]=r):r=e[21];let c;e[22]!==o||e[23]!==r?(c=i.jsxs(H,{children:[o,r]}),e[22]=o,e[23]=r,e[24]=c):c=e[24];const S=`members.links.${n?"alreadyInvited":"invite"}`;let m;e[25]!==s.Name||e[26]!==t||e[27]!==S?(m=t(S,{project:s.Name}),e[25]=s.Name,e[26]=t,e[27]=S,e[28]=m):m=e[28];let f;e[29]!==m?(f=i.jsx(J,{maw:260,ta:"center",children:m}),e[29]=m,e[30]=f):f=e[30];let u;e[31]!==n||e[32]!==t?(u=t(n?"members.action.goToProject":"members.action.join"),e[31]=n,e[32]=t,e[33]=u):u=e[33];let d;e[34]!==P||e[35]!==u?(d=i.jsx(K,{size:"lg",radius:8,onClick:P,children:u}),e[34]=P,e[35]=u,e[36]=d):d=e[36];let b;return e[37]!==f||e[38]!==d||e[39]!==c?(b=i.jsx(O,{justify:"center",flex:1,children:i.jsxs(U,{gap:40,align:"center",children:[c,f,d]})}),e[37]=f,e[38]=d,e[39]=c,e[40]=b):b=e[40],b};function X(){C(!1)}function Y(){return C(!0),X}export{te as default};
