"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["3983"],{60648:function(e,t,n){n.d(t,{Z:()=>i});let i={input:"input-qHk4bN",form:"form-CkZ7Kt"}},50137:function(e,t,n){n.d(t,{Z:()=>a});var i=n(7409),r=n(99282),o=n(16584),l=n(64515);let a=e=>(0,o.tZ)(l.l,(0,r._)((0,i._)({},e),{name:"NoteForwardIcon",svgParams:{height:24,width:24,stroke:e.stroke,strokeWidth:e.strokeWidth},children:(0,o.tZ)("path",{d:"M21 3V8M21 8H16M21 8L18 5.29962C16.7056 4.14183 15.1038 3.38328 13.3879 3.11547C11.6719 2.84766 9.9152 3.08203 8.32951 3.79031C6.74382 4.49858 5.39691 5.65051 4.45125 7.10715C3.5056 8.5638 3.00158 10.2629 3 11.9996M3 21V16M3 16H8M3 16L6 18.7C7.29445 19.8578 8.89623 20.6163 10.6121 20.8841C12.3281 21.152 14.0848 20.9176 15.6705 20.2093C17.2562 19.501 18.6031 18.3491 19.5487 16.8925C20.4944 15.4358 20.9984 13.7367 21 12",strokeLinecap:"round","stroke-linejoin":"round"})}))},6498:function(e,t,n){n.d(t,{R:()=>c});var i=n(16584),r=n(347),o=n(7523),l=n(95441),a=n(83225),d=n(80026);let c=e=>{let{comments:t,post:n,commentId:a,notAllowedToFetchComments:c,handleSort:u,publication:h,sort:m,sortMenuUseMobileBottomSheet:p}=e,{iString:Z}=(0,l.M1)();return(0,i.BX)(r.h,{children:[(0,i.BX)(d.gq,{alignItems:"baseline",flex:"grow",gap:8,position:"relative",children:[(0,i.tZ)(o.Z,{preset:"st4",children:Z("Comments")}),(0,i.tZ)("div",{className:"mediumRule-B78a2B"}),(null==t?void 0:t.length)&&(null==t?void 0:t.length)>0?(0,i.tZ)(o.Z,{color:"accent",preset:"st4",children:n.comment_count}):null]}),(0,i.BX)(d.xu,{className:"sortOptionsContainer-bIIUcJ",children:[!c&&(0,i.tZ)(o.Z,{align:"left",as:"a",color:"tertiary",href:"/p/community-guidelines",preset:"detail-small",style:{textDecoration:"underline"},children:Z("Community Guidelines")}),t&&(null==t?void 0:t.length)>1&&!c&&!a&&(0,i.tZ)(s,{comments:t,handleSort:u,publication:h,sort:m,useMobileBottomSheet:p})]})]})},s=e=>{let{publication:t,handleSort:n,sort:r,comments:o,useMobileBottomSheet:l}=e;return t&&n&&r?(0,i.tZ)(a.$,{currentSort:r,handleSort:n,isLoading:!o,pub:t,useMobileBottomSheet:l}):null}},57626:function(e,t,n){n.d(t,{C:()=>m});var i=n(16584),r=n(18787),o=n(74626),l=n(6498),a=n(7523),d=n(95441),c=n(71068),s=n(19081),u=n(60308),h=n(47929);let m=e=>{let{post:t,publication:n,user:m,freeSignupEmail:p=null,showHeader:Z=!1}=e,{iString:b}=(0,d.M1)(),f=m&&m.email||p||null,v=(0,u.Zs0)(n,{simple:!0,next:document.location.href,utm_source:h.b3.paywall,utm_medium:h.lP.web,utm_content:t?t.id:null,just_signed_up:!1}),g=async()=>{window.location.href=v};return(0,i.BX)(s.tu,{className:"container-u0f9W_",children:[Z&&(0,i.tZ)(l.R,{notAllowedToFetchComments:!0,post:t,publication:n}),(0,i.tZ)(c.xu,{className:"commentsPaywall-ASd8iy",children:(0,i.BX)(s.tu,{alignItems:"center",gap:24,paddingX:24,paddingY:40,children:[(0,i.tZ)(a.Z,{color:"white",preset:"h4-sans-condensed",children:b("Join the conversation")}),(0,i.tZ)(a.Z,{color:"white",preset:"d3-serif",children:b("Share your thoughts and connect with other readers by becoming a paid subscriber!")}),(0,i.tZ)(o._,{variant:"inverse",onClick:g,children:b("Upgrade today")}),(0,i.BX)(a.Z,{as:"a",color:"white",href:(0,u.W1P)(n,{isSignInAttempt:!0}),native:!0,preset:"caption",children:[(0,r.qV)({post:t,publication:n})," ",(0,i.tZ)("u",{children:b(f?"Switch accounts":"Sign in")})]})]})})]})}},48479:function(e,t,n){n.d(t,{H:()=>N,U:()=>S});var i=n(27412),r=n(58865),o=n(16584),l=n(6400),a=n(80569),d=n.n(a),c=n(60826),s=n(56219),u=n(94442),h=n(11712),m=n(89276),p=n(74648),Z=n(58319),b=n(95441),f=n(75905),v=n(90099),g=n(68833),y=n(98914),_=n(6070),C=n(31377),w=n(60308),k=n(84864),B=n(47929);function x(){let e=(0,r._)(["This thread is only visible to "," subscribers of ",""]);return x=function(){return e},e}class M extends l.Component{onTopReached(){this.state.topReached||(this.setState({topReached:!0}),(0,g.j)(g.FP.POST_SEEN,{post_id:this.props.post.id,post_audience:this.props.post.audience,post_type:this.props.post.type}))}onBottomReached(){this.state.bottomReached||(this.setState({bottomReached:!0}),(0,g.j)(g.FP.POST_BOTTOM_SEEN,{post_id:this.props.post.id,post_audience:this.props.post.audience,post_type:this.props.post.type}))}async enableEmailNotifications(){try{await d().post("/api/v1/post/".concat(this.props.post.id,"/subscribe")),window.location.reload()}catch(e){console.error("Failed to subscribe to email notifications:",e),alert((0,y.zx)(e))}}render(e){let t,n,{className:i,pub:r,post:a,user:d,freeSignup:b,freeSignupEmail:f,isStatic:g,hidden:y,truncated:M,invisible:N,post_reaction_token:S,onChange:X,showCta:E=M,showUnsubscribeNotice:R,dataForEmailRender:P={},showReactions:z=!0,gap:I=16,iString:H,iTemplate:T,iPlural:L,language:F,showShare:A}=e;"boolean"!=typeof y&&(y=a.hidden),y?(t=H("Subscribe to view"),n=(0,w.n1t)("/subscribe",{simple:!0,next:document.location.href,utm_source:B.b3.thread,utm_medium:B.lP.web,utm_content:a.id})):(n=(0,w.uRy)(r,a,{noBase:!0}),t="thread"!==a.type||M?(0,k.getPostCtaText)(a,F):a.comment_count?L("View 1 comment","View %1 comments",a.comment_count):H("Reply"));let V=g&&!this.context.isAmp,U=(0,_.HD)({pub:r}),J=U?m.j:l.Fragment;return(0,o.tZ)(v.YF,{className:"thread-head typography ".concat(i||""),children:(0,o.tZ)("tr",{children:(0,o.tZ)("td",{children:(0,o.BX)(v.i$,{width:"100%",children:[!N&&!y&&(0,o.tZ)(Z.Z,{onVisible:()=>this.onTopReached()}),(0,o.BX)(v.i$,{gap:I,width:"100%",children:[E&&U&&(0,o.tZ)(p.Q,{post:a,ctaUrl:n,ctaText:t,hidden:y}),(0,o.tZ)(s.mV,{pub:r,post:a,user:d,isStatic:g,reaction_token:S,allowEdit:!0,allowTruncate:M,showReactions:!!E||z,showShare:A,showComments:!!a.comment_count,inThreadHead:!0,onChange:X,showLabel:!0}),(0,o.tZ)(J,{inThreadHead:!0,children:(0,o.tZ)(h.Z,{user:d,freeSignup:b,freeSignupEmail:f,pub:r,post:a,html:y||M||!a.body_html?null:a.body_html,isStatic:g,dataForEmailRender:P,children:y?(0,o.tZ)("p",{children:(0,o.tZ)("i",{children:T(x(),(0,C.isFoundingAudience)(a.audience)?"founding":"paid",r.name)})}):M?(0,o.tZ)("p",{children:a.description}):null})}),E?!U&&(0,o.BX)("a",{className:"thread-head-cta",href:n,native:!0,children:[t," →"]}):y&&(0,o.BX)("p",{className:"thread-head-cta",children:[(0,o.tZ)("a",{href:(0,w.W1P)(r,{simple:!0,next:document.location.href,utm_source:B.b3.thread,utm_medium:B.lP.web,utm_content:a.id}),className:"button primary subscribe-btn",native:!g,children:(0,k.getSubscribeText)(r)}),(0,o.tZ)("a",{href:(0,w.uXE)({for_pub:r.subdomain}),className:"button",native:!0,children:H("Sign in")})]})]}),V&&(0,o.BX)(v.i$,{gap:I,style:{width:"100%"},children:[(0,o.tZ)(v.i$,{style:{width:"100%",textAlign:"center"},children:(0,o.tZ)("a",{role:"button",className:"button primary",style:{margin:"0 auto"},href:c.W.HALF_MAGIC_COMMENTS_URL,children:H("See the discussion")})}),(0,o.tZ)(u.yT,{isFooter:!0,customization:{showShare:!0,showComments:!0,showReactions:{showReactions:z},showRestack:!1,showLabels:!0,showCommentRestack:!r.hide_post_restacks}})]}),R&&a.unsubscribed&&(0,o.BX)("div",{className:"notifications-alert",children:[H("Email notifications are disabled for this thread.")," ",(0,o.tZ)("a",{href:"javascript:void(0)",onClick:()=>this.enableEmailNotifications(),children:H("Re-enable")})]}),!N&&!y&&(0,o.tZ)(Z.Z,{onVisible:()=>this.onBottomReached()})]})})})})}}(0,i._)(M,"contextType",f.E);let N=(0,b.fz)(M);class S extends l.Component{render(){return(0,o.BX)("div",{className:"thread-head-silhouette",children:[(0,o.tZ)("div",{className:"thread-head-silhouette-head"}),(0,o.BX)("div",{className:"thread-head-silhouette-content",children:[(0,o.tZ)("div",{className:"thread-head-silhouette-title"}),(0,o.tZ)("div",{className:"thread-head-silhouette-meta"}),(0,o.BX)("div",{className:"thread-head-silhouette-body",children:[(0,o.tZ)("div",{className:"thread-head-silhouette-body-line"}),(0,o.tZ)("div",{className:"thread-head-silhouette-body-line"}),(0,o.tZ)("div",{className:"thread-head-silhouette-body-line"})]})]})]})}}},95434:function(e,t,n){n.d(t,{Gg:()=>R});var i=n(58865),r=n(16584),o=n(30396),l=n(24830),a=n(17048),d=n(80569),c=n.n(d),s=n(95441),u=n(80449),h=n(94874),m=n(71068),p=n(15771),Z=n(19081),b=n(1844),f=n(6490),v=n(65523),g=n(98248),y=n(17688),_=n(43570),C=n(58175),w=n(65252),k=n(98012);function B(){let e=(0,i._)(["Ban or suspend ",""]);return B=function(){return e},e}function x(){let e=(0,i._)(["Prevent this person from commenting on your publication in the future."]);return x=function(){return e},e}function M(){let e=(0,i._)(["Ban ",""]);return M=function(){return e},e}function N(){let e=(0,i._)(["Previously banned "," time(s), last on ",""]);return N=function(){return e},e}function S(){let e=(0,i._)([""," is permanently banned."]);return S=function(){return e},e}function X(){let e=(0,i._)([""," is banned until ","."]);return X=function(){return e},e}function E(){let e=(0,i._)(["Leave a reply"]);return E=function(){return e},e}let R=e=>{var t,n,i,l;let{comment:a,onReply:d,onBan:c,onClose:s}=e,{sub:u,loading:h,bans:m,bansHistory:p,error:Z,submitBan:b}=T(a,c),v=(0,w.mr)(),g=null===(t=v[1])||void 0===t?void 0:t[0],[y,_]=(0,o.eJ)(g),[C,B]=(0,o.eJ)(w.ol.VISIBLE),x=!!a||h,M=null!==(l=null===(i=v.find(e=>{let[t]=e;return t===y}))||void 0===i?void 0:null===(n=i[1])||void 0===n?void 0:n.toLowerCase())&&void 0!==l?l:"",N=m.filter(e=>(0,k.Z)(e.expiry).isAfter((0,k.Z)()));return(0,r.BX)(f.u_,{isOpen:x,onClose:s,children:[0===N.length&&(0,r.tZ)(P,{comment:a,sub:u,bans:m,bansHistory:p,loading:h,error:Z,selectedExpiry:y,setSelectedExpiry:_,selectedCommentVisibility:C,setSelectedCommentVisibility:B,expiryText:M,onClose:s,submitBan:b}),N.length>0&&(0,r.tZ)(H,{comment:a,bans:m,onClose:s,onReply:()=>{d&&a&&(d(a.id),s())}})]})},P=e=>{var t,n;let{comment:i,sub:o,bans:l,bansHistory:a,loading:d,error:c,selectedExpiry:u,setSelectedExpiry:m,selectedCommentVisibility:v,setSelectedCommentVisibility:k,expiryText:N,onClose:S,submitBan:X}=e,{iString:E,iTemplate:R}=(0,s.M1)(),P=(0,w.mr)(),H=(0,w.FG)();return(0,r.BX)(r.HY,{children:[(0,r.tZ)(f.xB,{showClose:!0,onClose:S,title:R(B(),null!==(t=null==i?void 0:i.name)&&void 0!==t?t:"user"),showDivider:!0,alignItems:"center",icon:(0,r.tZ)(h.qE,{photoUrl:null!==(n=null==i?void 0:i.photo_url)&&void 0!==n?n:void 0,size:56}),description:(0,r.BX)(Z.sg,{alignItems:"center",gap:8,children:[(null==o?void 0:o.is_subscribed)&&(0,r.tZ)(_.Vp,{priority:"secondary",children:E("Paid subscriber")}),(0,r.tZ)(C.xv,{children:R(x())})]})}),(0,r.tZ)(f.fe,{children:(0,r.BX)(Z.sg,{gap:20,children:[(0,r.tZ)(I,{bans:l,bansHistory:a}),c&&(0,r.tZ)(b.y,{children:E("An error occurred. Please try again.")}),d&&(0,r.tZ)(g.$j,{padding:32,alignItems:"center",justifyContent:"center"}),!d&&(0,r.BX)(r.HY,{children:[(0,r.BX)(z,{children:[(0,r.tZ)(C.xv.B3,{weight:"semibold",children:E("Ban duration")}),(0,r.BX)(y.i,{name:"expiry",value:u,onChange:e=>{m(e.target.value)},children:[(0,r.tZ)(y.d,{children:E("Select a duration")}),P.map(e=>{let[t,n]=e;return(0,r.tZ)("option",{value:t,children:null==n?void 0:n.replace(/^For /,"")})})]})]}),(0,r.BX)(z,{children:[(0,r.tZ)(C.xv.B3,{weight:"semibold",children:E("Delete comments")}),(0,r.BX)(y.i,{name:"comment_visibility",value:v,onChange:e=>{k(e.target.value)},children:[(0,r.tZ)(y.d,{children:E("Select whether to delete comments")}),H.map(e=>{let[t,n]=e;return(0,r.tZ)("option",{value:t,children:n})})]})]})]})]})}),(0,r.tZ)(f.mz,{direction:"column",showDivider:!0,primaryButton:(0,r.tZ)(p.zx,{priority:"destructive",onClick:()=>X(u,v),children:R(M(),N)})})]})},z=(0,m.zo)({display:"flex",justifyContent:"space-between",alignItems:"center"}),I=e=>{let{bans:t,bansHistory:n}=e,{iTemplate:i}=(0,s.M1)();if(!t[0])return null;let o=n.length?n.length:t.filter(e=>e.user_id).length;return(0,r.tZ)(u.b,{title:i(N(),o,(0,k.Z)(t[0].start).standardDatetimeWithYear()),theme:"default",priority:"secondary",Icon:l.Z,showClose:!1})},H=e=>{var t,n;let{comment:i,bans:o,onClose:l,onReply:d}=e,{iString:c,iTemplate:u}=(0,s.M1)(),h=o.find(e=>e.user_id),m=h&&(0,k.Z)(h.expiry).isAfter((0,k.Z)().add(100,"years"))?u(S(),null!==(t=null==i?void 0:i.name)&&void 0!==t?t:"This user"):u(X(),null!==(n=null==i?void 0:i.name)&&void 0!==n?n:"This user",(0,k.Z)(null==h?void 0:h.expiry).standardDatetimeWithYear());return h?(0,r.BX)(r.HY,{children:[(0,r.tZ)(f.xB,{title:m,alignItems:"center",icon:(0,r.tZ)(v.AM,{icon:(0,r.tZ)(a.Z,{})}),showClose:!0,onClose:l,description:c("We recommend leaving a reply to tell them why they are banned, and to let other readers know what kinds of comments are not acceptable.")}),(0,r.tZ)(f.ex,{}),(0,r.tZ)(f.mz,{direction:"column",primaryButton:(0,r.tZ)(p.zx,{priority:"primary-mono",onClick:d,children:u(E())})})]}):null},T=(e,t)=>{let[n,i]=(0,o.eJ)(null),[r,l]=(0,o.eJ)(!1),[a,d]=(0,o.eJ)([]),[s,u]=(0,o.eJ)([]),[h,m]=(0,o.eJ)(null),p=e=>{e.forEach(t=>{-1==e.findIndex(e=>e.id===t.id)&&e.push(t)}),d(e)},Z=async(n,i)=>{l(!0);try{if(!e)throw Error("comment undefined, cannot submitBan");let r=await c().post("/api/v1/comment_ban/".concat(e.id)).send({user_id:e.user_id,expiry:n,commentVisibility:i});i!==w.ol.VISIBLE&&document.location.reload();let o=r.body;p(o.bans),l(!1),t&&t(e,a)}catch(e){console.error("Failed to submit ban",e),m(!0)}l(!1)};return(0,o.d4)(()=>{(async()=>{if(e){l(!0),d([]),u([]),m(null),i(null);try{var t;let[n,r]=await Promise.all([c().get("/api/v1/user/".concat(e.user_id,"/bans")),c().get("/api/v1/moderation/publications/".concat(e.publication_id,"/users/").concat(e.user_id,"/bans")).query({type:"comment",limit:20})]),o=n.body;d(o.bans),i(o.sub),u(null!==(t=r.body.data)&&void 0!==t?t:[])}catch(e){console.error("Failed to get bans:",e),m(!0)}l(!1)}})()},[e]),{sub:n,loading:r,bans:a,bansHistory:s,error:h,submitBan:Z,setLoading:l,setError:m}}},82011:function(e,t,n){n.d(t,{a:()=>s});var i=n(16584),r=n(88812),o=n(46638),l=n(94874),a=n(17540),d=n(63474),c=n(63651);function s(e){let{comment:t,onClick:n,utm_content:s,noHover:m}=e,p=(0,o.gz)(t),Z=(0,c.NNq)(p,{utm_source:"comment",utm_content:s}),b=null!=n?n:()=>{};if(t.user_banned)return(0,i.tZ)(d.A0,{href:Z,onClick:b,children:(0,i.tZ)(l.ky,{size:32,icon:(0,i.tZ)(r.Z,{color:"var(--color-fg-tertiary)"})})});let f=h(p,m,Z,b),v=u(t);return v?(0,i.tZ)(a.zY,{tier:v,children:f}):f}let u=e=>{let{metadata:t}=e;return(null==t?void 0:t.is_author)?"author":(null==t?void 0:t.founding)?"founding":(null==t?void 0:t.membership_state)==="subscribed"?"paid":null},h=(e,t,n,r)=>t?(0,i.tZ)(l.On,{user:e,size:32,linkProps:{href:n,onClick:r}}):(0,i.tZ)(l.xV,{user:e,size:32,linkProps:{href:n,onClick:r}})},83225:function(e,t,n){n.d(t,{$:()=>u});var i=n(16584),r=n(37619),o=n(25380),l=n(95441),a=n(49762),d=n(15771),c=n(84747),s=n(50364);let u=e=>{let{currentSort:t,isLoading:n,pub:o,handleSort:a,useMobileBottomSheet:u}=e,{iString:m}=(0,l.M1)();return(0,i.tZ)(c.M,{trigger:(0,i.tZ)(d.zx,{size:"sm",priority:"secondary",disabled:n,leading:(0,i.tZ)(r.Z,{size:18}),children:(0,s.Sh)(t,o.language)}),ariaLabel:m("Sort comments"),useMobileBottomSheet:u,children:(0,i.tZ)(h,{currentSort:t,pub:o,handleSort:a})})},h=e=>{let{currentSort:t,pub:n,handleSort:r}=e,l=!!(0,a.default)("like_comments_enabled");return(0,i.tZ)(i.HY,{children:(0,s.Hz)({likesEnabled:l,language:n.language}).map(e=>{let{key:n,text:l}=e;return(0,i.tZ)(c.u,{onClick:()=>r(n),trailing:n===t?(0,i.tZ)(o.Z,{}):void 0,children:l},n)})})}},68072:function(e,t,n){n.d(t,{S:()=>l});var i=n(16584),r=n(71068),o=n(19081);function l(e){let{onCollapse:t}=e;return(0,i.tZ)(o.sg,{className:"collapser-Xs0O6C",onClick:t,children:(0,i.tZ)(r.xu,{className:"threadLine-BvF1wF",animate:!0})})}},63648:function(e,t,n){n.d(t,{Z:()=>g});var i=n(16584),r=n(94184),o=n.n(r),l=n(7617),a=n(31131),d=n(50137),c=n(30329),s=n(95441),u=n(53678),h=n(49762),m=n(19081),p=n(36500),Z=n(58175),b=n(39493);let f={link:"link-_X6et2",withShareButton:"withShareButton-hQzuEn"};function v(e){let{pub:t,post:n,comment:r,onChange:l}=e,{iString:a}=(0,s.M1)(),{canRestack:c,isRestacked:u,restacks:h,menuItems:m,nuxModal:Z}=(0,b.K)({pub:t,post:n,comment:r,onRestack:e=>{l({restacked:e,restacks:h+(e?1:-1)})}});return c?(0,i.BX)("span",{children:[Z,(0,i.tZ)(p.v2,{trigger:(0,i.BX)("a",{className:o()("restack-button",u&&"restacked"),href:"javascript:void(0)",children:[(0,i.tZ)(d.Z,{}),a("Restack"),h>0&&" (".concat(h,")")]}),children:m})]}):null}let g=e=>{var t,n;let{comment:r,pub:d,user:p,post:b,reaction_token:g,commentsEnabledForPost:y,noRestack:_,onChange:C,startReply:w,shareComment:k,updateCommentReacted:B,hideShare:x}=e,{iString:M}=(0,s.M1)(),N=(0,h.default)("like_comments_enabled");return(0,i.tZ)(m.hs,{gap:16,alignItems:"center",justifyContent:"start",paddingTop:8,className:o()("comment-actions",{[null!==(n=f.withShareButton)&&void 0!==n?n:"undefined"]:!!k}),children:!r.deleted&&[N&&(0,i.tZ)(c.dJ,{user:p,pub:d,post:b,comment:r,height:16,countInParenthesesStyle:!0,token:g,onChange:e=>{let{comment:t}=e;return C(t)},onReactedChange:e=>{B&&B(r.id,e)},noSelfUpdate:!!B}),y&&(0,i.tZ)(u.hh,{onClick:()=>w(),className:f.link,children:(0,i.BX)(m.hs,{gap:6,alignItems:"center",children:[(0,i.tZ)(l.Z,{stroke:"var(--color-fg-secondary-themed)",size:16}),(0,i.BX)(Z.xv.Meta,{color:"pub-secondary-text",children:[M("Reply"),(null===(t=r.children)||void 0===t?void 0:t.length)>0&&" (".concat(r.children.length,")")]})]})}),!x&&!!k&&(0,i.tZ)(u.hh,{onClick:()=>k(r.id),className:f.link,children:(0,i.BX)(m.hs,{gap:6,alignItems:"center",children:[(0,i.tZ)(a.Z,{stroke:"var(--color-fg-secondary-themed)",size:16}),(0,i.tZ)(Z.xv.Meta,{color:"pub-secondary-text",children:M("Share")})]})}),!_&&(0,i.tZ)(v,{pub:d,post:b,comment:r,onChange:C})]})}},65892:function(e,t,n){n.d(t,{Z:()=>p});var i=n(16584),r=n(30396),o=n(95441),l=n(46638),a=n(50364),d=n(98012),c=n(60308),s=n(84864),u=n(47929);let h=e=>{var t;let{comment:n,showHiddenComment:r,setShowHiddenComment:l}=e,{iString:c}=(0,o.M1)(),s=null===(t=n.bans)||void 0===t?void 0:t.find(e=>e.publication_id===n.publication_id),u=s&&(0,d.Z)(s.expiry).diff((0,d.Z)(),"years")>=1,h=(0,a.Ng)(n)&&(n.user_banned_for_comment||n.reported_by_user),m=c(u?"User was indefinitely suspended for this comment. ":"User was temporarily suspended for this comment. "),p=n.user_banned_for_comment?m:c("You reported this comment. ");return h&&(0,i.tZ)("div",{className:"comment_notice",children:(0,i.BX)("i",{children:[p,(0,i.tZ)("a",{href:"javascript:void(0)",onClick:()=>l(!r),children:r?"Hide":"Show"})]})})},m=e=>{let{comment:t}=e,{title:n,truncated_body_text:r,date:o,bylines:l,like_count:a,comment_count:d,url:h}=t.reply;return(0,i.BX)("a",{className:"reply-comment",href:(0,c.n1t)(h,{utm_source:u.b3.substack,utm_campaign:u.VX.postReplyComment,utm_medium:u.lP.web}),native:!0,children:[(0,i.tZ)("div",{className:"reply-comment-title",children:n}),r&&(0,i.tZ)("div",{className:"reply-comment-body",children:(0,s.formatEllipsis)(r)}),(0,i.tZ)("button",{className:"reply-comment-read-more",children:"Read more"}),(0,i.tZ)("div",{className:"reply-comment-meta",children:(0,s.getPostEmbedMeta)({date:o,bylines:l,like_count:a,comment_count:d})})]})},p=e=>{let{comment:t,bodyRef:n,expandToggleClicked:o}=e,[a,d]=(0,r.eJ)(!1),c=(t.user_banned_for_comment||t.reported_by_user)&&!a;return(0,i.BX)("div",{className:"comment-body",ref:n,children:[(0,i.tZ)(h,{comment:t,showHiddenComment:a,setShowHiddenComment:d}),t.hidden?(0,i.tZ)("i",{children:"Comment hidden"}):t.deleted?(0,i.tZ)("i",{children:"Comment deleted"}):c?(0,i.tZ)("i",{}):t.suppressed&&!a?(0,i.tZ)("i",{children:"Comment removed"}):"reply"===t.type?(0,i.tZ)(m,{comment:t}):(0,l.Fs)(t.body),(0,i.tZ)("div",{role:"button",className:"show-all-toggle",onClick:()=>o(),children:(0,i.tZ)("div",{className:"show-all-toggle-label",children:"Expand full comment"})})]})}},56187:function(e,t,n){n.d(t,{J:()=>eF});var i=n(58865),r=n(16584),o=n(30396),l=n(14293),a=n.n(l),d=n(95441),c=n(60807),s=n(25991),u=n(53678),h=n(16451),m=n(7409),p=n(99282),Z=n(85200),b=n(7760),f=n(85598),v=n(99869),g=n(59543),y=n(78526),_=n(16293),C=n(76924),w=n(66440),k=n(17876),B=n(7073),x=n(17048),M=n(74655),N=n(98848),S=n(64515);let X=e=>{var{size:t=24,fill:n="var(--color-fg-primary)"}=e,i=(0,N._)(e,["size","fill"]);return(0,r.tZ)(S.l,(0,p._)((0,m._)({},i),{name:"LinearIcon",svgParams:{viewBox:"0 0 24 24"},width:t,height:t,fill:n,children:(0,r.tZ)("path",{stroke:"none",fillRule:"evenodd",clipRule:"evenodd",d:"M19.0619 4.92341C15.1689 1.03032 8.8663 1.01517 4.95447 4.87797L19.1074 19.0309C22.9702 15.119 22.955 8.81651 19.0619 4.92341ZM2.95746 7.67367L16.3108 21.027C17.0035 20.6951 17.6661 20.2789 18.2829 19.7783L4.2062 5.70169C3.70565 6.31846 3.2894 6.98092 2.95746 7.67367ZM12.5482 21.9918L1.99316 11.4369C2.04331 10.5412 2.21326 9.65092 2.50301 8.79221L15.1928 21.4819C14.334 21.7717 13.4439 21.9416 12.5482 21.9918ZM4.90872 19.077C3.22167 17.3899 2.26284 15.2503 2.03226 13.049L10.9367 21.9534C8.73529 21.7228 6.59577 20.7639 4.90872 19.077Z"})}))},E=(0,n(6400).createContext)(null);function R(e){let{children:t,value:n}=e;return(0,r.tZ)(E.Provider,{value:n,children:t})}var P=n(27484),z=n.n(P),I=n(80569),H=n.n(I),T=n(8923),L=n(98914),F=n(46638),A=n(50364);function V(){let e=(0,i._)(["Are you sure you want to unpin this comment?"]);return V=function(){return e},e}function U(){let e=(0,i._)(["Are you sure you want to pin this comment?"]);return U=function(){return e},e}function J(){let e=(0,o.qp)(E);if(!e)throw Error("useCommentMenu must be used within a CommentMenuProvider");return e}let j=e=>{var t;let{iString:n}=(0,d.M1)(),i=null===(t=e.bans)||void 0===t?void 0:t.find(t=>t.publication_id===e.publication_id),r=i&&z()(i.expiry).diff(z()(),"years")>=1,o=["moderator_removed","deleted"].includes(e.status),l=e.user_banned_for_comment;return{banText:r?n("Banned"):o?"":n("Suspended"),shouldShowBanText:l}};function D(e){let{iString:t}=(0,d.M1)();return()=>window.confirm("".concat(t("Are you sure you want to ".concat(e," this comment? This action cannot be reversed."))))}var q=n(15771),O=n(19081),Y=n(36500),W=n(84747),G=n(40949),$=n(75419),K=n(40121),Q=n(60308),ee=n(84864);function et(e){let{comment:t,pub:n,post:i,user:o,onChange:l,startEdit:a,startReport:d,openBan:c,isCollapsed:s,toggleCollapse:u,useMobileBottomSheet:h}=e;return!function(e){let{menuEnabled:t}=ef(e);return t}({comment:t,user:o})?null:(0,r.tZ)(W.M,{trigger:(0,r.tZ)(O.X2,{className:"triggerContainer-eX588u",children:(0,r.tZ)(en,{})}),useMobileBottomSheet:h,children:(0,r.tZ)(er,{comment:t,pub:n,post:i,user:o,onChange:l,startEdit:a,startReport:d,openBan:c,isCollapsed:s,toggleCollapse:u})})}function en(){return(0,r.tZ)(q.hU,{priority:"quaternary",size:"sm",className:"trigger-j08Uop",children:(0,r.tZ)(Z.Z,{size:16})})}function ei(e){let{sections:t}=e,n=t.map(e=>(0,p._)((0,m._)({},e),{items:e.items.filter(e=>{var t;return null!==e&&(null===(t=e.props)||void 0===t?void 0:t.enabled)!==!1})})).filter(e=>e.items.length>0);return(0,r.tZ)(r.HY,{children:n.map((e,t)=>(0,r.tZ)(Y.xw,{isFirst:0===t,children:e.items},e.key))})}function er(e){var t;let{comment:n,pub:i,post:l,user:a,onChange:d,startEdit:c,startReport:s,openBan:u,isCollapsed:h,toggleCollapse:m}=e,p=(0,o.sO)(),Z=ef({comment:n,user:a}),b=[{key:"editing",items:[(0,r.tZ)(ea,{enabled:Z.editCommentEnabled,onClick:c})]},{key:"sharing",items:[(0,r.tZ)(el,{enabled:!0}),(0,r.tZ)(eZ,{enabled:Z.restackCommentEnabled})]},{key:"actions",items:[(0,r.tZ)(ed,{enabled:Z.pinCommentEnabled}),(0,r.tZ)(eo,{enabled:!0,isCollapsed:h,toggleCollapse:m}),(0,r.tZ)(ec,{enabled:Z.giftSubscriptionEnabled}),(0,r.tZ)(eb,{enabled:null!==(t=null==a?void 0:a.is_global_admin)&&void 0!==t&&t}),(0,r.tZ)(es,{enabled:Z.subscriberDetailsEnabled})]},{key:"admin",items:[(0,r.tZ)(eu,{enabled:Z.deleteCommentEnabled}),(0,r.tZ)(eh,{enabled:Z.removeCommentEnabled}),(0,r.tZ)(em,{enabled:Z.reportCommentEnabled,onClick:s}),(0,r.tZ)(ep,{enabled:Z.banUserEnabled,onClick:u})]}];return(0,r.tZ)(R,{value:{comment:n,pub:i,post:l,onChange:d,onMenuClose:()=>{var e;return null===(e=p.current)||void 0===e?void 0:e.close()},toggleCollapse:m},children:(0,r.tZ)(ei,{sections:b})})}function eo(e){let{enabled:t,isCollapsed:n,toggleCollapse:i}=e,{iString:o}=(0,d.M1)();return t?(0,r.tZ)(W.u,{leading:n?(0,r.tZ)(b.Z,{}):(0,r.tZ)(f.Z,{}),onClick:i,children:o(n?"Expand":"Collapse")}):null}function el(e){let{enabled:t}=e,{iString:n}=(0,d.M1)(),{comment:i,post:o,pub:l}=J(),a=(0,G.y)();return t?(0,r.tZ)(W.u,{leading:(0,r.tZ)(v.Z,{}),onClick:()=>{a((0,F.aE)(o,i,l))},children:n("Copy link")}):null}function ea(e){let{enabled:t,onClick:n}=e,{iString:i}=(0,d.M1)();return t?(0,r.tZ)(W.u,{leading:(0,r.tZ)(g.Z,{}),onClick:n,children:i("Edit")}):null}function ed(e){let{enabled:t}=e,{iString:n}=(0,d.M1)(),{comment:i,onChange:l}=J(),{pinned:a,togglingPin:c,togglePinned:s}=function(e){let{comment:t,onChange:n}=e,{iTemplate:i}=(0,d.M1)(),[r,l]=(0,o.eJ)(!1),a=!!t.pinned_by_user_id,c=async()=>{if(!r&&window.confirm(a?i(V()):i(U()))&&!r){l(!0);try{await H().patch("/api/v1/comment/".concat(t.id,"/pin")).send({pinned:!a}),n({pinned:!a}),document.location.reload()}catch(e){alert((0,L.zx)(e)),l(!1)}}};return{pinned:a,togglingPin:r,togglePinned:c}}({comment:i,onChange:l});return t?(0,r.tZ)(W.u,{leading:(0,r.tZ)(y.Z,{}),onClick:s,children:n(c?a?"Unpinning...":"Pinning...":a?"Unpin":"Pin")}):null}function ec(e){let{enabled:t}=e,{iString:n}=(0,d.M1)(),{comment:i,pub:o}=J();if(!t)return null;let l="".concat(o.base_url,"/subscribe?gift=true&recipient=").concat(i.user_id,"-").concat((0,K.Hm)(i.name,{hashIfEmpty:!0}),"&comment_id=").concat(i.id,"}");return(0,r.tZ)(W.u,{leading:(0,r.tZ)(_.Z,{}),href:l,children:n("Gift a subscription")})}function es(e){let{enabled:t}=e,{iString:n}=(0,d.M1)(),{comment:i,pub:o}=J();return t?(0,r.tZ)(W.u,{leading:(0,r.tZ)(C.Z,{}),onClick:()=>{if(i.email)return window.open((0,Q.pN7)(o,i.email),"_blank")},children:n("Subscriber details")}):null}function eu(e){let{enabled:t}=e,{iString:n}=(0,d.M1)(),{comment:i,onChange:l,onMenuClose:a}=J(),{isDeleting:c,deleteComment:s}=function(e){let{comment:t,onChange:n,onMenuClose:i}=e,[r,l]=(0,o.eJ)(!1),a=D("delete"),d=(0,T.Sn)(),c=async()=>{if(!r&&a()){l(!0);try{await d.delete("/api/v1/comment/".concat(t.id)).send(),n({status:A.ql.deleted,deleted:!0,user_id:null,name:null,body:null}),i()}catch(e){alert((0,L.zx)(e))}l(!1)}};return{isDeleting:r,deleteComment:c}}({comment:i,onChange:l,onMenuClose:a});return t?(0,r.tZ)(W.u,{leading:(0,r.tZ)(w.Z,{}),onClick:s,priority:"destructive",children:n(c?"Deleting...":"Delete")}):null}function eh(e){let{enabled:t}=e,{iString:n}=(0,d.M1)(),{comment:i,onChange:l,onMenuClose:a}=J(),{isRemoving:c,removeComment:s}=function(e){let{comment:t,onChange:n,onMenuClose:i}=e,[r,l]=(0,o.eJ)(!1),a=D("remove"),d=async()=>{if(!r&&a()){l(!0);try{await H().patch("/api/v1/comment/".concat(t.id,"/status")).send({status:A.ql.moderator_removed}),n({suppressed:!0,status:A.ql.moderator_removed,body:null}),i()}catch(e){alert((0,L.zx)(e))}l(!1)}};return{isRemoving:r,removeComment:d}}({comment:i,onChange:l,onMenuClose:a});return t?(0,r.tZ)(W.u,{leading:(0,r.tZ)(k.Z,{}),onClick:s,priority:"destructive",children:n(c?"Removing...":"Remove")}):null}function em(e){let{enabled:t,onClick:n}=e,{iString:i}=(0,d.M1)();return t?(0,r.tZ)(W.u,{leading:(0,r.tZ)(B.Z,{}),onClick:n,priority:"destructive",children:i("Report")}):null}function ep(e){let{enabled:t,onClick:n}=e,{iString:i}=(0,d.M1)();return t?(0,r.tZ)(W.u,{leading:(0,r.tZ)(x.Z,{}),onClick:n,priority:"destructive",children:i("Ban or suspend user")}):null}function eZ(e){let{enabled:t}=e,n=(0,$.i3)(),{comment:i,pub:o,post:l}=J(),{iString:a}=(0,d.M1)();return t?(0,r.tZ)(W.u,{leading:(0,r.tZ)(M.Z,{}),onClick:()=>{n.open({restackUrl:(0,F.aE)(l,i,o)})},children:a("Restack")}):null}function eb(e){let{enabled:t}=e,{iString:n}=(0,d.M1)(),{comment:i,post:o,pub:l}=J(),{addCommentToLinear:a}=function(e){let{comment:t,post:n,pub:i}=e,r=()=>{let e=(0,F.aE)(n,t,i),r=encodeURIComponent("".concat(t.body,"\n\nComment author: [").concat(t.name,"](https://admin.substack.com/users/").concat(t.user_id,")\n\nLink: ").concat(e));return"https://linear.app/substackinc/team/TPT/new?description=".concat(r,"&status=Triage")};return{addCommentToLinear:()=>{window.open(r(),"_blank")}}}({comment:i,post:o,pub:l});return t?(0,r.tZ)(W.u,{leading:(0,r.tZ)(X,{}),onClick:a,children:n("Add to Linear")}):null}function ef(e){let{comment:t,user:n}=e,i=!!(n&&n.id===t.user_id),r=!!(null==n?void 0:n.is_contributor)&&(0,A.Ng)(t),o=(0,ee.canEditComment)(n,t),l=!!(null==n?void 0:n.is_contributor)&&(0,A.Ng)(t)&&""===t.ancestor_path,a=!i&&!!t.metadata.eligibleForGift&&!t.metadata.is_author,d=!i&&!t.reported_by_user&&!t.hidden&&!t.suppressed,c=r&&!i,s=r&&!t.user_banned&&!i,u=!!r&&!!t.email&&!i,h=(0,A.Ng)(t)&&!(null==n?void 0:n.is_oauth),m=o||l||a||d||c||s||u||h;return{editCommentEnabled:o,pinCommentEnabled:l,giftSubscriptionEnabled:a,reportCommentEnabled:d,deleteCommentEnabled:i,removeCommentEnabled:c,banUserEnabled:s,subscriberDetailsEnabled:u,restackCommentEnabled:h,menuEnabled:m}}var ev=n(67749);let eg=e=>{var{size:t=24,fill:n="var(--color-fg-primary)"}=e,i=(0,N._)(e,["size","fill"]);return(0,r.tZ)(S.l,(0,p._)((0,m._)({},i),{name:"CommentBadgeHeartIcon",svgParams:{viewBox:"0 0 20 20"},width:t,height:t,fill:n,children:(0,r.tZ)("path",{stroke:"none",d:"M9.99915 16.7256C9.90515 16.7256 9.79102 16.692 9.65674 16.6249C9.52246 16.5622 9.3949 16.4906 9.27405 16.41C8.02974 15.6044 6.94657 14.7584 6.02454 13.8722C5.10697 12.9815 4.3953 12.0662 3.88953 11.1262C3.38375 10.1818 3.13086 9.23067 3.13086 8.27283C3.13086 7.63725 3.23157 7.05762 3.43298 6.53394C3.63888 6.01025 3.92086 5.55819 4.27893 5.17773C4.64148 4.79728 5.05774 4.50635 5.52771 4.30493C6.00216 4.09904 6.51241 3.99609 7.05847 3.99609C7.73433 3.99609 8.31844 4.16618 8.81079 4.50635C9.30762 4.84652 9.70374 5.28963 9.99915 5.83569C10.299 5.28516 10.6951 4.84204 11.1875 4.50635C11.6843 4.16618 12.2707 3.99609 12.9465 3.99609C13.4836 3.99609 13.9894 4.09904 14.4639 4.30493C14.9428 4.50635 15.3613 4.79728 15.7194 5.17773C16.0774 5.55819 16.3572 6.01025 16.5586 6.53394C16.7645 7.05762 16.8674 7.63725 16.8674 8.27283C16.8674 9.23067 16.6145 10.1818 16.1088 11.1262C15.603 12.0662 14.8891 12.9815 13.967 13.8722C13.0495 14.7584 11.9708 15.6044 10.731 16.41C10.6056 16.4906 10.4758 16.5622 10.3416 16.6249C10.2118 16.692 10.0976 16.7256 9.99915 16.7256Z"})}))};var ey=n(42970),e_=n(63474),eC=n(43570),ew=n(87077);function ek(){let e=(0,i._)(["Pinned by ",""]);return ek=function(){return e},e}function eB(){let e=(0,i._)(["Liked by ",""]);return eB=function(){return e},e}let ex=e=>{let{comment:t}=e;return t.pinned_by_user_id?(0,r.tZ)(eM,{name:t.pinned_by_name}):t.metadata.is_author?(0,r.tZ)(eN,{}):t.reactor_names.length>0?(0,r.tZ)(eS,{names:t.reactor_names}):null},eM=e=>{let{name:t}=e,{iString:n,iTemplate:i}=(0,d.M1)();return t?(0,r.tZ)(ew.u,{text:i(ek(),t),layerOptions:{placement:"top-center",triggerOffset:8},children:(0,r.tZ)(eC.Vp,{priority:"secondary",cursor:"pointer",fillIcon:!0,leading:(0,r.tZ)(ey.Z,(0,m._)({},eC.NH)),children:n("Pinned")})}):(0,r.tZ)(eC.Vp,{priority:"secondary-outline",fillIcon:!0,leading:(0,r.tZ)(ey.Z,(0,m._)({},eC.NH)),children:n("Pinned")})},eN=()=>{let{iString:e}=(0,d.M1)();return(0,r.tZ)(eC.Vp,{priority:"secondary-outline",theme:"accent",children:e("Author")})},eS=e=>{let{names:t}=e,{iTemplate:n}=(0,d.M1)();return(0,r.tZ)(eC.Vp,{theme:"accent",priority:"secondary-outline",fillIcon:!0,leading:(0,r.tZ)(eg,(0,m._)({},eC.NH)),children:n(eB(),t.join(", "))})},eX=e=>{let{comment:t,userBanned:n}=e,{banText:i,shouldShowBanText:o}=j(t);return!o||n?null:(0,r.tZ)(eC.Vp,{priority:"secondary",children:i})},eE=e=>{let{comment:t,userPendingApproval:n}=e,{iString:i}=(0,d.M1)();return n?(0,r.tZ)(e_.A0,{href:"/publish/moderation/new-commenters?user=".concat(t.user_id),target:"_blank",rel:"noopener",children:(0,r.tZ)(eC.Vp,{priority:"secondary",cursor:"pointer",trailing:(0,r.tZ)(ev.Z,(0,m._)({},eC.NH)),children:i("Awaiting approval")})}):null},eR=e=>{let{children:t}=e;return(0,r.tZ)(O.X2,{gap:4,children:t})};var eP=n(71068),ez=n(58175),eI=n(33017),eH=n(98012),eT=n(47929);function eL(){let e=(0,i._)(["Edited"]);return eL=function(){return e},e}function eF(e){let{post:t,pub:n,comment:i,isCollapsed:o,onProfileClick:l,userBanned:a,toggleCollapse:d,userPendingApproval:u,disableHoverCard:h,onChange:m,startEdit:p,startReport:Z,openBan:b,hideContextMenu:f,useMobileBottomSheet:v}=e,g=(0,c.aF)();return(0,r.BX)(O.gq,{children:[(0,r.BX)(eO,{children:[(0,r.tZ)(s.KF,{children:(0,r.BX)(s.Gf,{children:[(0,r.tZ)(eA,{comment:i,onClick:l,disableHoverCard:h}),(0,r.tZ)(eV,{comment:i}),(0,r.tZ)(eJ,{comment:i,post:t,pub:n}),(0,r.tZ)(ej,{comment:i})]})}),!o&&(0,r.tZ)(eq,{comment:i,userBanned:a,userPendingApproval:u}),(0,r.tZ)(eD,{comment:i,isCollapsed:o,toggleCollapse:d})]}),(0,r.tZ)(eY,{onClick:d}),!f&&(0,r.tZ)(et,{comment:i,pub:n,post:t,user:g,onChange:m,startEdit:p,startReport:Z,openBan:b,isCollapsed:o,toggleCollapse:d,useMobileBottomSheet:v})]})}function eA(e){let{comment:t,onClick:n,disableHoverCard:i}=e,{iString:o}=(0,d.M1)();if(t.name&&!a()(t.user_id))return(0,r.tZ)(ez.xv.B4,{display:"flex",gap:6,children:(0,r.tZ)(s.Lg,{user:(0,F.gz)(t),onClick:n?()=>n(t):void 0,disableHoverCard:i})});let l=o(t.hidden?"Comment hidden":t.deleted?"Comment deleted":(0,A.Ng)(t)?"Anonymous":"Comment removed");return(0,r.tZ)(ez.xv.B4,{color:"secondary",children:l})}function eV(e){var t,n,i,o,l;let{comment:a}=e,d=(null===(t=a.metadata)||void 0===t?void 0:t.author_on_other_pub)&&!a.metadata.is_author,c=(null===(i=a.metadata)||void 0===i?void 0:null===(n=i.author_on_other_pub)||void 0===n?void 0:n.id)&&!a.hidden;return d?c?(0,r.tZ)(eI.Sm,{publication_id:null!==(l=null===(o=a.metadata.author_on_other_pub)||void 0===o?void 0:o.id)&&void 0!==l?l:0,children:(0,r.tZ)(eU,{comment:a})}):(0,r.tZ)(eU,{comment:a}):null}function eU(e){var t;let{comment:n,disableHoverCard:i}=e,o=(0,c.aF)();return n.metadata.author_on_other_pub&&o?(0,r.tZ)(ez.xv.B4,{as:"span",color:"secondary",weight:"regular",children:(0,r.tZ)(u.G6,{publication:n.metadata.author_on_other_pub,utm_source:eT.b3.substackFeedItem,utm_content:eT.fZ.commentMetadata,disableHoverCard:i,user:o,children:(0,r.BX)("span",{children:[(0,ee.truncateText)(null===(t=n.metadata.author_on_other_pub)||void 0===t?void 0:t.name,32)," "]})})}):null}function eJ(e){let{comment:t,post:n,pub:i}=e;return(0,r.tZ)(ez.hh,{href:(0,F.aE)(n,t,i),onClick:e=>null===this||void 0===this?void 0:this.onDateClick(e),rel:"nofollow",native:!0,color:"secondary",title:s.c9.format((0,eH.Z)(t.date).toDate()),children:(0,r.tZ)(h.Ku,{timestamp:t.date})})}function ej(e){let{comment:t}=e,{iTemplate:n}=(0,d.M1)();return t.edited_at?(0,r.tZ)(ez.xv.B4,{as:"span",fontStyle:"italic",decoration:"hover-underline",cursor:"pointer",color:"tertiary",title:s.c9.format((0,eH.Z)(t.edited_at).toDate()),children:n(eL())}):null}function eD(e){let{comment:t,toggleCollapse:n,isCollapsed:i}=e,{iString:l}=(0,d.M1)(),[a,c]=(0,o.eJ)(!1);if(!i||!n)return null;let s=e=>{var t,n;return(null!==(t=e.children)&&void 0!==t?t:[]).length+(null!==(n=e.children)&&void 0!==n?n:[]).reduce((e,t)=>e+s(t),0)},u=s(t),h=l(a?"Loading":u>0?"Show replies":"Show comment");return(0,r.tZ)(O.X2,{children:(0,r.tZ)(q.zx,{size:"sm",flex:"auto",priority:"secondary-outline",maxHeight:28,onClick:()=>{c(!0),setTimeout(()=>{n(),c(!1)},0)},children:h})})}function eq(e){let{comment:t,userBanned:n,userPendingApproval:i}=e,o=ex({comment:t}),l=eX({comment:t,userBanned:n}),a=eE({comment:t,userPendingApproval:i});return o||l||a?(0,r.BX)(eR,{children:[o,l,a]}):null}let eO=(0,eP.zo)({display:"flex",direction:"column",gap:4}),eY=(0,eP.zo)({display:"flex",direction:"column",flex:"grow"})},75496:function(e,t,n){n.d(t,{v:()=>function e(t,n){let o=[],l=!1,a=new Map(t.map(e=>[e.id,e]));for(let t of n){let n=a.get(t.id);if(n){var d,c;(n.children&&t.children?e(n.children,t.children):t.children)!==n.children||r.some(e=>n[e]!==t[e])||!(0,i.wU)(null!==(d=n.reactions)&&void 0!==d?d:{},null!==(c=t.reactions)&&void 0!==c?c:{})?(o.push(t),l=!0):o.push(n)}else o.push(t),l=!0}return l?o:t}});var i=n(75561);let r=["edited_at","deleted","status"]},21266:function(e,t,n){n.d(t,{H:()=>o});var i=n(7409),r=n(99282);function o(e,t){var n,o;return function e(t,n,o){let l=n[0];if(!l){let e=t.findIndex(e=>e.id===o.id);return e>=0?t.with(e,o):[...t,o]}let a=t.findIndex(e=>e.id===l);if(a>=0){let l=t[a];if(l.id===o.id)return t.with(a,o);if(l.children)return t.with(a,(0,r._)((0,i._)({},l),{children:e(l.children,n.slice(1),o)}))}return t}(e,null!==(o=null===(n=t.ancestor_path)||void 0===n?void 0:n.split(".").map(Number))&&void 0!==o?o:[],t)}},37155:function(e,t,n){n.d(t,{g:()=>i});function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise(t=>{setTimeout(t,e)})}}}]);