2 lines
13 KiB
JavaScript
2 lines
13 KiB
JavaScript
"use strict";(self.webpackChunklite=self.webpackChunklite||[]).push([[21],{24809:(e,n,t)=>{t.d(n,{A:()=>a});var r,i=t(96540);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},o.apply(null,arguments)}const a=function(e){return i.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),r||(r=i.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M4.385 12c0 .55.2 1.02.59 1.41.39.4.86.59 1.41.59s1.02-.2 1.41-.59c.4-.39.59-.86.59-1.41s-.2-1.02-.59-1.41a1.93 1.93 0 0 0-1.41-.59c-.55 0-1.02.2-1.41.59-.4.39-.59.86-.59 1.41m5.62 0c0 .55.2 1.02.58 1.41.4.4.87.59 1.42.59s1.02-.2 1.41-.59c.4-.39.59-.86.59-1.41s-.2-1.02-.59-1.41a1.93 1.93 0 0 0-1.41-.59c-.55 0-1.03.2-1.42.59s-.58.86-.58 1.41m5.6 0c0 .55.2 1.02.58 1.41.4.4.87.59 1.43.59s1.03-.2 1.42-.59.58-.86.58-1.41-.2-1.02-.58-1.41a1.93 1.93 0 0 0-1.42-.59c-.56 0-1.04.2-1.43.59s-.58.86-.58 1.41",clipRule:"evenodd"})))}},18841:(e,n,t)=>{t.r(n),t.d(n,{RightColumnContent:()=>p,useLoader:()=>m});var r=t(39181),i=t(96540),o=t(45458),a=t(54936),l={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserProfileRightColQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"username"}},type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userResult"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"username"},value:{kind:"Variable",name:{kind:"Name",value:"username"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"FragmentSpread",name:{kind:"Name",value:"UserProfileRightColumn_user"}}]}}]}}]}}].concat((0,o.A)(a.R.definitions))},c=t(98834),u=t(35460),d=t(5009),s=t(49287),m=function(e){var n=(0,u.m)(e),t=n.id,i=n.username;return(0,r.I)(l,{variables:{id:t,username:i},skip:!t&&!i})},p=function(e){var n=e.error,t=e.loading,r=e.data,o=(r=void 0===r?{}:r).userResult;return t||n||(0,d.H)(o)?null:i.createElement(s.Ne,{source:{name:"user_profile_page",authorId:o.id,dimension:"user_sidebar"}},i.createElement(c.Z,{user:o}))}},18599:(e,n,t)=>{t.d(n,{a:()=>E,r:()=>b});var r=t(96540),i=t(28899),o=t(87147),a=t(67476),l=t(5562),c=t(52290),u=t(86975),d=t(86527),s=t(36557),m=t(39),p=t(44402),f=t(56774),v=t(51260),g=t(90383),k=t(27715),y=t(60213),h=function(e){return{":hover span":{color:e.colorTokens.foreground.neutral.primary.base}}},w=function(e){return{position:"absolute",height:"42px",width:"100%",top:0,left:0,borderTopLeftRadius:"4px",borderTopRightRadius:"4px",backgroundImage:"url(".concat(e,")"),backgroundRepeat:"no-repeat",backgroundSize:"cover"}},b=5,E=function(e){var n,t,b=e.collection,E=e.trackingV2,x=b.name,S=b.description,C=b.customStyleSheet,T=b.slug,N=(0,y.z)(b),R=(0,v.au)()("ShowLiteCollectionFollowers",{collectionSlug:T||""}),I=(0,f.X)({entity:b,trackingV2:E}),D=(0,m.Z)({name:"heading",scale:"XS",clamp:2,fontWeight:"NORMAL",color:"NORMAL"}),L=(0,p.l)(),_=null!=C&&null!==(n=C.header)&&void 0!==n&&null!==(t=n.backgroundImage)&&void 0!==t&&t.id?(0,g.rP)({miroId:C.header.backgroundImage.id,strategy:g.qY.Resample}):null;return r.createElement(c.a,{width:"280px",display:"flex",flexDirection:"column",padding:"24px",position:"relative",ref:I},!!_&&r.createElement("div",{className:L(w(_))}),r.createElement(c.a,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"flex-end"},r.createElement(i.u,{size:64,collection:b,link:!0,showBorder:!!_}),r.createElement(c.a,null,r.createElement(o.E,{collection:b,buttonSize:"SMALL",buttonStyleFn:function(e){return e?"SUBTLE":"BRAND"},susiEntry:"follow_card",trackingV2:E}))),r.createElement(c.a,{marginTop:"12px",display:"flex",flexDirection:"column"},r.createElement(u.D,{href:N},r.createElement(c.a,{display:"flex",flexDirection:"column"},r.createElement("div",{className:L([D,{display:"block"}])},x))),r.createElement(c.a,{marginTop:"4px",display:"flex",flexDirection:"row"},r.createElement(s.kZ,{scale:"S",color:"LIGHTER"},"Publication"),r.createElement(l.d,{margin:"0 8px"}),r.createElement(d.N,{href:R,linkStyle:"SUBTLE",rules:h},r.createElement(s.kZ,{scale:"S",color:"DARKER",tag:"span"},(0,k.Ct)(b.subscriberCount||0)),r.createElement(s.kZ,{scale:"S",tag:"span"}," Followers")))),S&&r.createElement(c.a,{paddingTop:"12px"},r.createElement(s.kZ,{scale:"S",color:"DARKER",clamp:4},r.createElement(a.O,{wrapLinks:!0},S))))}},25760:(e,n,t)=>{t.d(n,{E:()=>o});var r=t(96540),i=t(52290),o=function(e){var n=e.children,t=e.marginTop,o=void 0===t?"40px":t,a=e.paddingBottom,l=void 0===a?"0px":a,c=e.showBorderBottom,u=void 0!==c&&c;return r.createElement(i.a,{marginTop:o,paddingBottom:l,borderBottom:u?"neutral.primary":"NONE"},n)}},60213:(e,n,t)=>{t.d(n,{u:()=>a,z:()=>l});var r=t(96540),i=t(39160),o=t(79959),a=function(){var e=(0,i.d4)((function(e){return e.navigation.currentLocation})),n=(0,i.d4)((function(e){return e.config.authDomain})),t=(0,o.fo)();return(0,r.useCallback)((function(r){var i=r.id,o=r.domain,a=function(e){var n=e.id,t=e.slug;return t?"/".concat(t):"/c/".concat(n)}({id:i,domain:o,slug:r.slug});if(t)return"https://".concat(n).concat(a);try{var l=new URL(e).port;if(o)return"https://".concat(o).concat(l?":".concat(l):"")}catch(e){}return"https://".concat(n).concat(a)}),[t])},l=function(e){return a()(e)}},39931:(e,n,t)=>{t.d(n,{p:()=>o});var r=t(60213),i=t(64122),o=function(e){var n=(0,r.u)(),t=(0,i.W)();return"Collection"===e.__typename?n(e):"User"===e.__typename?t(e):""}},24505:(e,n,t)=>{t.d(n,{y:()=>d});var r=t(58168),i=t(96540),o=t(5811),a=t(5863),l=t(62830),c=t(52290),u=t(57005),d=function(e){var n=e.children,t=e.innerPadding,d=void 0===t?{}:t,s=e.footerPadding,m=e.display,p=void 0===m?"block":m,f=(0,i.useRef)(0),v=(0,i.useRef)(null),g=(0,i.useRef)("stickyToTop"),k=(0,i.useRef)(null),y=(0,a.s)(),h=y.fullNavbarHeight,w=y.topNavUpsellHeight,b=y.addHeightChangeHandler,E=y.removeHeightChangeHandler;return(0,u.E)((function(){var e=function(e){var n=e.currentHeight;v.current&&k.current&&("notSticky"!==g.current&&(v.current.style.top="".concat(n,"px")),k.current.style.minHeight="calc(100vh - ".concat(n,"px)"))};return b(e),function(){E(e)}}),[]),(0,u.E)((function(){var e=function(){if(v.current){var e=window.scrollY>f.current;f.current=window.scrollY;var n=window.innerHeight,t=v.current.offsetHeight-n,r=l.oe;t<=20||(e?("notSticky"===g.current&&window.scrollY>=v.current.offsetTop+t+r+w&&(g.current="stickyToBottom",v.current.style.position="sticky",v.current.style.top="".concat(-t,"px")),"stickyToTop"===g.current&&(g.current="notSticky",v.current.style.position="relative",v.current.style.top="0px",v.current.style.marginTop="0px",v.current.style.marginTop="".concat(Math.max(f.current-v.current.offsetTop,0),"px"))):("notSticky"===g.current&&window.scrollY<=v.current.offsetTop&&(g.current="stickyToTop",v.current.style.position="sticky",v.current.style.top="".concat(r+w,"px"),v.current.style.marginTop="0px"),"stickyToBottom"===g.current&&(g.current="notSticky",v.current.style.position="relative",v.current.style.top="0px",v.current.style.marginTop="0px",v.current.style.marginTop="".concat(f.current-t-v.current.offsetTop-r-w,"px"))))}};return window.addEventListener("scroll",e),function(){window.removeEventListener("scroll",e)}}),[w]),i.createElement(c.a,{position:"sticky",top:"".concat(h,"px"),ref:v,display:p},i.createElement(c.a,(0,r.A)({display:"flex",flexDirection:"column",minHeight:"calc(100vh - ".concat(h,"px)"),ref:k},d),i.createElement(c.a,{flexGrow:"1"},n),i.createElement(o.j,{detailScale:"XS",spacing:"XS",padding:s})))}},85764:(e,n,t)=>{t.d(n,{JX:()=>k,Ke:()=>g,OW:()=>v,P2:()=>d,Yg:()=>s,b5:()=>m,bD:()=>p,dX:()=>y,ix:()=>f,sP:()=>u});var r=t(55127),i=t.n(r),o=t(96540),a=t(2550),l=t(42976),c=t(90383),u=function(){var e=(0,a.A)().viewerId;return(0,o.useCallback)((function(n){return e===n}),[e])},d=function(e){return u()(e)},s=function(e){return(0,c.rP)({miroId:e.thumbnailImage})},m=function(e){var n=e.postItemsCount;return n>0?"".concat(e.postItemsCount," ").concat(i()("story",n)):""},p=function(){return"This story is no longer available"},f=function(e){var n;return"Post"===(null===(n=e.entity)||void 0===n?void 0:n.__typename)&&e.entity.visibility===l.dL.UNLISTED},v=60,g=280;function k(e){return!!e&&e.length>g}function y(e){return e.length>v}},28899:(e,n,t)=>{t.d(n,{u:()=>v});var r=t(96540),i=t(60213),o=t(7580),a=t(90280),l=t(86975),c=t(12378),u=t(44402),d=t(18642),s=t(90383),m=function(e){return function(n){return{borderRadius:(0,c.c)(n.borderRadius.regular),width:(0,c.c)(e),height:(0,c.c)(e),backgroundColor:n.colorTokens.background.neutral.secondary.base}}},p=function(e,n){return function(t){return{borderRadius:(0,c.c)(t.borderRadius.regular),display:"block",height:"".concat(e,"px"),width:"".concat(e,"px"),position:"absolute",top:0,boxShadow:"inset 0 0 0 1px ".concat((0,d.qy)(.05)),":hover":{backgroundColor:n?(0,d.qy)(.1):"none"}}}},f=function(e){return{position:"relative",border:e?"2px solid white":void 0,borderRadius:e?"6px":void 0,display:e?"inline-block":"flex"}},v=function(e){var n=e.circular,t=e.collection,c=e.size,d=void 0===c?60:c,v=e.link,g=e.showHoverState,k=e.showBorder,y=void 0!==k&&k,h=(0,i.z)(t),w=(0,u.l)();if(!t||!t.avatar||!t.avatar.id)return null;var b=t.avatar.id,E=t.name||"Publication avatar",x=n?r.createElement(o.r,{miroId:b,alt:E,diameter:d,freezeGifs:!1,showHoverState:g}):r.createElement("div",{className:w(f(y))},r.createElement(a.pg,{rules:[m(d)],miroId:b,alt:E,width:d,height:d,strategy:s.qY.Crop}),r.createElement("div",{className:w(p(d,g))}));return v?r.createElement(l.D,{href:h},x):x}},87147:(e,n,t)=>{t.d(n,{E:()=>E});var r=t(80296),i=t(95420),o=t(96540),a=t(54239),l=t(26679),c=t(34208),u=t(2550),d=t(52764),s=t(86329),m=t(43634),p=t(15473),f=t(86527),v=t(52290),g=t(99731),k=t(72130),y=t(49287),h=t(51260),w=t(39160),b=t(46879),E=function(e){var n,t=e.buttonSize,b=e.buttonStyleFn,E=e.collection,S=e.post,C=e.simpleLink,T=e.susiEntry,N=void 0===T?"follow_card":T,R=e.preventParentClick,I=e.width,D=e.trackingV2,L=(0,w.d4)((function(e){return e.config.authDomain})),_=(0,u.A)().viewerId,A=(0,k.$L)(),B=(0,y.jI)(),F=(0,a.zy)(),H=(0,h.W5)(F.pathname),V=null==H||null===(n=H.route)||void 0===n?void 0:n.name,P=(0,s.J)(E),U=P.viewerEdge,z=P.loading,O=function(e,n){var t=(0,i.n)(c.j),a=(0,r.A)(t,1)[0];return o.useCallback((function(){return a({variables:{id:e.id},optimisticResponse:{followCollection:{__typename:"Collection",id:e.id,name:e.name,viewerEdge:{__typename:"CollectionViewerEdge",id:"collectionId:".concat(e.id,"-viewerId:").concat(n),isFollowing:!0}}},update:function(t){t.modify({id:"User:".concat(n),fields:{missionControl:(0,p.A4)("followedCollections",!0),followingCollectionConnection:(0,p.CQ)(e.id)}})}})}),[e.id])}(E,_),M=function(e,n){var t=(0,i.n)(c.E),a=(0,r.A)(t,1)[0];return o.useCallback((function(){return a({variables:{id:e.id},optimisticResponse:{unfollowCollection:{__typename:"Collection",id:e.id,name:e.name,viewerEdge:{__typename:"CollectionViewerEdge",id:"collectionId:".concat(e.id,"-viewerId:").concat(n),isFollowing:!1}}},update:function(e){e.modify({id:"User:".concat(n),fields:{missionControl:(0,p.A4)("followedCollections",!1)}})}})}),[e.id])}(E,_),Z=o.useCallback((function(e){R&&e.preventDefault(),A.event("collection.followed",{collectionId:E.id,followSource:B,trackingV2:D,source:B}),O()}),[E,R,B,A,D]),Y=o.useCallback((function(e){R&&e.preventDefault(),A.event("collection.unfollowed",{collectionId:E.id,followSource:B,trackingV2:D,source:B}),M()}),[R,B,A,D]),j=!(null==U||!U.isFollowing),X=b?b(!!j):j?"OBVIOUS":"STRONG";return C?o.createElement(f.N,{onClick:j?Y:Z},o.createElement(v.a,{display:"flex",flexDirection:"row"},j?"Unfollow publication":"Follow publication")):o.createElement(d.c,null,(function(e){return e?o.createElement(g.$n,{size:t,onClick:j?Y:Z,buttonStyle:X,loading:z,width:I},j?"Following":"Follow"):o.createElement(m.r,{collection:E,buttonStyle:X,isButton:!0,buttonSize:t,operation:"register",actionUrl:x(L,E,S)||"",susiEntry:N,pageSource:(0,l.x)(V,"register"),buttonWidth:I},j?"Following":"Follow")}))},x=function(e,n,t){return n.slug&&(t&&t.id?(0,b.PdS)(e,n.slug,t.id):(0,b.xNA)(e,n.slug))}},46445:(e,n,t)=>{t.d(n,{T:()=>s});var r=t(58168),i=t(80045),o=t(96540),a=t(52290),l=t(56942),c=t(36557),u=t(64314),d=["children","titleText"],s=function(e){var n,t=e.children,s=e.titleText,m=(0,i.A)(e,d),p="confirmDialogTitle",f=null!==(n=m.testId)&&void 0!==n?n:void 0;return o.createElement(u.m,(0,r.A)({},m,{ariaLabelledBy:p}),o.createElement(l.DZ,{ariaLabelledById:p,scale:{xs:"M",sm:"M",md:"L",lg:"L",xl:"L"},testId:f},s),o.createElement(a.a,{paddingTop:"6px",paddingBottom:"36px"},o.createElement(c.kZ,{scale:{xs:"M",sm:"M",md:"L",lg:"L",xl:"L"},tag:"div"},t)))}}}]);
|
||
//# sourceMappingURL=https://stats.medium.build/lite/sourcemaps/UserProfilePage.RightColumnContent.849aaa43.chunk.js.map
|