1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`45c765f0-a707-4bc5-a179-e983cbf32397`,e._sentryDebugIdIdentifier=`sentry-dbid-45c765f0-a707-4bc5-a179-e983cbf32397`)}catch{}})();import{C as e,Ct as t,D as n,G as r,O as i,S as a,Wt as o,b as s,h as c,it as l,x as u,y as d}from"./route-CITprrr5.js";import{b as f,k as p}from"./useProfileStore-CBaVsqDc.js";import{t as m}from"./BaseButton-DYUX4Air.js";import{t as h}from"./_plugin-vue_export-helper-CdgHZ22j.js";import{t as g}from"./useIconColor-B7ofuTEq.js";import{t as _}from"./useNotificationStore-DBeR6i7U.js";import{t as v}from"./useUserStore-C-5NSQ7j.js";var y=[`width`,`height`,`viewBox`],b=[`stroke`],x=i({__name:`ShareIcon`,props:{color:{type:String,default:``},width:{type:String,default:`20`},height:{type:String,default:`20`}},setup(n){let i=n,{color:a}=g(d(()=>i.color));return(i,o)=>(r(),e(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:n.width,height:n.height,viewBox:`0 0 ${n.width} ${n.height}`,fill:`none`},[s(`path`,{d:`M17.5 5H14.8333C13.4332 5 12.7331 5 12.1984 5.27248C11.728 5.51217 11.3455 5.89462 11.1058 6.36502C10.8333 6.8998 10.8333 7.59987 10.8333 9V10M17.5 5L15 2.5M17.5 5L15 7.5M8.33333 2.5H6.5C5.09987 2.5 4.3998 2.5 3.86502 2.77248C3.39462 3.01217 3.01217 3.39462 2.77248 3.86502C2.5 4.3998 2.5 5.09987 2.5 6.5V13.5C2.5 14.9001 2.5 15.6002 2.77248 16.135C3.01217 16.6054 3.39462 16.9878 3.86502 17.2275C4.3998 17.5 5.09987 17.5 6.5 17.5H13.5C14.9001 17.5 15.6002 17.5 16.135 17.2275C16.6054 16.9878 16.9878 16.6054 17.2275 16.135C17.5 15.6002 17.5 14.9001 17.5 13.5V11.6667`,stroke:t(a),"stroke-width":`1.66667`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,b)],8,y))}}),S=[`width`,`height`],C=[`stroke`],w=i({__name:`UserCheckIcon`,props:{color:{type:String,default:``},width:{type:String,default:`20`},height:{type:String,default:`20`}},setup(n){let i=n,{color:a}=g(d(()=>i.color));return(i,o)=>(r(),e(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:n.width,height:n.height,viewBox:`0 0 20 20`,fill:`none`},[s(`path`,{d:`M10.0003 12.9167H6.25033C5.08736 12.9167 4.50587 12.9167 4.03271 13.0602C2.96737 13.3834 2.13369 14.217 1.81053 15.2824C1.66699 15.7555 1.66699 16.337 1.66699 17.5M13.3337 15L15.0003 16.6667L18.3337 13.3333M12.0837 6.25C12.0837 8.32107 10.4047 10 8.33366 10C6.26259 10 4.58366 8.32107 4.58366 6.25C4.58366 4.17893 6.26259 2.5 8.33366 2.5C10.4047 2.5 12.0837 4.17893 12.0837 6.25Z`,stroke:t(a),"stroke-width":`1.66667`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,C)],8,S))}}),T=[`width`,`height`],E=[`stroke`],D=i({__name:`UserPlusIcon`,props:{color:{type:String,default:``},width:{type:String,default:`20`},height:{type:String,default:`20`}},setup(n){let i=n,{color:a}=g(d(()=>i.color));return(i,o)=>(r(),e(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:n.width,height:n.height,viewBox:`0 0 20 20`,fill:`none`},[s(`path`,{d:`M10.0003 12.9167H6.25033C5.08736 12.9167 4.50587 12.9167 4.03271 13.0602C2.96737 13.3834 2.13369 14.217 1.81053 15.2824C1.66699 15.7555 1.66699 16.337 1.66699 17.5M15.8337 17.5V12.5M13.3337 15H18.3337M12.0837 6.25C12.0837 8.32107 10.4047 10 8.33366 10C6.26259 10 4.58366 8.32107 4.58366 6.25C4.58366 4.17893 6.26259 2.5 8.33366 2.5C10.4047 2.5 12.0837 4.17893 12.0837 6.25Z`,stroke:t(a),"stroke-width":`1.66667`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,E)],8,T))}}),O=h(i({__name:`FollowButton`,props:{userId:{type:Number,default:null,required:!0},groupId:{type:Number,default:null},role:{type:String,default:``},isEventPage:{type:Boolean,default:!1},isLoggedIn:{type:Boolean,default:!1},isSmallSize:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:[`onSignIn`,`onUpdate`],setup(i,{expose:h,emit:g}){let y=i,b=g,x=v(),S=_(),C=d({get:()=>y.role,set:e=>e}),T=d(()=>C.value===f.FOLLOWER||C.value===f.MEMBER),E=d(()=>C.value===f.OWNER),O=d(()=>!T.value&&!E.value&&!C.value),k=d(()=>T.value&&!E.value);async function A(){if(!y.isLoggedIn){b(`onSignIn`);return}
1if(!(!y.userId||!y.groupId)){if(y.userId&&y.groupId&&await x.follow(y.userId,y.groupId),x.errorMessage){S.showErrorNotification(p.REFRESH_PAGE);return}S.showSuccessNotification(`Successfully followed this group.`),await x.getGroupRole(y.userId,y.groupId),b(`onUpdate`)}}async function j(){if(!(!y.userId||!y.groupId)){if(y.userId&&y.groupId&&await x.unfollow(y.userId,y.groupId),x.errorMessage){S.showErrorNotification(p.REFRESH_PAGE);return}S.showSuccessNotification(`Successfully unfollowed this group.`),await x.getGroupRole(y.userId,y.groupId),b(`onUpdate`)}}return h({handleFollowGroup:A}),(d,f)=>{let p=D,h=m,g=w;return i.isSmallSize?(r(),e(c,{key:0},[t(O)?(r(),u(h,{key:0,class:`small-follow-btn`,color:`gray`,variant:`subtle`,size:`sm`,disabled:i.isLoading||i.disabled,onClick:A},{tooltip:l(()=>[...f[0]||=[s(`p`,null,`Follow`,-1)]]),default:l(()=>[n(p)]),_:1},8,[`disabled`])):t(k)?(r(),u(h,{key:1,class:`small-follow-btn`,color:`gray`,variant:`subtle`,size:`sm`,disabled:i.isLoading||i.disabled,onClick:j},{tooltip:l(()=>[...f[1]||=[s(`p`,null,`Unfollow`,-1)]]),default:l(()=>[n(g)]),_:1},8,[`disabled`])):a(``,!0)],64)):(r(),e(c,{key:1},[t(O)?(r(),u(h,{key:0,class:o([{"follow-btn":!i.isEventPage}]),color:i.isEventPage?`gray`:`primary`,variant:i.isEventPage?`outlined`:`solid`,size:`sm`,disabled:i.isLoading||i.disabled,onClick:A},{tooltip:l(()=>[...f[2]||=[s(`p`,null,`Follow`,-1)]]),default:l(()=>[f[3]||=s(`span`,null,`Follow`,-1)]),_:1},8,[`class`,`color`,`variant`,`disabled`])):t(k)?(r(),u(h,{key:1,class:`follow-btn`,size:`sm`,color:`gray`,variant:`outlined`,disabled:i.isLoading||i.disabled,onClick:j},{tooltip:l(()=>[...f[4]||=[s(`p`,null,`Unfollow`,-1)]]),default:l(()=>[f[5]||=s(`span`,null,`Following`,-1)]),_:1},8,[`disabled`])):a(``,!0)],64))}}}),[[`__scopeId`,`data-v-ddb31ba8`]]);export{x as n,O as t}; 2//# sourceMappingURL=FollowButton---MT1RW9.js.map
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.