1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3825],{12295:function(e,n,r){var o=r(47568),s=r(26042),t=r(69396),l=r(828),i=r(20414),a=r(85893),u=r(60357),c=r.n(u),d=r(67294),f=r(11163),h=r(60253),v=r(36808),x=r.n(v),p=r(72091),b=r(17812),j=r(22318),w=r(91910),g=r(48777),m=r(49384),Z=r(61164),k=r(92674),I=r(40570);n.Z=function(e){var n=e.user,r=e.onUserUpdate,u=(0,f.useRouter)(),v=(0,h.$G)().t,y=(0,p.Ds)().enqueueSnackbar,D=(0,l.Z)((0,Z.o)(),1)[0],E=D.auth,C=D.isIntersectionObserverEnabled,F=(0,k.Z)(),S=d.useRef(null),U=(0,l.Z)(d.useState(!1),2),_=U[0],N=U[1],M=(0,l.Z)(d.useState(),2),T=M[0],B=M[1],G=(0,l.Z)(d.useState(!1),2),O=G[0],P=G[1],R=(0,l.Z)(d.useState(!1),2),A=R[0],$=R[1],L=!(!E||!(null===T||void 0===T?void 0:T.length)),W=d.useMemo((function(){return!(E&&!T)&&((null===E||void 0===E?void 0:E.ID)!==(null===n||void 0===n?void 0:n.ID)&&!(null===n||void 0===n?void 0:n.DeletedAt))}),[E,T,null===n||void 0===n?void 0:n.DeletedAt,null===n||void 0===n?void 0:n.ID]),q=d.useCallback((function(e){e.isIntersecting&&($(!0),N(!0),(null===n||void 0===n?void 0:n.ID)?F("/auth/user/".concat(n.ID,"/follower"),{method:"GET"}).then((function(e){if(null===e)throw new Error("newFollowers is null");B(e)})).catch((function(e){(0,m.kg)(e)})).finally((function(){N(!1)})):(0,m.kg)("user.ID is undefined"))}),[F,null===n||void 0===n?void 0:n.ID]);d.useEffect((function(){if(E&&C&&!A){var e=S.current;if(e){var n=new IntersectionObserver((function(e){e.forEach(q)}),{root:null,rootMargin:"400px",threshold:0});return n.observe(e),function(){n.unobserve(e)}}}}),[E,q,A,C]);var z=d.useCallback((function(){return P(!0)}),[]),H=d.useCallback((function(){return P(!1)}),[]),J=d.useCallback((0,o.Z)((function(){var e,o;return(0,i.__generator)(this,(function(l){switch(l.label){case 0:N(!0),l.label=1;case 1:return l.trys.push([1,6,,7]),E?[3,3]:(x().set("return_to",u.asPath,{expires:1,secure:!0,sameSite:"lax"}),[4,u.push("/signup")]);case 2:return l.sent(),[2];case 3:return E.Unconfirmed?(x().set("return_to",u.asPath,{expires:1,secure:!0,sameSite:"lax"}),[4,u.push("/auth/unconfirmed")]):[3,5];case 4:return l.sent(),[2];case 5:return[3,7];case 6:return e=l.sent(),(0,m.kg)(e),y(v("failed-to-follow"),{variant:"error"}),N(!1),[2];case 7:if(l.trys.push([7,9,,10]),!(null===n||void 0===n?void 0:n.ID))throw new Error("user.ID is undefined");return[4,F("/auth/user/".concat(n.ID,"/follower"),{method:"POST"})];case 8:return l.sent(),B([{}]),null===r||void 0===r||r((0,t.Z)((0,s.Z)({},n),{FollowerCount:(n.FollowerCount||0)+1})),[3,10];case 9:return o=l.sent(),(0,m.kg)(o),y(v("failed-to-follow"),{variant:"error"}),N(!1),[2];case 10:return N(!1),[2]}}))})),[E,y,F,r,u,v,n]),K=d.useCallback((0,o.Z)((function(){var e;return(0,i.__generator)(this,(function(o){switch(o.label){case 0:N(!0),o.label=1;case 1:if(o.trys.push([1,3,,4]),!(null===n||void 0===n?void 0:n.ID))throw new Error("user.ID is undefined");return[4,F("/auth/user/".concat(n.ID,"/follower"),{method:"DELETE"})];case 2:return o.sent(),B([]),null===r||void 0===r||r((0,t.Z)((0,s.Z)({},n),{FollowerCount:(n.FollowerCount||1)-1})),[3,4];case 3:return e=o.sent(),(0,m.kg)(e),y(v("failed-to-unfollow"),{variant:"error"}),N(!1),[2];case 4:return N(!1),[2]}}))})),[y,F,r,v,n]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{ref:S,className:"jsx-e20212abf16b2b5 sm",children:[(0,a.jsx)(j.Z,{component:"div",variant:"caption",style:{opacity:W?1:.38,marginBottom:"-8px",textAlign:"center"},children:v("follow")}),L&&(0,a.jsx)(b.Z,{disabled:_,onClick:K,children:(0,a.jsx)(w.Z,{style:{color:"#FFEB3B"}})}),!L&&(0,a.jsx)(b.Z,{disabled:_||!W,onClick:J,children:(0,a.jsx)(g.Z,{})})]}),(0,a.jsxs)("div",{ref:S,className:"jsx-e20212abf16b2b5 lg",children:[L&&(0,a.jsx)(I.Z,{color:O?"error":"default",disabled:_,variant:O?"contained":"outlined",style:{borderRadius:"18px"},onClick:K,onMouseEnter:z,onMouseLeave:H,children:v(O?"unfollow":"following")}),!L&&(0,a.jsx)(I.Z,{color:"primary",disabled:_||!W,variant:"contained",style:{borderRadius:"18px"},onClick:J,children:v("follow")})]}),(0,a.jsx)(c(),{id:"e20212abf16b2b5",children:".lg.jsx-e20212abf16b2b5{display:none}@media(min-width:360px){.sm.jsx-e20212abf16b2b5{display:none}.lg.jsx-e20212abf16b2b5{display:block}}"})]})}},63052:function(e,n,r){var o=r(828),s=r(85893),t=r(60357),l=r.n(t),i=r(67294),a=r(60253),u=r(49384),c=r(61164),d=r(92674);n.Z=function(e){var n=e.user,r=(0,a.$G)().t,t=(0,o.Z)((0,c.o)(),1)[0],f=t.auth,h=t.isIntersectionObserverEnabled,v=(0,d.Z)(),x=i.useRef(null),p=(0,o.Z)(i.useState(),2),b=p[0],j=p[1],w=(0,o.Z)(i.useState(!1),2),g=w[0],m=w[1],Z=i.useCallback((function(e){e.isIntersecting&&(m(!0),(null===n||void 0===n?void 0:n.ID)?v("/auth/user/".concat(n.ID,"/following-user"),{method:"GET"}).then((function(e){if(null===e)throw new Error("newFollowingUsers is null");j(e)})).catch((function(e){(0,u.kg)(e)})):(0,u.kg)("user.ID is undefined"))}),[v,null===n||void 0===n?void 0:n.ID]);return i.useEffect((function(){if(f&&h&&!g){var e=x.current;if(e){var n=new IntersectionObserver((function(e){e.forEach(Z)}),{root:null,rootMargin:"400px",threshold:0});return n.observe(e),function(){n.unobserve(e)}}}}),[f,Z,g,h]),(null===b||void 0===b?void 0:b.length)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"jsx-1407cc0596a3aa55",children:r("is-following-you")}),(0,s.jsx)(l(),{id:"1407cc0596a3aa55",children:"span.jsx-1407cc0596a3aa55{background-color:#eee}"})]}):(0,s.jsx)("span",{ref:x})}},3825:function(e,n,r){var o=r(85893),s=r(60357),t=r.n(s),l=r(67294),i=r(60253),a=r(50998),u=r(96353),c=r(95757),d=r(90227),f=r(12295),h=r(63052),v=r(57308),x=r(13637);n.Z=function(e){var n=e.user,r=e.onUserUpdate,s=(0,i.$G)().t,p=l.useMemo((function(){return n.ID?"/user/".concat(n.ID.toString(36)):""}),[n.ID]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"jsx-671eda0c2536e770 container",children:[(0,o.jsx)(v.Z,{href:p,children:(0,o.jsxs)(a.Z,{alignItems:"flex-start",button:!0,children:[(0,o.jsx)(u.Z,{children:(0,o.jsx)("div",{className:"jsx-671eda0c2536e770 placeholder"})}),(0,o.jsx)(c.Z,{primary:n.Name||s("guest"),primaryTypographyProps:{noWrap:!0},secondary:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(h.Z,{user:n}),(null===n||void 0===n?void 0:n.Bio)&&(0,o.jsx)(x.Z,{lines:4,children:n.Bio})]}),secondaryTypographyProps:{component:"div"},style:{overflowWrap:"break-word"}}),(0,o.jsx)("div",{onClick:function(e){return e.preventDefault()},className:"jsx-671eda0c2536e770 follow",children:(0,o.jsx)(f.Z,{user:n,onUserUpdate:r})})]})}),(0,o.jsx)(d.Z,{user:n,onUserUpdate:r,style:{position:"absolute",top:"16px",left:"16px"}})]}),(0,o.jsx)(t(),{id:"671eda0c2536e770",children:".container.jsx-671eda0c2536e770{position:relative}.placeholder.jsx-671eda0c2536e770{display:inline-block;width:40px;height:40px}.follow.jsx-671eda0c2536e770{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;margin-left:8px}@media(min-width:360px){.follow.jsx-671eda0c2536e770{margin-top:10px}}"})]})}}}]);
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.