"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["4258"],{2180:function(e,t,n){n.d(t,{Z:()=>i});let i={container:"container-u4XWUV",label:"label-gARrM9",input:"input-rLnHxk",selectedInput:"selectedInput-RGkQnW"}},60648:function(e,t,n){n.d(t,{Z:()=>i});let i={input:"input-qHk4bN",form:"form-CkZ7Kt"}},43389:function(e,t,n){n.d(t,{Z:()=>s});var i=n(7409),r=n(99282),o=n(16584),l=n(66298),a=n(64515);let s=e=>(0,o.tZ)(a.l,(0,r._)((0,i._)({},e),{name:"LucideArrowUpRight",svgParams:{height:24,width:24},children:(0,o.tZ)(l.Z,{height:24,stroke:e.stroke,fill:e.fill,strokeWidth:e.strokeWidth})}))},25265:function(e,t,n){n.d(t,{Z:()=>s});var i=n(7409),r=n(99282),o=n(16584),l=n(7617),a=n(64515);let s=e=>(0,o.tZ)(a.l,(0,r._)((0,i._)({},e),{name:"LucideComments",svgParams:{height:24,width:24,fill:"#000000",strokeWidth:0},children:(0,o.tZ)(l.Z,{height:24,stroke:e.stroke,fill:e.fill,strokeWidth:e.strokeWidth})}))},666:function(e,t,n){n.d(t,{Z:()=>s});var i=n(7409),r=n(99282),o=n(16584),l=n(8618),a=n(64515);let s=e=>(0,o.tZ)(a.l,(0,r._)((0,i._)({},e),{name:"LucideHeart",svgParams:{height:24,width:24,fill:"#000000",strokeWidth:0},children:(0,o.tZ)(l.Z,{height:24,stroke:e.stroke,fill:e.fill,strokeWidth:e.strokeWidth})}))},95398: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:"LucideShare",svgParams:{height:24,width:24,fill:"#000000",strokeWidth:0},children:(0,o.tZ)("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.tZ)("path",{d:"M12.4376 15.6C4.77778 15.6 2 20.3999 2 20.3999C2 12.5999 5.88889 8.4 12.4376 8.4V3L22 11.9812L12.4376 21V15.6Z","stroke-width":e.strokeWidth,fill:e.fill,className:"lucide","stroke-linecap":"round","stroke-linejoin":"round"})})}))},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","stroke-linecap":"round","stroke-linejoin":"round"})}))},6498:function(e,t,n){n.d(t,{R:()=>d});var i=n(16584),r=n(347),o=n(4211),l=n(95441),a=n(83225),s=n(80026);let d=e=>{let{comments:t,post:n,commentId:a,notAllowedToFetchComments:d,handleSort:u,publication:h,sort:m,sortMenuUseMobileBottomSheet:p}=e,{iString:f}=(0,l.M1)();return(0,i.BX)(r.h,{children:[(0,i.BX)(s.gq,{alignItems:"baseline",flex:"grow",gap:8,position:"relative",children:[(0,i.tZ)(o.Z,{preset:"st4",children:f("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)(s.xu,{className:"sortOptionsContainer-bIIUcJ",children:[!d&&(0,i.tZ)(o.Z,{align:"left",as:"a",color:"tertiary",href:"/p/community-guidelines",preset:"detail-small",style:{textDecoration:"underline"},children:f("Community Guidelines")}),t&&(null==t?void 0:t.length)>1&&!d&&!a&&(0,i.tZ)(c,{comments:t,handleSort:u,publication:h,sort:m,useMobileBottomSheet:p})]})]})},c=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(3900),l=n(6498),a=n(4211),s=n(95441),d=n(71068),c=n(19081),u=n(60308),h=n(47929);let m=e=>{let{post:t,publication:n,user:m,freeSignupEmail:p=null,showHeader:f=!1}=e,{iString:Z}=(0,s.M1)(),v=m&&m.email||p||null,b=(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=b};return(0,i.BX)(c.tu,{className:"container-u0f9W_",children:[f&&(0,i.tZ)(l.R,{notAllowedToFetchComments:!0,post:t,publication:n}),(0,i.tZ)(d.xu,{className:"commentsPaywall-ASd8iy",children:(0,i.BX)(c.tu,{alignItems:"center",gap:24,paddingX:24,paddingY:40,children:[(0,i.tZ)(a.Z,{color:"white",preset:"h4-sans-condensed",children:Z("Join the conversation")}),(0,i.tZ)(a.Z,{color:"white",preset:"d3-serif",children:Z("Share your thoughts and connect with other readers by becoming a paid subscriber!")}),(0,i.tZ)(o._,{variant:"inverse",onClick:g,children:Z("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:Z(v?"Switch accounts":"Sign in")})]})]})})]})}},12980:function(e,t,n){n.d(t,{H:()=>E,U:()=>P});var i=n(27412),r=n(58865),o=n(16584),l=n(6400),a=n(80569),s=n.n(a),d=n(60826),c=n(56219),u=n(94442),h=n(11712),m=n(89276),p=n(3900),f=n(95441),Z=n(19081);let v=e=>{let{post:t,ctaUrl:n,ctaText:i,hidden:r}=e,{iString:l}=(0,f.M1)(),a=i;return r||"podcast"!==t.type?r||"newsletter"!==t.type||(a=l("Back to article")):a=l("Back to episode"),(0,o.tZ)(Z.tu,{alignItems:"start",paddingY:8,children:(0,o.tZ)(p._,{href:n,leadingIcon:"chevron-left",native:!0,size:"md",variant:"tertiary",children:a})})};var b=n(58319),g=n(75905),_=n(90099),C=n(68833),y=n(98914),w=n(6070),k=n(31377),B=n(60308),N=n(84864),S=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,C.j)(C.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,C.j)(C.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 s().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:s,freeSignup:p,freeSignupEmail:f,isStatic:Z,hidden:g,truncated:C,invisible:y,post_reaction_token:M,onChange:E,showCta:P=C,showUnsubscribeNotice:X,dataForEmailRender:z={},showReactions:I=!0,gap:L=16,iString:H,iTemplate:R,iPlural:T,language:F,showShare:A}=e;"boolean"!=typeof g&&(g=a.hidden),g?(t=H("Subscribe to view"),n=(0,B.n1t)("/subscribe",{simple:!0,next:document.location.href,utm_source:S.b3.thread,utm_medium:S.lP.web,utm_content:a.id})):(n=(0,B.uRy)(r,a,{noBase:!0}),t="thread"!==a.type||C?(0,N.getPostCtaText)(a,F):a.comment_count?T("View 1 comment","View %1 comments",a.comment_count):H("Reply"));let V=Z&&!this.context.isAmp,j=(0,w.HD)({pub:r}),U=j?m.j:l.Fragment;return(0,o.tZ)(_.YF,{className:"thread-head typography ".concat(i||""),children:(0,o.tZ)("tr",{children:(0,o.tZ)("td",{children:(0,o.BX)(_.i$,{width:"100%",children:[!y&&!g&&(0,o.tZ)(b.Z,{onVisible:()=>this.onTopReached()}),(0,o.BX)(_.i$,{gap:L,width:"100%",children:[P&&j&&(0,o.tZ)(v,{post:a,ctaUrl:n,ctaText:t,hidden:g}),(0,o.tZ)(c.mV,{pub:r,post:a,user:s,isStatic:Z,reaction_token:M,allowEdit:!0,allowTruncate:C,showReactions:!!P||I,showShare:A,showComments:!!a.comment_count,inThreadHead:!0,onChange:E,showLabel:!0}),(0,o.tZ)(U,{inThreadHead:!0,children:(0,o.tZ)(h.Z,{user:s,freeSignup:p,freeSignupEmail:f,pub:r,post:a,html:g||C||!a.body_html?null:a.body_html,isStatic:Z,dataForEmailRender:z,children:g?(0,o.tZ)("p",{children:(0,o.tZ)("i",{children:R(x(),(0,k.isFoundingAudience)(a.audience)?"founding":"paid",r.name)})}):C?(0,o.tZ)("p",{children:a.description}):null})}),P?!j&&(0,o.BX)("a",{className:"thread-head-cta",href:n,native:!0,children:[t," →"]}):g&&(0,o.BX)("p",{className:"thread-head-cta",children:[(0,o.tZ)("a",{href:(0,B.W1P)(r,{simple:!0,next:document.location.href,utm_source:S.b3.thread,utm_medium:S.lP.web,utm_content:a.id}),className:"button primary subscribe-btn",native:!Z,children:(0,N.getSubscribeText)(r)}),(0,o.tZ)("a",{href:(0,B.uXE)({for_pub:r.subdomain}),className:"button",native:!0,children:H("Sign in")})]})]}),V&&(0,o.BX)(_.i$,{gap:L,style:{width:"100%"},children:[(0,o.tZ)(_.i$,{style:{width:"100%",textAlign:"center"},children:(0,o.tZ)("a",{role:"button",className:"button primary",style:{margin:"0 auto"},href:d.W.HALF_MAGIC_COMMENTS_URL,children:H("See the discussion")})}),(0,o.tZ)(u.yT,{isFooter:!0,customization:{showShare:!0,showComments:!0,showReactions:{showReactions:I},showRestack:!1,showLabels:!0,showCommentRestack:!r.hide_post_restacks}})]}),X&&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")})]}),!y&&!g&&(0,o.tZ)(b.Z,{onVisible:()=>this.onBottomReached()})]})})})})}}(0,i._)(M,"contextType",g.E);let E=(0,f.fz)(M);class P 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"})]})]})]})}}},70522:function(e,t,n){n.d(t,{ZP:()=>b});var i=n(27412),r=n(16584),o=n(6400),l=n(94184),a=n.n(l),s=n(81094),d=n(70149),c=n(15702),u=n(82621),h=n(42493),m=n(20888),p=n(86603),f=n(32261),Z=n(68833),v=n(60308);class b extends o.Component{static getSubject(e){return e?"author_id"in e&&e.author_id?{id:e.author_id,name:e.author_name,photo_url:(0,v.SMH)(e,{preferAuthorPhoto:!0}),publications:e.subdomain?[e]:[]}:"user_id"in e&&e.user_id?{id:e.user_id,name:e.name,photo_url:(0,v.SMH)(e),publications:[]}:{id:"id"in e?e.id:void 0,name:"name"in e?e.name:void 0,photo_url:(0,v.SMH)(e),publications:[]}:{id:null,name:null,photo_url:v.zUJ,publications:[]}}static hasCustomProfilePhoto(e){return!!b.getSubject(e).photo_url}isSelf(){return this.props.user&&this.props.user.id===b.getSubject(this.props.subject).id||!this.props.subject}profileUrl(){return this.props.url?this.props.url:this.props.isAuthor?(0,v.LwU)(b.getSubject(this.props.subject),this.props.pub):(0,v.NNq)(b.getSubject(this.props.subject))}onBeforeProfileClose(e){if(e){if(!this.props.onEdit)return document.location.reload(),!1;this.props.onEdit()}}render(e){let{subject:t,pub:n,user:i,badge:o,freeSignup:l,freeSignupEmail:s,token:d,isStatic:c,size:u,modalProfile:m,isBanned:p,lazy:Z,tooltip:v,noLink:_,className:C}=e;u=u||33;let y=b.getSubject(t);return(0,r.BX)("div",{className:a()("user-head",{banned:p},C),children:[_?(0,r.tZ)(g,{photo_url:y.photo_url,size:u,isStatic:c,isBanned:p,lazy:Z,badge:o,tooltip:v,className:"default-pointer"}):(0,r.tZ)("a",{href:c||!m?this.profileUrl():void 0,onClick:this.onClick,children:(0,r.tZ)(g,{photo_url:y.photo_url,size:u,isStatic:c,isBanned:p,lazy:Z,badge:o,tooltip:v})}),this.props.modalProfile&&!c&&"undefined"!=typeof window&&this.state.includeProfile&&(this.isSelf()?(0,r.tZ)(h.EB,{ref:this.assignProfile,user:i,freeSignup:l,freeSignupEmail:s,needsPhoto:!0,token:d,onBeforeClose:e=>this.onBeforeProfileClose(e)}):(0,r.tZ)(f.FI,{ref:this.assignProfile,profileUser:y,pub:n,isBanned:null!=p&&p}))]})}constructor(...e){super(...e),(0,i._)(this,"profileShown",void 0),(0,i._)(this,"profile",void 0),(0,i._)(this,"assignProfile",e=>{this.profile=e}),(0,i._)(this,"onClick",e=>{if(this.props.onClick)this.props.onClick(e);else if(!this.props.modalProfile)return!1;else if(e.preventDefault(),e.stopPropagation(),this.profileShown||(this.profileShown=!0,(0,Z.j)(Z.FP.USER_HEAD_CLICKED,{is_self:this.isSelf()})),this.state.includeProfile){var t;null===(t=this.profile)||void 0===t||t.open()}else this.setState({includeProfile:!0},()=>{var e;return null===(e=this.profile)||void 0===e?void 0:e.open()})})}}let g=e=>{let{photo_url:t,size:n,isStatic:i,isBanned:o,lazy:l,badge:u,tooltip:h,style:m,children:p,className:f}=e,Z=!t&&!!p,v={founding:(0,r.tZ)(c.Z,{height:14,width:14,stroke:"var(--print_on_pop)",strokeWidth:1,title:h}),author:(0,r.tZ)(s.Z,{height:14,width:14,stroke:"var(--print_on_pop)",title:h})}[null!=u?u:"undefined"];return(0,r.BX)("div",{className:a()("profile-img-wrap",f),children:[Z?p:l?(0,r.tZ)(C,{photo_url:t,size:n,isStatic:i,badge:u,style:m}):(0,r.tZ)(y,{photo_url:t,size:n,isStatic:i,badge:u,style:m}),v&&(0,r.tZ)("div",{className:"profile-img-badge",title:null!=h?h:void 0,children:v}),o&&(0,r.tZ)(d.Z,{})]})},_=(e,t)=>(0,v.zF4)(e,2*t,{height:2*t,crop:"fill"}),C=e=>{let{photo_url:t,size:n,isStatic:i,badge:o,style:l}=e,[a,s]=(0,p.Z)({}),d=!s||s.isIntersecting?t:v.zUJ;return(0,r.tZ)(w,{url:_(d,n),size:n,ref:a,badge:o,isStatic:i,style:l})},y=e=>{let{photo_url:t,size:n,isStatic:i,badge:o,style:l}=e;return(0,r.tZ)(w,{url:_(t,n),size:n,badge:o,isStatic:i,style:l})},w=e=>{let{url:t,size:n,isStatic:i,ref:o,badge:l,className:a}=e;return i?(0,r.tZ)(u.Z,{className:a,src:(0,v.zF4)(t,2*n,{height:2*n,crop:"fill"}),ref:o,height:n,width:n,alt:l||""}):(0,r.tZ)(m.e,{className:a,src:t,imageProps:{height:2*n,crop:"fill"},maxWidth:2*n,ref:o,alt:l||""})}},95434:function(e,t,n){n.d(t,{Gg:()=>X});var i=n(58865),r=n(16584),o=n(30396),l=n(24830),a=n(17048),s=n(80569),d=n.n(s),c=n(95441),u=n(69791),h=n(94874),m=n(71068),p=n(15771),f=n(19081),Z=n(1844),v=n(6490),b=n(65523),g=n(98248),_=n(17688),C=n(43570),y=n(58175),w=n(65252),k=n(98012);function B(){let e=(0,i._)(["Ban or suspend ",""]);return B=function(){return e},e}function N(){let e=(0,i._)(["Prevent this person from commenting on your publication in the future."]);return N=function(){return e},e}function S(){let e=(0,i._)(["Ban ",""]);return S=function(){return e},e}function x(){let e=(0,i._)(["Previously banned "," time(s), last on ",""]);return x=function(){return e},e}function M(){let e=(0,i._)([""," is permanently banned."]);return M=function(){return e},e}function E(){let e=(0,i._)([""," is banned until ","."]);return E=function(){return e},e}function P(){let e=(0,i._)(["Leave a reply"]);return P=function(){return e},e}let X=e=>{var t,n,i,l;let{comment:a,onReply:s,onBan:d,onClose:c}=e,{sub:u,loading:h,bans:m,bansHistory:p,error:f,submitBan:Z}=R(a,d),b=(0,w.mr)(),g=null===(t=b[1])||void 0===t?void 0:t[0],[_,C]=(0,o.eJ)(g),[y,B]=(0,o.eJ)(w.ol.VISIBLE),N=!!a||h,S=null!==(l=null===(i=b.find(e=>{let[t]=e;return t===_}))||void 0===i?void 0:null===(n=i[1])||void 0===n?void 0:n.toLowerCase())&&void 0!==l?l:"",x=m.filter(e=>(0,k.Z)(e.expiry).isAfter((0,k.Z)()));return(0,r.BX)(v.u_,{isOpen:N,onClose:c,children:[0===x.length&&(0,r.tZ)(z,{comment:a,sub:u,bans:m,bansHistory:p,loading:h,error:f,selectedExpiry:_,setSelectedExpiry:C,selectedCommentVisibility:y,setSelectedCommentVisibility:B,expiryText:S,onClose:c,submitBan:Z}),x.length>0&&(0,r.tZ)(H,{comment:a,bans:m,onClose:c,onReply:()=>{s&&a&&(s(a.id),c())}})]})},z=e=>{var t,n;let{comment:i,sub:o,bans:l,bansHistory:a,loading:s,error:d,selectedExpiry:u,setSelectedExpiry:m,selectedCommentVisibility:b,setSelectedCommentVisibility:k,expiryText:x,onClose:M,submitBan:E}=e,{iString:P,iTemplate:X}=(0,c.M1)(),z=(0,w.mr)(),H=(0,w.FG)();return(0,r.BX)(r.HY,{children:[(0,r.tZ)(v.xB,{showClose:!0,onClose:M,title:X(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)(f.sg,{alignItems:"center",gap:8,children:[(null==o?void 0:o.is_subscribed)&&(0,r.tZ)(C.Vp,{priority:"secondary",children:P("Paid subscriber")}),(0,r.tZ)(y.xv,{children:X(N())})]})}),(0,r.tZ)(v.fe,{children:(0,r.BX)(f.sg,{gap:20,children:[(0,r.tZ)(L,{bans:l,bansHistory:a}),d&&(0,r.tZ)(Z.y,{children:P("An error occurred. Please try again.")}),s&&(0,r.tZ)(g.$j,{padding:32,alignItems:"center",justifyContent:"center"}),!s&&(0,r.BX)(r.HY,{children:[(0,r.BX)(I,{children:[(0,r.tZ)(y.xv.B3,{weight:"semibold",children:P("Ban duration")}),(0,r.BX)(_.i,{name:"expiry",value:u,onChange:e=>{m(e.target.value)},children:[(0,r.tZ)(_.d,{children:P("Select a duration")}),z.map(e=>{let[t,n]=e;return(0,r.tZ)("option",{value:t,children:null==n?void 0:n.replace(/^For /,"")})})]})]}),(0,r.BX)(I,{children:[(0,r.tZ)(y.xv.B3,{weight:"semibold",children:P("Delete comments")}),(0,r.BX)(_.i,{name:"comment_visibility",value:b,onChange:e=>{k(e.target.value)},children:[(0,r.tZ)(_.d,{children:P("Select whether to delete comments")}),H.map(e=>{let[t,n]=e;return(0,r.tZ)("option",{value:t,children:n})})]})]})]})]})}),(0,r.tZ)(v.mz,{direction:"column",showDivider:!0,primaryButton:(0,r.tZ)(p.zx,{priority:"destructive",onClick:()=>E(u,b),children:X(S(),x)})})]})},I=(0,m.zo)({display:"flex",justifyContent:"space-between",alignItems:"center"}),L=e=>{let{bans:t,bansHistory:n}=e,{iTemplate:i}=(0,c.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(x(),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:s}=e,{iString:d,iTemplate:u}=(0,c.M1)(),h=o.find(e=>e.user_id),m=h&&(0,k.Z)(h.expiry).isAfter((0,k.Z)().add(100,"years"))?u(M(),null!==(t=null==i?void 0:i.name)&&void 0!==t?t:"This user"):u(E(),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)(v.xB,{title:m,alignItems:"center",icon:(0,r.tZ)(b.AM,{icon:(0,r.tZ)(a.Z,{})}),showClose:!0,onClose:l,description:d("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)(v.ex,{}),(0,r.tZ)(v.mz,{direction:"column",primaryButton:(0,r.tZ)(p.zx,{priority:"primary-mono",onClick:s,children:u(P())})})]}):null},R=(e,t)=>{let[n,i]=(0,o.eJ)(null),[r,l]=(0,o.eJ)(!1),[a,s]=(0,o.eJ)([]),[c,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)}),s(e)},f=async(n,i)=>{l(!0);try{if(!e)throw Error("comment undefined, cannot submitBan");let r=await d().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),s([]),u([]),m(null),i(null);try{var t;let[n,r]=await Promise.all([d().get("/api/v1/user/".concat(e.user_id,"/bans")),d().get("/api/v1/moderation/publications/".concat(e.publication_id,"/users/").concat(e.user_id,"/bans")).query({type:"comment",limit:20})]),o=n.body;s(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:c,error:h,submitBan:f,setLoading:l,setError:m}}},82011:function(e,t,n){n.d(t,{a:()=>c});var i=n(16584),r=n(88812),o=n(46638),l=n(94874),a=n(17540),s=n(63474),d=n(63651);function c(e){let{comment:t,onClick:n,utm_content:c,noHover:m}=e,p=(0,o.gz)(t),f=(0,d.NNq)(p,{utm_source:"comment",utm_content:c}),Z=null!=n?n:()=>{};if(t.user_banned)return(0,i.tZ)(s.A0,{href:f,onClick:Z,children:(0,i.tZ)(l.ky,{size:32,icon:(0,i.tZ)(r.Z,{color:"var(--color-fg-tertiary)"})})});let v=h(p,m,f,Z),b=u(t);return b?(0,i.tZ)(a.zY,{tier:b,children:v}):v}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),s=n(15771),d=n(44424),c=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)(d.v2,{trigger:(0,i.tZ)(s.zx,{size:"sm",priority:"secondary",disabled:n,leading:(0,i.tZ)(r.Z,{size:18}),children:(0,c.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,c.Hz)({likesEnabled:l,language:n.language}).map(e=>{let{key:n,text:l}=e;return(0,i.tZ)(d.sN,{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),s=n(50137),d=n(30329),c=n(95441),u=n(53678),h=n(49762),m=n(19081),p=n(44424),f=n(58175),Z=n(39493);let v={link:"link-_X6et2",withShareButton:"withShareButton-hQzuEn"};function b(e){let{pub:t,post:n,comment:r,onChange:l}=e,{iString:a}=(0,c.M1)(),{canRestack:d,isRestacked:u,restacks:h,menuItems:m,nuxModal:f}=(0,Z.K)({pub:t,post:n,comment:r,onRestack:e=>{l({restacked:e,restacks:h+(e?1:-1)})}});return d?(0,i.BX)("span",{children:[f,(0,i.tZ)(p.v2,{layerClassName:"comment-restack-menu",title:"Restack",trigger:(0,i.BX)("a",{className:o()("restack-button",u&&"restacked"),href:"javascript:void(0)",children:[(0,i.tZ)(s.Z,{}),a("Restack"),h>0&&" (".concat(h,")")]}),children:m})]}):null}let g=e=>{var t,n;let{comment:r,pub:s,user:p,post:Z,reaction_token:g,commentsEnabledForPost:_,noRestack:C,onChange:y,startReply:w,shareComment:k,updateCommentReacted:B,hideShare:N}=e,{iString:S}=(0,c.M1)(),x=(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=v.withShareButton)&&void 0!==n?n:"undefined"]:!!k}),children:!r.deleted&&[x&&(0,i.tZ)(d.dJ,{user:p,pub:s,post:Z,comment:r,height:16,countInParenthesesStyle:!0,token:g,onChange:e=>{let{comment:t}=e;return y(t)},onReactedChange:e=>{B&&B(r.id,e)},noSelfUpdate:!!B}),_&&(0,i.tZ)(u.hh,{onClick:()=>w(),className:v.link,children:(0,i.BX)(m.hs,{gap:6,alignItems:"center",children:[(0,i.tZ)(l.Z,{stroke:"var(--color-secondary-themed)",size:16}),(0,i.BX)(f.xv.Meta,{color:"pub-secondary-text",children:[S("Reply"),(null===(t=r.children)||void 0===t?void 0:t.length)>0&&" (".concat(r.children.length,")")]})]})}),!N&&!!k&&(0,i.tZ)(u.hh,{onClick:()=>k(r.id),className:v.link,children:(0,i.BX)(m.hs,{gap:6,alignItems:"center",children:[(0,i.tZ)(a.Z,{stroke:"var(--color-secondary-themed)",size:16}),(0,i.tZ)(f.xv.Meta,{color:"pub-secondary-text",children:S("Share")})]})}),!C&&(0,i.tZ)(b,{pub:s,post:Z,comment:r,onChange:y})]})}},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),s=n(98012),d=n(60308),c=n(84864),u=n(47929);let h=e=>{var t;let{comment:n,showHiddenComment:r,setShowHiddenComment:l}=e,{iString:d}=(0,o.M1)(),c=null===(t=n.bans)||void 0===t?void 0:t.find(e=>e.publication_id===n.publication_id),u=c&&(0,s.Z)(c.expiry).diff((0,s.Z)(),"years")>=1,h=(0,a.Ng)(n)&&(n.user_banned_for_comment||n.reported_by_user),m=d(u?"User was indefinitely suspended for this comment. ":"User was temporarily suspended for this comment. "),p=n.user_banned_for_comment?m:d("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:s,url:h}=t.reply;return(0,i.BX)("a",{className:"reply-comment",href:(0,d.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,c.formatEllipsis)(r)}),(0,i.tZ)("button",{className:"reply-comment-read-more",children:"Read more"}),(0,i.tZ)("div",{className:"reply-comment-meta",children:(0,c.getPostEmbedMeta)({date:o,bylines:l,like_count:a,comment_count:s})})]})},p=e=>{let{comment:t,bodyRef:n,expandToggleClicked:o}=e,[a,s]=(0,r.eJ)(!1),d=(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:s}),t.hidden?(0,i.tZ)("i",{children:"Comment hidden"}):t.deleted?(0,i.tZ)("i",{children:"Comment deleted"}):d?(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"})})]})}},26419:function(e,t,n){n.d(t,{J:()=>eT});var i=n(58865),r=n(16584),o=n(30396),l=n(14293),a=n.n(l),s=n(95441),d=n(60807),c=n(25991),u=n(53678),h=n(16451),m=n(7409),p=n(99282),f=n(85200),Z=n(7760),v=n(85598),b=n(99869),g=n(59543),_=n(78526),C=n(16293),y=n(76924),w=n(66440),k=n(17876),B=n(7073),N=n(17048),S=n(74655),x=n(98848),M=n(64515);let E=e=>{var{size:t=24,fill:n="var(--color-fg-primary)"}=e,i=(0,x._)(e,["size","fill"]);return(0,r.tZ)(M.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","fill-rule":"evenodd","clip-rule":"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"})}))},P=(0,n(6400).createContext)(null);function X(e){let{children:t,value:n}=e;return(0,r.tZ)(P.Provider,{value:n,children:t})}var z=n(27484),I=n.n(z),L=n(80569),H=n.n(L),R=n(8923),T=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 j(){let e=(0,i._)(["Are you sure you want to pin this comment?"]);return j=function(){return e},e}function U(){let e=(0,o.qp)(P);if(!e)throw Error("useCommentMenu must be used within a CommentMenuProvider");return e}let W=e=>{var t;let{iString:n}=(0,s.M1)(),i=null===(t=e.bans)||void 0===t?void 0:t.find(t=>t.publication_id===e.publication_id),r=i&&I()(i.expiry).diff(I()(),"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,s.M1)();return()=>window.confirm("".concat(t("Are you sure you want to ".concat(e," this comment? This action cannot be reversed."))))}var J=n(15771),O=n(19081),q=n(44424),Y=n(40949),G=n(75419),$=n(40121),K=n(60308),Q=n(84864);function ee(e){let{comment:t,pub:n,post:i,user:o,onChange:l,startEdit:a,startReport:s,openBan:d,isCollapsed:c,toggleCollapse:u}=e;return!function(e){let{menuEnabled:t}=eZ(e);return t}({comment:t,user:o})?null:(0,r.tZ)(q.v2,{trigger:(0,r.tZ)(O.X2,{className:"triggerContainer-eX588u",children:(0,r.tZ)(et,{})}),children:(0,r.tZ)(ei,{comment:t,pub:n,post:i,user:o,onChange:l,startEdit:a,startReport:s,openBan:d,isCollapsed:c,toggleCollapse:u})})}function et(){return(0,r.tZ)(J.hU,{priority:"quaternary",size:"sm",className:"trigger-j08Uop",children:(0,r.tZ)(f.Z,{size:16})})}function en(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)(q.xw,{isFirst:0===t,children:e.items},e.key))})}function ei(e){var t;let{comment:n,pub:i,post:l,user:a,onChange:s,startEdit:d,startReport:c,openBan:u,isCollapsed:h,toggleCollapse:m}=e,p=(0,o.sO)(),f=eZ({comment:n,user:a}),Z=[{key:"editing",items:[(0,r.tZ)(el,{enabled:f.editCommentEnabled,onClick:d})]},{key:"sharing",items:[(0,r.tZ)(eo,{enabled:!0}),(0,r.tZ)(ep,{enabled:f.restackCommentEnabled})]},{key:"actions",items:[(0,r.tZ)(ea,{enabled:f.pinCommentEnabled}),(0,r.tZ)(er,{enabled:!0,isCollapsed:h,toggleCollapse:m}),(0,r.tZ)(es,{enabled:f.giftSubscriptionEnabled}),(0,r.tZ)(ef,{enabled:null!==(t=null==a?void 0:a.is_global_admin)&&void 0!==t&&t}),(0,r.tZ)(ed,{enabled:f.subscriberDetailsEnabled})]},{key:"admin",items:[(0,r.tZ)(ec,{enabled:f.deleteCommentEnabled}),(0,r.tZ)(eu,{enabled:f.removeCommentEnabled}),(0,r.tZ)(eh,{enabled:f.reportCommentEnabled,onClick:c}),(0,r.tZ)(em,{enabled:f.banUserEnabled,onClick:u})]}];return(0,r.tZ)(X,{value:{comment:n,pub:i,post:l,onChange:s,onMenuClose:()=>{var e;return null===(e=p.current)||void 0===e?void 0:e.close()},toggleCollapse:m},children:(0,r.tZ)(en,{sections:Z})})}function er(e){let{enabled:t,isCollapsed:n,toggleCollapse:i}=e,{iString:o}=(0,s.M1)();return t?(0,r.tZ)(q.sN,{leading:n?(0,r.tZ)(Z.Z,{}):(0,r.tZ)(v.Z,{}),onClick:i,children:o(n?"Expand":"Collapse")}):null}function eo(e){let{enabled:t}=e,{iString:n}=(0,s.M1)(),{comment:i,post:o,pub:l}=U(),a=(0,Y.y)();return t?(0,r.tZ)(q.sN,{leading:(0,r.tZ)(b.Z,{}),onClick:()=>{a((0,F.aE)(o,i,l))},children:n("Copy link")}):null}function el(e){let{enabled:t,onClick:n}=e,{iString:i}=(0,s.M1)();return t?(0,r.tZ)(q.sN,{leading:(0,r.tZ)(g.Z,{}),onClick:n,children:i("Edit")}):null}function ea(e){let{enabled:t}=e,{iString:n}=(0,s.M1)(),{comment:i,onChange:l}=U(),{pinned:a,togglingPin:d,togglePinned:c}=function(e){let{comment:t,onChange:n}=e,{iTemplate:i}=(0,s.M1)(),[r,l]=(0,o.eJ)(!1),a=!!t.pinned_by_user_id,d=async()=>{if(!r&&window.confirm(a?i(V()):i(j()))&&!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,T.zx)(e)),l(!1)}}};return{pinned:a,togglingPin:r,togglePinned:d}}({comment:i,onChange:l});return t?(0,r.tZ)(q.sN,{leading:(0,r.tZ)(_.Z,{}),onClick:c,children:n(d?a?"Unpinning...":"Pinning...":a?"Unpin":"Pin")}):null}function es(e){let{enabled:t}=e,{iString:n}=(0,s.M1)(),{comment:i,pub:o}=U();if(!t)return null;let l="".concat(o.base_url,"/subscribe?gift=true&recipient=").concat(i.user_id,"-").concat((0,$.Hm)(i.name,{hashIfEmpty:!0}),"&comment_id=").concat(i.id,"}");return(0,r.tZ)(q.sN,{leading:(0,r.tZ)(C.Z,{}),href:l,children:n("Gift a subscription")})}function ed(e){let{enabled:t}=e,{iString:n}=(0,s.M1)(),{comment:i,pub:o}=U();return t?(0,r.tZ)(q.sN,{leading:(0,r.tZ)(y.Z,{}),onClick:()=>{if(i.email)return window.open((0,K.pN7)(o,i.email),"_blank")},children:n("Subscriber details")}):null}function ec(e){let{enabled:t}=e,{iString:n}=(0,s.M1)(),{comment:i,onChange:l,onMenuClose:a}=U(),{isDeleting:d,deleteComment:c}=function(e){let{comment:t,onChange:n,onMenuClose:i}=e,[r,l]=(0,o.eJ)(!1),a=D("delete"),s=(0,R.Sn)(),d=async()=>{if(!r&&a()){l(!0);try{await s.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,T.zx)(e))}l(!1)}};return{isDeleting:r,deleteComment:d}}({comment:i,onChange:l,onMenuClose:a});return t?(0,r.tZ)(q.sN,{leading:(0,r.tZ)(w.Z,{}),onClick:c,priority:"destructive",children:n(d?"Deleting...":"Delete")}):null}function eu(e){let{enabled:t}=e,{iString:n}=(0,s.M1)(),{comment:i,onChange:l,onMenuClose:a}=U(),{isRemoving:d,removeComment:c}=function(e){let{comment:t,onChange:n,onMenuClose:i}=e,[r,l]=(0,o.eJ)(!1),a=D("remove"),s=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,T.zx)(e))}l(!1)}};return{isRemoving:r,removeComment:s}}({comment:i,onChange:l,onMenuClose:a});return t?(0,r.tZ)(q.sN,{leading:(0,r.tZ)(k.Z,{}),onClick:c,priority:"destructive",children:n(d?"Removing...":"Remove")}):null}function eh(e){let{enabled:t,onClick:n}=e,{iString:i}=(0,s.M1)();return t?(0,r.tZ)(q.sN,{leading:(0,r.tZ)(B.Z,{}),onClick:n,priority:"destructive",children:i("Report")}):null}function em(e){let{enabled:t,onClick:n}=e,{iString:i}=(0,s.M1)();return t?(0,r.tZ)(q.sN,{leading:(0,r.tZ)(N.Z,{}),onClick:n,priority:"destructive",children:i("Ban or suspend user")}):null}function ep(e){let{enabled:t}=e,n=(0,G.i3)(),{comment:i,pub:o,post:l}=U(),{iString:a}=(0,s.M1)();return t?(0,r.tZ)(q.sN,{leading:(0,r.tZ)(S.Z,{}),onClick:()=>{n.open({restackUrl:(0,F.aE)(l,i,o)})},children:a("Restack")}):null}function ef(e){let{enabled:t}=e,{iString:n}=(0,s.M1)(),{comment:i,post:o,pub:l}=U(),{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)(q.sN,{leading:(0,r.tZ)(E,{}),onClick:a,children:n("Add to Linear")}):null}function eZ(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,Q.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,s=!i&&!t.reported_by_user&&!t.hidden&&!t.suppressed,d=r&&!i,c=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||s||d||c||u||h;return{editCommentEnabled:o,pinCommentEnabled:l,giftSubscriptionEnabled:a,reportCommentEnabled:s,deleteCommentEnabled:i,removeCommentEnabled:d,banUserEnabled:c,subscriberDetailsEnabled:u,restackCommentEnabled:h,menuEnabled:m}}var ev=n(67749);let eb=e=>{var{size:t=24,fill:n="var(--color-fg-primary)"}=e,i=(0,x._)(e,["size","fill"]);return(0,r.tZ)(M.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"})}))},eg=e=>{var{size:t=24,fill:n="var(--color-fg-primary)"}=e,i=(0,x._)(e,["size","fill"]);return(0,r.tZ)(M.l,(0,p._)((0,m._)({},i),{name:"CommentBadgePinIcon",svgParams:{viewBox:"0 0 20 20"},width:t,height:t,fill:n,children:(0,r.tZ)("path",{stroke:"none",d:"M4.62891 12.2131C4.62891 11.7253 4.75199 11.2486 4.99817 10.7831C5.24434 10.3131 5.5957 9.88566 6.05225 9.50073C6.51326 9.11133 7.05933 8.79801 7.69043 8.56079L7.91199 5.4187C7.57182 5.22624 7.26074 5.03153 6.97876 4.83459C6.69678 4.63765 6.45284 4.44967 6.24695 4.27063C6.04106 4.08712 5.87992 3.92151 5.76355 3.7738C5.57556 3.5321 5.48157 3.29041 5.48157 3.04871C5.48157 2.81596 5.56213 2.62349 5.72327 2.47131C5.88888 2.31466 6.10372 2.23633 6.3678 2.23633H13.6322C13.8963 2.23633 14.1089 2.31466 14.27 2.47131C14.4356 2.62349 14.5184 2.81596 14.5184 3.04871C14.5184 3.29041 14.4244 3.5321 14.2365 3.7738C14.1201 3.92151 13.9567 4.08712 13.7463 4.27063C13.5404 4.44967 13.2965 4.63765 13.0145 4.83459C12.737 5.02706 12.4282 5.22176 12.088 5.4187L12.3029 8.56079C12.9384 8.79801 13.4845 9.11133 13.941 9.50073C14.3976 9.88566 14.7489 10.3131 14.9951 10.7831C15.2413 11.2486 15.3644 11.7253 15.3644 12.2131C15.3644 12.5309 15.2659 12.7883 15.069 12.9852C14.872 13.1777 14.608 13.2739 14.2767 13.2739H10.7117V16.4697C10.7117 16.689 10.6848 16.9128 10.6311 17.1411C10.5774 17.3694 10.5103 17.5753 10.4297 17.7588C10.3491 17.9468 10.2686 18.0967 10.188 18.2086C10.1119 18.325 10.0492 18.3832 10 18.3832C9.95076 18.3832 9.88586 18.325 9.8053 18.2086C9.72473 18.0967 9.64417 17.9468 9.5636 17.7588C9.48303 17.5753 9.41589 17.3694 9.36218 17.1411C9.30847 16.9128 9.28162 16.689 9.28162 16.4697V13.2739H5.72327C5.39205 13.2739 5.12573 13.1777 4.92432 12.9852C4.72738 12.7883 4.62891 12.5309 4.62891 12.2131Z"})}))};var e_=n(63474),eC=n(43570),ey=n(87077);function ew(){let e=(0,i._)(["Pinned by ",""]);return ew=function(){return e},e}function ek(){let e=(0,i._)(["Liked by ",""]);return ek=function(){return e},e}let eB=e=>{let{comment:t}=e;return t.pinned_by_user_id?(0,r.tZ)(eN,{name:t.pinned_by_name}):t.metadata.is_author?(0,r.tZ)(eS,{}):t.reactor_names.length>0?(0,r.tZ)(ex,{names:t.reactor_names}):null},eN=e=>{let{name:t}=e,{iString:n,iTemplate:i}=(0,s.M1)();return t?(0,r.tZ)(ey.u,{text:i(ew(),t),layerOptions:{placement:"top-center",triggerOffset:8},children:(0,r.tZ)(eC.Vp,{priority:"secondary",cursor:"pointer",fillIcon:!0,leading:(0,r.tZ)(eg,(0,m._)({},eC.NH)),children:n("Pinned")})}):(0,r.tZ)(eC.Vp,{priority:"secondary-outline",fillIcon:!0,leading:(0,r.tZ)(eg,(0,m._)({},eC.NH)),children:n("Pinned")})},eS=()=>{let{iString:e}=(0,s.M1)();return(0,r.tZ)(eC.Vp,{priority:"secondary-outline",theme:"accent",children:e("Author")})},ex=e=>{let{names:t}=e,{iTemplate:n}=(0,s.M1)();return(0,r.tZ)(eC.Vp,{theme:"accent",priority:"secondary-outline",fillIcon:!0,leading:(0,r.tZ)(eb,(0,m._)({},eC.NH)),children:n(ek(),t.join(", "))})},eM=e=>{let{comment:t,userBanned:n}=e,{banText:i,shouldShowBanText:o}=W(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,s.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},eP=e=>{let{children:t}=e;return(0,r.tZ)(O.X2,{gap:4,children:t})};var eX=n(71068),ez=n(58175),eI=n(33017),eL=n(98012),eH=n(47929);function eR(){let e=(0,i._)(["Edited"]);return eR=function(){return e},e}function eT(e){let{post:t,pub:n,comment:i,isCollapsed:o,onProfileClick:l,userBanned:a,toggleCollapse:s,userPendingApproval:u,disableHoverCard:h,onChange:m,startEdit:p,startReport:f,openBan:Z,hideContextMenu:v}=e,b=(0,d.aF)();return(0,r.BX)(O.gq,{children:[(0,r.BX)(eJ,{children:[(0,r.tZ)(c.KF,{children:(0,r.BX)(c.Gf,{children:[(0,r.tZ)(eF,{comment:i,onClick:l,disableHoverCard:h}),(0,r.tZ)(eA,{comment:i}),(0,r.tZ)(ej,{comment:i,post:t,pub:n}),(0,r.tZ)(eU,{comment:i})]})}),!o&&(0,r.tZ)(eD,{comment:i,userBanned:a,userPendingApproval:u}),(0,r.tZ)(eW,{comment:i,isCollapsed:o,toggleCollapse:s})]}),(0,r.tZ)(eO,{onClick:s}),!v&&(0,r.tZ)(ee,{comment:i,pub:n,post:t,user:b,onChange:m,startEdit:p,startReport:f,openBan:Z,isCollapsed:o,toggleCollapse:s})]})}function eF(e){let{comment:t,onClick:n,disableHoverCard:i}=e,{iString:o}=(0,s.M1)();if(t.name&&!a()(t.user_id))return(0,r.tZ)(ez.xv.B4,{display:"flex",gap:6,children:(0,r.tZ)(c.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 eA(e){var t,n,i,o,l;let{comment:a}=e,s=(null===(t=a.metadata)||void 0===t?void 0:t.author_on_other_pub)&&!a.metadata.is_author,d=(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 s?d?(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)(eV,{comment:a})}):(0,r.tZ)(eV,{comment:a}):null}function eV(e){var t;let{comment:n,disableHoverCard:i}=e,o=(0,d.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:eH.b3.substackFeedItem,utm_content:eH.fZ.commentMetadata,disableHoverCard:i,user:o,children:(0,r.BX)("span",{children:[(0,Q.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:c.c9.format((0,eL.Z)(t.date).toDate()),children:(0,r.tZ)(h.Ku,{timestamp:t.date})})}function eU(e){let{comment:t}=e,{iTemplate:n}=(0,s.M1)();return t.edited_at?(0,r.tZ)(ez.xv.B4,{as:"span",fontStyle:"italic",decoration:"hover-underline",cursor:"pointer",color:"tertiary",title:c.c9.format((0,eL.Z)(t.edited_at).toDate()),children:n(eR())}):null}function eW(e){let{comment:t,toggleCollapse:n,isCollapsed:i}=e,{iString:l}=(0,s.M1)(),[a,d]=(0,o.eJ)(!1);if(!i||!n)return null;let c=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+c(t),0)},u=c(t),h=l(a?"Loading":u>0?"Show replies":"Show comment");return(0,r.tZ)(O.X2,{children:(0,r.tZ)(J.zx,{size:"sm",flex:"auto",priority:"secondary-outline",maxHeight:28,onClick:()=>{d(!0),setTimeout(()=>{n(),d(!1)},0)},children:h})})}function eD(e){let{comment:t,userBanned:n,userPendingApproval:i}=e,o=eB({comment:t}),l=eM({comment:t,userBanned:n}),a=eE({comment:t,userPendingApproval:i});return o||l||a?(0,r.BX)(eP,{children:[o,l,a]}):null}let eJ=(0,eX.zo)({display:"flex",direction:"column",gap:4}),eO=(0,eX.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 s,d;(n.children&&t.children?e(n.children,t.children):t.children)!==n.children||r.some(e=>n[e]!==t[e])||!(0,i.wU)(null!==(s=n.reactions)&&void 0!==s?s:{},null!==(d=t.reactions)&&void 0!==d?d:{})?(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)}},65252:function(e,t,n){n.d(t,{FG:()=>a,mr:()=>o,ol:()=>l});var i,r=n(95441);let o=()=>{let{iString:e}=(0,r.M1)();return[["1d",e("For 1 day")],["30d",e("For 30 days")],["90d",e("For 90 days")],["1y",e("For 1 year")],["1000y",e("Forever")]]};var l=((i={}).VISIBLE="visible",i.DELETE_THIS_COMMENT="delete_this_comment",i.DELETE_ALL_COMMENTS="delete_all_comments",i);let a=()=>{let{iString:e}=(0,r.M1)();return[["visible",e("Do not delete comments")],["delete_this_comment",e("Delete this comment")],["delete_all_comments",e("Also delete all comments")]]}},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)})}}}]);