!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"substack@ff2ee57"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="531f04f4-0e8a-4c9b-9767-5cc2e3a4a7a5",e._sentryDebugIdIdentifier="sentry-dbid-531f04f4-0e8a-4c9b-9767-5cc2e3a4a7a5")}catch(e){}}();"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["51111"],{3898:function(e,t,n){n.d(t,{A:()=>i});let i={reactionsHoverZone:"reactionsHoverZone-nHxYxG",reactionsContainer:"reactionsContainer-uNTS8E",outgoing:"outgoing-xjlZZA",emojiGrid:"emojiGrid-yGGf1S",reaction:"reaction-BmRJjL",selected:"selected-T0p6AZ",emojiBox:"emojiBox-hGb2ir",addReactButton:"addReactButton-j8HliB",emojiPopover:"emojiPopover-UcQl9N",show:"show-rCpI7T"}},36083:function(e,t,n){n.d(t,{A:()=>i});let i={messageBubbleGroup:"messageBubbleGroup-R4lEWb",bubble:"bubble-JnQPTp",isFirst:"isFirst-cID827",isLast:"isLast-YVpa0l",quote:"quote-NJ4bEy",paywallReplyTag:"paywallReplyTag-_3sIGO",outgoing:"outgoing-hqKZeu",forceIncomingTheme:"forceIncomingTheme-fBbXPp",body:"body-obaIpu",author:"author-M_vI8F","reactions-1":"reactions-1-O8o884",reactions1:"reactions-1-O8o884","reactions-2":"reactions-2-NrnldS",reactions2:"reactions-2-NrnldS","reactions-3":"reactions-3-iPVLb0",reactions3:"reactions-3-iPVLb0",youtubeIframe:"youtubeIframe-rlkjkW",highlight:"highlight-u2yyKp","highlight-animation":"highlight-animation-rBjpTz",highlightAnimation:"highlight-animation-rBjpTz",imageGroup:"imageGroup-KAnMHU bubble-JnQPTp",incoming:"incoming-jCFnDy",postImage:"postImage-eO7gd7",b4:"b4-xXB4IY",bubbs:"bubbs-qLKn32",bubb:"bubb-yci1Gp",isLink:"isLink-NGEdg6",linkImage:"linkImage-FDEYzZ",small:"small-PzwGAf",actions:"actions-utvBvN",actionsWrapper:"actionsWrapper-CEt9E2",dots:"dots-_BmXB7",dot:"dot-XjG0Z6",typing:"typing-vNx1zN",flip:"flip-OUTl4B"}},73040:function(e,t,n){n.d(t,{A:()=>s});var i=n(69277),r=n(70408),o=n(4006),l=n(822),a=n(97731);let s=e=>(0,o.Y)(a.A,(0,r._)((0,i._)({},e),{name:"LucideCornerDownRight",svgParams:{height:24,width:24,fill:"#000000",strokeWidth:0},children:(0,o.Y)(l.A,{height:24,stroke:e.stroke,fill:e.fill,strokeWidth:e.strokeWidth})}))},86404:function(e,t,n){n.d(t,{A:()=>s});var i=n(69277),r=n(70408),o=n(32641),l=n(4006),a=n(97731);let s=e=>{var{size:t=24,color:n="var(--color-fg-primary)",className:s}=e,c=(0,o._)(e,["size","color","className"]);return(0,l.Y)(a.A,(0,r._)((0,i._)({},c),{name:"SkinnyUnlockIcon",svgParams:{viewBox:"0 0 24 24"},stroke:"none",width:t,height:t,fill:n,className:s,children:(0,l.Y)("path",{d:"M2.5862 23.8914H13.1034C14.793 23.8914 15.6896 22.9366 15.6896 21.051V12.8282C15.6896 10.9545 14.793 9.99975 13.1034 9.99975H2.5862C0.896549 9.99975 0 10.9545 0 12.8282V21.051C0 22.9366 0.896549 23.8914 2.5862 23.8914ZM11.9885 10.9306H13.8046V6.90875C13.8046 3.88935 15.6667 2.30209 17.8161 2.30209C19.9655 2.30209 21.8275 3.88935 21.8275 6.90875V9.55818C21.8275 10.2623 22.2299 10.6203 22.7471 10.6203C23.2413 10.6203 23.6551 10.2981 23.6551 9.55818V7.15937C23.6551 2.67205 20.8161 0.5 17.8161 0.5C14.8046 0.5 11.9885 2.67205 11.9885 7.15937V10.9306Z"})}))}},8890:function(e,t,n){n.d(t,{Cv:()=>E});var i=n(69277),r=n(79785),o=n(4006),l=n(12215),a=n(17402),s=n(58398),c=n(84605),d=n(85478),u=n(86500),m=n(1459),h=n(68349),p=n(35369),g=n(76977),f=n(16993),b=n(84843),y=n(67958),Y=n(63136),v=n(16291),_=n(28194),w=n(91392),C=n(49807),S=n(82776),k=n(57324);function A(){let e=(0,r._)(["Support ",""]);return A=function(){return e},e}function I(){let e=(0,r._)(["Since you liked this post, why not support "," with a subscription?"]);return I=function(){return e},e}let D=w.FI.LIKE_UPSELL_LAST_SHOWN_AT;function x(e){var t,n;let{isOpen:r,onClose:l,pub:s}=e,{iString:m,iTemplate:v}=(0,c.GO)(),w=(0,d.mJ)(),[D,x]=(0,a.useState)(null==s||null==(t=s.plans)?void 0:t[0]),N=w.getConfigFor("disable_monthly_subscriptions"),E=w.getConfigFor("disable_annual_subscriptions");return(0,o.FD)(f.aF,{isOpen:r,onClose:l,children:[(0,o.Y)(b.rQ,{title:v(A(),s.name),description:v(I(),s.name),onClose:l}),(0,o.Y)(f.cw,{children:(0,o.Y)(y.z,{name:"plan",value:D?String(D.id):void 0,onValueChange:e=>{var t;let n=null==s||null==(t=s.plans)?void 0:t.find(t=>String(t.id)===e);n&&x(n)},children:null==s||null==(n=s.plans)?void 0:n.map(e=>{if("month"===e.interval&&N||"year"===e.interval&&E)return null;let t=D&&D.id===e.id;return(0,o.FD)(g.fI,{as:"label",alignItems:"center",gap:12,cursor:"pointer",userSelect:"none",children:[(0,o.Y)(y.s,{value:String(e.id)}),(0,o.Y)(Y.EY.B4,{as:"span",weight:"semibold",color:t?"primary":"secondary",children:(0,S.getPlanTitle)(e,s.language)}),(0,o.Y)(Y.EY.B4,{as:"span",color:"secondary",children:(0,_.xB)(e)})]},e.id)})})}),(0,o.Y)(f.jl,{direction:"column",primaryButton:(0,o.Y)(p.$n,{onClick:()=>{(0,u.u4)(u.qY.LIKE_UPSELL_PLAN_SELECTED),(0,h.V2)((0,C.eV6)(s,{params:(0,i._)({utm_source:k.VU.likeButtonUpsell},D&&{selectedPlanId:D.id})}),{local_navigation:!1})},children:m("Select")})})]})}function N(e){let{isOpen:t,onClose:n,onShareClick:i}=e,{iString:r}=(0,c.GO)();return(0,o.FD)(f.aF,{isOpen:t,onClose:n,children:[(0,o.Y)(b.rQ,{title:r("Share this post with a friend"),description:r("Since you liked this post, why not share it to help spread the word?"),onClose:n}),(0,o.Y)(f.q1,{}),(0,o.Y)(f.jl,{direction:"column",primaryButton:(0,o.Y)(p.$n,{onClick:()=>{(0,u.u4)(u.qY.LIKE_UPSELL_SHARE_CLICKED),i(),n()},children:r("Share")})})]})}function E(e){let{user:t,pub:n,post:r}=e,[c,d]=(0,a.useState)(!1),p=(()=>{let e=l.get(D);if(e){let t=(0,v.A)(e),n=(0,v.A)().subtract(30,"days");if(t.isAfter(n))return!1}return!0})(),[g,f]=(0,a.useState)(p);(0,a.useEffect)(()=>{(!p||(null==t?void 0:t.is_contributor)||(null==t?void 0:t.is_admin))&&(0,h.qm)("show_reaction_upsell")},[p,t]),(0,a.useEffect)(()=>{p&&g&&t&&((0,u.u4)(u.qY.LIKE_UPSELL_MODAL_SEEN,{source:"email",type:(0,m.e)(t,n)?"share":"paid"}),l.set(D,(0,v.A)().format(),(0,i._)({expires:3650},!n.custom_domain&&{domain:".".concat(new URL((0,C.$_T)()).hostname)})))},[p,g,n,t]);let b=()=>{f(!1),(0,h.qm)("show_reaction_upsell")};return t&&!t.is_contributor&&!t.is_admin&&(p||c)?(0,o.FD)(o.FK,{children:[(0,m.e)(t,n)?(0,o.Y)(N,{isOpen:g,onClose:b,onShareClick:()=>d(!0)}):(0,o.Y)(x,{isOpen:g,onClose:b,pub:n}),(0,o.Y)(s.Z,{isOpen:c,medium:"web",pub:n,user:t,post:r,onClose:()=>d(!1)})]}):null}},61193:function(e,t,n){n.d(t,{W:()=>c});var i=n(4006),r=n(13950),o=n(15894),l=n(84605),a=n(47570),s=n(17028);let c=e=>{let{comments:t,post:n,commentId:a,notAllowedToFetchComments:c,handleSort:u,publication:m,sort:h,disableMobileBottomSheet:p}=e,{iString:g}=(0,l.GO)();return(0,i.FD)(r.DH,{children:[(0,i.FD)(s.Ye,{alignItems:"baseline",flex:"grow",gap:8,position:"relative",children:[(0,i.Y)(o.T,{preset:"st4",children:g("Comments")}),(0,i.Y)("div",{className:"mediumRule-B78a2B"}),(null==t?void 0:t.length)&&(null==t?void 0:t.length)>0?(0,i.Y)(o.T,{color:"accent",preset:"st4",children:n.comment_count}):null]}),(0,i.FD)(s.az,{className:"sortOptionsContainer-bIIUcJ",children:[!c&&(0,i.Y)(o.T,{align:"left",as:"a",color:"tertiary",href:"/p/community-guidelines",preset:"detail-small",style:{textDecoration:"underline"},children:g("Community Guidelines")}),t&&(null==t?void 0:t.length)>1&&!c&&!a&&(0,i.Y)(d,{comments:t,disableMobileBottomSheet:p,handleSort:u,publication:m,sort:h})]})]})},d=e=>{let{publication:t,handleSort:n,sort:r,comments:o,disableMobileBottomSheet:l}=e;return t&&n&&r?(0,i.Y)(a.D,{currentSort:r,disableMobileBottomSheet:l,handleSort:n,isLoading:!o,pub:t}):null}},77481:function(e,t,n){n.d(t,{n:()=>h});var i=n(4006),r=n(34746),o=n(63446),l=n(61193),a=n(15894),s=n(84605),c=n(89490),d=n(76977),u=n(39318),m=n(57324);let h=e=>{let{post:t,publication:n,user:h,freeSignupEmail:p=null,showHeader:g=!1}=e,{iString:f}=(0,s.GO)(),b=h&&h.email||p||null,y=(0,u.my9)(n,{simple:!0,next:document.location.href,utm_source:m.VU.paywall,utm_medium:m.Jn.web,utm_content:t?t.id:null,just_signed_up:!1}),Y=async()=>{window.location.href=y};return(0,i.FD)(d.I1,{className:"container-u0f9W_",children:[g&&(0,i.Y)(l.W,{notAllowedToFetchComments:!0,post:t,publication:n}),(0,i.Y)(c.az,{className:"commentsPaywall-ASd8iy",children:(0,i.FD)(d.I1,{alignItems:"center",gap:24,paddingX:24,paddingY:40,children:[(0,i.Y)(a.T,{color:"white",preset:"h4-sans-condensed",children:f("Join the conversation")}),(0,i.Y)(a.T,{color:"white",preset:"d3-serif",children:f("Share your thoughts and connect with other readers by becoming a paid subscriber!")}),(0,i.Y)(o.v,{variant:"inverse",onClick:Y,children:f("Upgrade today")}),(0,i.FD)(a.T,{as:"a",color:"white","data-native":!0,href:(0,u.eV6)(n,{isSignInAttempt:!0,next:(0,u.wu9)(n,t)}),preset:"caption",children:[(0,r.Qy)({post:t,publication:n})," ",(0,i.Y)("u",{children:f(b?"Switch accounts":"Sign in")})]})]})})]})}},58997:function(e,t,n){n.d(t,{D:()=>x,X:()=>D});var i=n(99851),r=n(79785),o=n(4006),l=n(17402),a=n(15734),s=n.n(a),c=n(6212),d=n(41935),u=n(37494),m=n(90847),h=n(46196),p=n(56778),g=n(84605),f=n(8609),b=n(6049),y=n(86500),Y=n(68349),v=n(98111),_=n(4016),w=n(56262),C=n(39318),S=n(82776),k=n(57324);function A(){let e=(0,r._)(["This thread is only visible to "," subscribers of ",""]);return A=function(){return e},e}class I extends l.Component{onTopReached(){this.state.topReached||(this.setState({topReached:!0}),(0,y.Jw)({post:this.props.post,hasPaywall:!1,surface:"thread_head",markRead:!0,user:this.props.user}))}onBottomReached(){this.state.bottomReached||(this.setState({bottomReached:!0}),(0,y.sM)({post:this.props.post,hasPaywall:!1,surface:"thread_head"}))}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.uX)(e))}}render(){let e,t,{className:n,pub:i,post:r,user:a,freeSignup:s,freeSignupEmail:g,isStatic:f,truncated:y,invisible:Y,post_reaction_token:I,onChange:D,showCta:x=y,showUnsubscribeNotice:N,dataForEmailRender:E={},showReactions:F=!0,gap:R=16,iString:T,iTemplate:P,iPlural:L,language:B,showShare:O}=this.props,{hidden:G}=this.props;"boolean"!=typeof G&&(G=r.hidden),G?(e=T("Subscribe to view"),t=(0,C.yRP)("/subscribe",{simple:!0,next:document.location.href,utm_source:k.VU.thread,utm_medium:k.Jn.web,utm_content:r.id})):(t=(0,C.wu9)(i,r,{noBase:!0}),e="thread"!==r.type||y?(0,S.getPostCtaText)(r,B):r.comment_count?L("View 1 comment","View %1 comments",r.comment_count):T("Reply"));let U=f&&!this.context.isAmp,M=(0,_.lu)({pub:i}),H=M?m.Z:l.Fragment;return(0,o.Y)(b.h2,{className:"thread-head typography ".concat(n||""),children:(0,o.Y)("tr",{children:(0,o.Y)("td",{children:(0,o.FD)(b.jJ,{width:"100%",children:[!Y&&!G&&(0,o.Y)(p.A,{onVisible:()=>this.onTopReached()}),(0,o.FD)(b.jJ,{gap:R,width:"100%",children:[x&&M&&(0,o.Y)(h.$,{post:r,ctaUrl:t,ctaText:e,hidden:G}),(0,o.Y)(c.I0,{pub:i,post:r,user:a,isStatic:f,reaction_token:I,allowEdit:!0,allowTruncate:y,showReactions:!!x||F,showShare:O,showComments:!!r.comment_count,inThreadHead:!0,onChange:D,showLabel:!0}),(0,o.Y)(H,{inThreadHead:!0,children:(0,o.Y)(u.A,{user:a,freeSignup:s,freeSignupEmail:g,pub:i,post:r,html:G||y||!r.body_html?null:r.body_html,isStatic:f,dataForEmailRender:E,children:G?(0,o.Y)("p",{children:(0,o.Y)("i",{children:P(A(),(0,w.isFoundingAudience)(r.audience)?"founding":"paid",i.name)})}):y?(0,o.Y)("p",{children:r.description}):null})}),x?!M&&(0,o.FD)("a",{className:"thread-head-cta",href:t,"data-native":!0,children:[e," →"]}):G&&(0,o.FD)("p",{className:"thread-head-cta",children:[(0,o.Y)("a",{href:(0,C.eV6)(i,{simple:!0,next:document.location.href,utm_source:k.VU.thread,utm_medium:k.Jn.web,utm_content:r.id}),className:"button primary subscribe-btn","data-native":f?void 0:"",children:(0,S.getSubscribeText)(i)}),(0,o.Y)("a",{href:(0,C.a7q)({for_pub:i.subdomain}),className:"button","data-native":!0,children:T("Sign in")})]})]}),U&&(0,o.FD)(b.jJ,{gap:R,style:{width:"100%"},children:[(0,o.Y)(b.jJ,{style:{width:"100%",textAlign:"center"},children:(0,o.Y)("a",{role:"button",className:"button primary",style:{margin:"0 auto"},href:v.T.HALF_MAGIC_COMMENTS_URL,children:T("See the discussion")})}),(0,o.Y)(d.fz,{isFooter:!0,customization:{showShare:!0,showComments:!0,showReactions:{showReactions:F},showRestack:!1,showLabels:!0,showCommentRestack:!i.hide_post_restacks}})]}),N&&r.unsubscribed&&(0,o.FD)("div",{className:"notifications-alert",children:[T("Email notifications are disabled for this thread.")," ",(0,o.Y)("a",{href:"javascript:void(0)",onClick:()=>this.enableEmailNotifications(),children:T("Re-enable")})]}),!Y&&!G&&(0,o.Y)(p.A,{onVisible:()=>this.onBottomReached()})]})})})})}}(0,i._)(I,"contextType",f.a);let D=(0,g.wr)(I);class x extends l.Component{render(){return(0,o.FD)("div",{className:"thread-head-silhouette",children:[(0,o.Y)("div",{className:"thread-head-silhouette-head"}),(0,o.FD)("div",{className:"thread-head-silhouette-content",children:[(0,o.Y)("div",{className:"thread-head-silhouette-title"}),(0,o.Y)("div",{className:"thread-head-silhouette-meta"}),(0,o.FD)("div",{className:"thread-head-silhouette-body",children:[(0,o.Y)("div",{className:"thread-head-silhouette-body-line"}),(0,o.Y)("div",{className:"thread-head-silhouette-body-line"}),(0,o.Y)("div",{className:"thread-head-silhouette-body-line"})]})]})]})}}},77441:function(e,t,n){n(4006),n(17402),n(15734),n(82519),n(84605),n(86500),n(35369),n(76977),n(45859),n(50874)},73684:function(e,t,n){n.d(t,{j:()=>p});var i=n(4006),r=n(17159),o=n.n(r),l=n(79909),a=n(45947),s=n(73957),c=n(51683),d=n(39318),u=n(70189),m=n(49807),h=n(82776);function p(e){var t,n,r,o;let a,p,f,b,{comment:y,post:Y,publication:v}=e,_="Substack | Notes";v&&y.name?_="".concat(y.name," on ").concat(v.name):y.name&&y.handle?_="".concat(y.name," (@").concat(y.handle,")"):y.name?_=y.name:v&&(_="".concat(v.name));let w=Y&&v?(0,s.getPageTitleAndMeta)(Y,v,{isCommentPage:!0}).title:"".concat(_,': "').concat((0,h.truncateText)(y.body,280),'"'),C=(null!=(t=y.attachments)?t:[]).flatMap(e=>"image"===e.type?[e.imageUrl]:"post"===e.type&&e.postImageSelection?[e.postImageSelection.img_src]:[]),S=1===C.length?C[0]:null;S?(a=(0,m.dJ9)(S),b=!0):(0,c.lp)(y)?(p=680,f=680,a=(0,m.dJ9)((0,u.Hr)(y.id,{isSmall:!0,attachmentsOnly:!0}),f,{height:p}),b=!0):y.photo_url?(a=(0,m.dJ9)(y.photo_url,40),p=40,f=40):y.user_id&&(a=(0,m.dJ9)((0,d.Ji1)(y.user_id),40),p=40,f=40);let k=null!=(n=y.body)?n:"";return(0,i.FD)(i.FK,{children:[(0,i.Y)(l.Metadata,{title:w,socialTitle:_,description:k,image:a,isLargeImage:b,imageHeight:p,imageWidth:f,siteName:v?v.name:"Substack",publishedTime:y.date.toString(),meta:[{name:"twitter:label1",content:"Likes"},{name:"twitter:data1",content:String(null!=(r=y.reaction_count)?r:0)},{name:"twitter:label2",content:"Replies"},{name:"twitter:data2",content:String(null!=(o=y.children_count)?o:0)}]}),(0,i.Y)(g,{comment:y,includeBody:!0})]})}function g(e){let{comment:t,includeBody:n}=e;return t?(0,i.Y)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:o()((0,a.Q)(t,{includeViews:!1,includeBody:n}),{json:!0,isScriptContext:!0})}}):null}},27332:function(e,t,n){n.d(t,{GZ:()=>q,Iz:()=>H,LY:()=>T,M6:()=>M,X6:()=>W,j6:()=>F,jS:()=>P,l8:()=>L,qv:()=>J,wF:()=>B});var i=n(69277),r=n(70408),o=n(4006),l=n(75107),a=n(84565);n(58050);var s=n(84605),c=n(85478),d=n(46271);n(95282);var u=n(27749),m=n(51498),h=n(80520),p=n(72945),g=n(25859),f=n(90136),b=n(58292),y=n(89490),Y=n(35369),v=n(76977),_=n(45859),w=n(63136),C=n(504),S=n(83629),k=n(85050),A=n(16884),I=n(49095),D=n(16291),x=n(75914),N=n(49807),E=n(57324);let F=["post_like","post_restack","comment_like"],R=["search","note-related","profile","publication","permalink"];function T(e){let{author:t,post:n,comment:i,onClick:r,utm_content:l,publication:g,item:b,allowHide:y=!1,timestamp:Y,hideSubscribeCta:_,onDismiss:w,onToggleTranslation:C,isShowingTranslation:S}=e,k=(0,u.PK)(),A=Y||(null==i?void 0:i.date)||(null==n?void 0:n.post_date),I=(0,d.Jd)(),{getExperimentVariant:D,exposeExperiment:N}=(0,a.NQ)(),{language:E}=(0,s.GO)(),F=C&&i&&(0,f.$)(i,E),T=F&&"treatment"===D("universal_feed_translator_experiment");F&&N("universal_feed_translator_experiment");let P=I&&w&&t.id!==I.id&&((null==b?void 0:b.type)==="post"||(null==b?void 0:b.type)==="comment"),L=R.includes(k),G=!!(0,c.mJ)().getConfigFor("feed_item_source_debug_mode"),U=G&&b&&"trackingParameters"in b,M=!_&&t&&b&&!L;return(0,o.FD)(W,{children:[(0,o.FD)(v.I1,{flex:"grow",children:[(0,o.FD)(J,{children:[(0,o.Y)(B,{user:t,onClick:r,utm_content:l}),A&&(0,o.Y)(H,{timestamp:A,comment:i}),G&&b&&(0,o.Y)(j,{item:b,showEntityKey:!0,showDebugDot:null!=U&&U})]}),T&&C&&(0,o.Y)(f.P,{comment:i,onToggleTranslation:C,isShowingTranslation:null!=S&&S,item:b})]}),M&&(0,o.Y)(O,{author:t,item:b,comment:null!=i?i:void 0,post:null!=n?n:void 0,publication:null!=g?g:void 0}),b&&(0,x.tL)(b,i)&&"post"===b.type&&n&&g&&(0,o.Y)(h.N,{item:b,pub:g,post:n}),(0,o.FD)(v.pT,{maxHeight:20,gap:6,alignItems:"center",children:[(0,o.Y)(p.s,{publication:g,post:n,comment:i,item:b,allowHide:y}),P&&(0,o.Y)(m.R,{onDismiss:w,item:b})]})]})}function P(e){let{user:t,setTargetUser:n,eligibleTargetUsers:i,targetUser:r}=e;return(0,o.Y)(W,{children:(0,o.Y)(J,{children:(0,o.Y)(_.W1,{trigger:(0,o.Y)(Y.$n,{priority:"quaternary",size:"sm",color:"primary",trailing:(0,o.Y)(l.A,{size:16}),children:(0,o.Y)(L,{user:null!=r?r:t})}),children:i.map(e=>(0,o.Y)(_.Dr,{onClick:()=>{e.id===t.id?n(null):n(e)},children:e.name},e.id))})})})}function L(e){let{user:t}=e;return(0,o.Y)(W,{children:(0,o.FD)(J,{children:[(0,o.Y)(w.EY,{as:"span",weight:"medium",children:t.name}),(0,o.Y)(I.UserStatusSymbols,{status:t.status,userId:t.id,size:"xs"})]})})}function B(e){let{user:t,onClick:n,utm_content:i}=e;return(0,o.Y)(o.FK,{children:(0,o.FD)(w.EY.B3,{as:"span",weight:"medium",children:[(0,o.Y)(g.yp,{user:t,onClick:n,utm_source:E.VU.substackFeedItem,utm_content:i,children:t.name})," ",(0,o.Y)(I.UserStatusSymbols,{tier:t.bestseller_tier,status:t.status,userId:t.id,inline:!0,size:"xs"})]})})}function O(e){let{author:t,comment:n,post:i,item:r,permalink:l,publication:a}=e,{finalPublication:s,isSubscribed:c,showCta:d,handleClick:u,currentUser:m}=q({targetUser:t,item:r,comment:n,post:i,publication:a});return(!m||m.id!==t.id)&&s&&d?(0,o.Y)(l?U:G,{isSubscribed:c,onClick:u}):null}function G(e){let{isSubscribed:t,onClick:n}=e,{iString:i}=(0,s.GO)();return(0,o.Y)(Y.$n,{priority:t?"quaternary":"tertiary-accent",size:"xs",onClick:n,children:i(t?"Subscribed":"Subscribe")})}function U(e){let{isSubscribed:t,onClick:n}=e,{iString:i}=(0,s.GO)();return(0,o.Y)(Y.$n,{priority:t?"quaternary":"primary",size:"sm",onClick:n,children:i(t?"Subscribed":"Subscribe")})}let M=new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"});function H(e){let{timestamp:t,comment:n,post:i,publication:r}=e;return(0,o.Y)(g.Yq,{href:n?(0,N.Zgx)(n,{noBase:S.Z}):i?(0,N.q$n)(r,i):void 0,color:"secondary",title:M.format((0,D.A)(t).toDate()),children:(0,o.Y)(b.iE,{timestamp:t})})}function j(e){let{item:t,showEntityKey:n,showDebugDot:i}=e;return(0,o.FD)(v.pT,{flex:"grow",gap:4,alignItems:"center",justifyContent:"end",children:[n&&(0,o.Y)(z,{item:t}),i&&(0,o.Y)(V,{item:t})]})}function z(e){let{item:t}=e;return"entity_key"in t?(0,o.Y)(w.EY.B4,{as:"span",color:"secondary",children:t.entity_key}):null}function V(e){var t;let n,i,{item:r}=e,{iString:l}=(0,s.GO)(),a=null==(t=r.trackingParameters)?void 0:t.item_source;return a?"model"===a?(n="accent-green",i="Model"):a.includes("db")?(n="accent-blue",i="DB"):a.includes("new-user")?(n="accent-purple",i="New user"):a.includes("trending")?(n="accent-red",i="Trending"):(n="tertiary",i="Other"):(n="accent-yellow",i="No source info"),(0,o.Y)("span",{children:(0,o.Y)(y.az,{height:8,width:8,radius:"full",bg:n,color:"secondary",title:l(i)})})}let W=(0,y.I4)((0,r._)((0,i._)({},w.nS),{display:"flex",minWidth:0,gap:8,alignItems:"center",justifyContent:"space-between"}));(0,y.I4)((0,r._)((0,i._)({},w.nS),{display:"flex",minWidth:0,gap:12,alignItems:"center"}));let J=(0,y.I4)({display:"flex",flex:"grow",minWidth:0,gap:8,alignItems:"center"});function q(e){var t,n;let{targetUser:i,item:r,comment:o,post:l,publication:a}=e,s=(0,d.Jd)(),c=(0,u.PK)(),m=o?"comment":l?"post":void 0,h=null!=(n=null!=(t=null==o?void 0:o.id)?t:null==l?void 0:l.id)?n:0,p=m?(0,N.Vvu)(h,m):void 0,g=null!=a?a:null==i?void 0:i.primary_publication,f=(0,k.s)({surface:"substack-feed-item"})(g),b=(0,A.Zm)({user:i,publicationId:null==g?void 0:g.id,publicationName:null==g?void 0:g.name,subscriptionSource:"substack-feed-item",sourceNoteId:p});return{finalPublication:g,isSubscribed:b.isSubscribed,showCta:b.showCta,handleClick:e=>{r&&(0,C.Qb)(r,c,"subscribe"),!s&&g?f(e):b.isSubscribed?b.unsubscribe(e):b.subscribe(e)},currentUser:s}}},25714:function(e,t,n){n.d(t,{P:()=>u});var i=n(4006),r=n(32485),o=n.n(r),l=n(27437),a=n(84777),s=n(46271),c=n(28700),d=n(8895);function u(e){let{id:t,label:n,type:r,url:o,unstyled:l}=e;return(0,i.Y)("span",{className:"node-substack_mention",children:"pub"===r?(0,i.Y)(h,{id:t,url:o,label:n,unstyled:l}):(0,i.Y)(m,{id:t,label:n,unstyled:l})})}function m(e){let{id:t,label:n,unstyled:r}=e,a=(0,s.Jd)(),u=a&&a.id===t;return(0,i.Y)(l.ProfileHoverCard,{subject:{id:t,name:n},trigger:(0,i.Y)("a",{className:o()(d.A.mention,u&&d.A.self,r&&d.A.unstyled),href:(0,c.rf)(t,n),children:n})})}function h(e){let{id:t,url:n,label:r,unstyled:l}=e,c=(0,s.Jd)(),u=c&&c.id===t;return(0,i.Y)(a.m,{pubId:t,trigger:(0,i.Y)("a",{className:o()(d.A.mention,u&&d.A.self,l&&d.A.unstyled),href:n,children:r})})}},1124:function(e,t,n){n.d(t,{f:()=>P});var i=n(69277),r=n(70408),o=n(4006),l=n(54718),a=n(99084),s=n(29665),c=n(82853),d=n(84934),u=n(27786),m=n(21767),h=n(68397),p=n(1839),g=n(50180),f=n(37946),b=n(16079),y=n(15977),Y=n(32641),v=n(97731);let _=e=>{var{size:t=24,color:n="var(--color-fg-primary)",className:l}=e,a=(0,Y._)(e,["size","color","className"]);return(0,o.Y)(v.A,(0,r._)((0,i._)({},a),{name:"LinearIcon",svgParams:{viewBox:"0 0 20 20"},width:t,height:t,fill:n,stroke:"none",className:l,children:(0,o.Y)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.1645 4.135C4.00898 3.15069 5.05652 2.36084 6.23515 1.81968C7.41378 1.27853 8.69557 0.998899 9.9925 1C14.968 1 19 5.032 19 10.0068C19 12.7368 17.785 15.184 15.865 16.8355L3.16525 4.135H3.1645ZM2.36275 5.2195L14.7797 17.6365C14.3867 17.884 13.9735 18.1015 13.5422 18.286L1.71325 6.45775C1.8985 6.0265 2.116 5.6125 2.36275 5.2195ZM1.2415 7.87225L12.1277 18.7585C11.5952 18.8875 11.0455 18.97 10.4815 19L1 9.5185C1.02949 8.96347 1.11034 8.41237 1.2415 7.87225ZM1.114 11.5188L8.48125 18.8868C6.6415 18.5724 4.94467 17.6948 3.62492 16.3751C2.30517 15.0553 1.42758 13.3585 1.11325 11.5188H1.114Z"})}))};var w=n(84605),C=n(66729),S=n(7684),k=n(35369),A=n(76977),I=n(45859),D=n(78526),x=n(2481),N=n(58278),E=n(39318),F=n(18947),R=n(82776),T=n(70515);function P(e){let{comment:t,pub:n,post:i,user:r,onChange:a,startEdit:s,startReport:c,openBan:d,isCollapsed:u,toggleCollapse:m}=e;return!function(e){let{menuEnabled:t}=Z(e);return t}({comment:t,user:r})?null:(0,o.Y)(A.fI,{className:"triggerContainer-eX588u",children:(0,o.Y)(I.W1,{trigger:(0,o.Y)(k.K0,{priority:"quaternary",size:"sm",className:"trigger-j08Uop",children:(0,o.Y)(l.A,{size:16})}),children:(0,o.Y)(B,{comment:t,pub:n,post:i,user:r,onChange:a,startEdit:s,startReport:c,openBan:d,isCollapsed:u,toggleCollapse:m})})})}function L(e){let{sections:t}=e,n=t.map(e=>(0,r._)((0,i._)({},e),{items:e.items.filter(e=>{var t;return null!==e&&(null==e||null==(t=e.props)?void 0:t.enabled)!==!1})})).filter(e=>e.items.length>0);return(0,o.Y)(o.FK,{children:n.map((e,t)=>(0,o.Y)(I.H9,{isFirst:0===t,children:e.items},e.key))})}function B(e){var t;let{comment:n,pub:i,post:r,user:l,onChange:a,startEdit:s,startReport:c,openBan:d,isCollapsed:u,toggleCollapse:m}=e,h=Z({comment:n,user:l}),p=[{key:"editing",items:[(0,o.Y)(U,{enabled:h.editCommentEnabled,onClick:s})]},{key:"sharing",items:[(0,o.Y)(G,{enabled:!0}),(0,o.Y)(q,{enabled:h.restackCommentEnabled})]},{key:"actions",items:[(0,o.Y)(M,{enabled:h.pinCommentEnabled}),(0,o.Y)(O,{enabled:!0,isCollapsed:u,toggleCollapse:m}),(0,o.Y)(H,{enabled:h.giftSubscriptionEnabled}),(0,o.Y)(X,{enabled:null!=(t=null==l?void 0:l.is_global_admin)&&t}),(0,o.Y)(j,{enabled:h.subscriberDetailsEnabled})]},{key:"admin",items:[(0,o.Y)(z,{enabled:h.deleteCommentEnabled}),(0,o.Y)(V,{enabled:h.removeCommentEnabled}),(0,o.Y)(W,{enabled:h.reportCommentEnabled,onClick:c}),(0,o.Y)(J,{enabled:h.banUserEnabled,onClick:d})]}];return(0,o.Y)(C.g,{value:{comment:n,pub:i,post:r,onChange:a,toggleCollapse:m},children:(0,o.Y)(L,{sections:p})})}function O(e){let{enabled:t,isCollapsed:n,toggleCollapse:i}=e,{iString:r}=(0,w.GO)();return t?(0,o.Y)(I.Dr,{leading:n?(0,o.Y)(a.A,{}):(0,o.Y)(s.A,{}),onClick:i,children:r(n?"Expand":"Collapse")}):null}function G(e){let{enabled:t}=e,{iString:n}=(0,w.GO)(),{comment:i,post:r,pub:l}=(0,S.c4)(),a=(0,D.L)();return t?(0,o.Y)(I.Dr,{leading:(0,o.Y)(c.A,{}),onClick:()=>{a((0,F.XB)(r,i,l))},children:n("Copy link")}):null}function U(e){let{enabled:t,onClick:n}=e,{iString:i}=(0,w.GO)();return t?(0,o.Y)(I.Dr,{leading:(0,o.Y)(d.A,{}),onClick:n,children:i("Edit")}):null}function M(e){let{enabled:t}=e,{iString:n}=(0,w.GO)(),{comment:i,onChange:r}=(0,S.c4)(),{pinned:l,togglingPin:a,togglePinned:s}=(0,S.Mr)({comment:i,onChange:r});return t?(0,o.Y)(I.Dr,{leading:(0,o.Y)(u.A,{}),onClick:s,children:n(a?l?"Unpinning...":"Pinning...":l?"Unpin":"Pin")}):null}function H(e){let{enabled:t}=e,{iString:n}=(0,w.GO)(),{comment:i,pub:r}=(0,S.c4)();if(!t)return null;let l="".concat(r.base_url,"/subscribe?gift=true&recipient=").concat(i.user_id,"-").concat((0,N.JG)(i.name,{hashIfEmpty:!0}),"&comment_id=").concat(i.id,"}");return(0,o.Y)(I.Dr,{leading:(0,o.Y)(m.A,{}),href:l,children:n("Gift a subscription")})}function j(e){let{enabled:t}=e,{iString:n}=(0,w.GO)(),{comment:i,pub:r}=(0,S.c4)();return t?(0,o.Y)(I.Dr,{leading:(0,o.Y)(h.A,{}),onClick:()=>{if(i.email)return window.open((0,E.w8b)(r,i.email),"_blank")},children:n("Subscriber details")}):null}function z(e){let{enabled:t}=e,{iString:n}=(0,w.GO)(),{comment:i,onChange:r}=(0,S.c4)(),{isDeleting:l,deleteComment:a}=(0,S.yy)({comment:i,onChange:r});return t?(0,o.Y)(I.Dr,{leading:(0,o.Y)(p.A,{}),onClick:a,priority:"destructive",children:n(l?"Deleting...":"Delete")}):null}function V(e){let{enabled:t}=e,{iString:n}=(0,w.GO)(),{comment:i,onChange:r}=(0,S.c4)(),{isRemoving:l,removeComment:a}=(0,S.d4)({comment:i,onChange:r});return t?(0,o.Y)(I.Dr,{leading:(0,o.Y)(g.A,{}),onClick:a,priority:"destructive",children:n(l?"Removing...":"Remove")}):null}function W(e){let{enabled:t,onClick:n}=e,{iString:i}=(0,w.GO)();return t?(0,o.Y)(I.Dr,{leading:(0,o.Y)(f.A,{}),onClick:n,priority:"destructive",children:i("Report")}):null}function J(e){let{enabled:t,onClick:n}=e,{iString:i}=(0,w.GO)();return t?(0,o.Y)(I.Dr,{leading:(0,o.Y)(b.A,{}),onClick:n,priority:"destructive",children:i("Ban or suspend user")}):null}function q(e){let{enabled:t}=e,n=(0,x.NP)(),{comment:i,pub:r,post:l}=(0,S.c4)(),{iString:a}=(0,w.GO)();return t?(0,o.Y)(I.Dr,{leading:(0,o.Y)(y.A,{}),onClick:()=>{n.open({restackUrl:(0,F.XB)(l,i,r)})},children:a("Restack")}):null}function X(e){let{enabled:t}=e,{iString:n}=(0,w.GO)(),{comment:i,post:r,pub:l}=(0,S.c4)(),{addCommentToLinear:a}=(0,S.eu)({comment:i,post:r,pub:l});return t?(0,o.Y)(I.Dr,{leading:(0,o.Y)(_,{}),onClick:a,children:n("Add to Linear")}):null}function Z(e){let{comment:t,user:n}=e,i=!!(n&&n.id===t.user_id),r=!!(null==n?void 0:n.is_contributor)&&(0,T.Pp)(t)||!!(null==n?void 0:n.is_community_moderator)&&(0,T.Pp)(t),o=(0,R.canEditComment)(n,t),l=!!(null==n?void 0:n.is_contributor)&&(0,T.Pp)(t)&&""===t.ancestor_path,a=!i&&!!t.metadata.eligibleForGift&&!t.metadata.is_author,s=!i&&!t.reported_by_user&&!t.hidden&&!t.suppressed,c=r&&!i,d=r&&!t.user_banned&&!i,u=!!r&&!!t.email&&!i,m=(0,T.Pp)(t)&&!(null==n?void 0:n.is_oauth),h=o||l||a||s||c||d||u||m;return{editCommentEnabled:o,pinCommentEnabled:l,giftSubscriptionEnabled:a,reportCommentEnabled:s,deleteCommentEnabled:i,removeCommentEnabled:c,banUserEnabled:d,subscriberDetailsEnabled:u,restackCommentEnabled:m,menuEnabled:h}}},66729:function(e,t,n){n.d(t,{I:()=>r,g:()=>o});var i=n(4006);let r=(0,n(17402).createContext)(null);function o(e){let{children:t,value:n}=e;return(0,i.Y)(r.Provider,{value:n,children:t})}},47570:function(e,t,n){n.d(t,{D:()=>u});var i=n(4006),r=n(98645),o=n(45773),l=n(84605),a=n(13022),s=n(35369),c=n(45859),d=n(70515);let u=e=>{let{currentSort:t,isLoading:n,pub:o,handleSort:a,disableMobileBottomSheet:u}=e,{iString:h}=(0,l.GO)();return(0,i.Y)(c.W1,{trigger:(0,i.Y)(s.$n,{size:"sm",priority:"secondary",disabled:n,leading:(0,i.Y)(r.A,{size:18}),children:(0,d.rX)(t,o.language)}),"aria-label":h("Sort comments"),disableMobileBottomSheet:u,children:(0,i.Y)(m,{currentSort:t,pub:o,handleSort:a})})},m=e=>{let{currentSort:t,pub:n,handleSort:r}=e,l=!!(0,a.Ay)("like_comments_enabled");return(0,i.Y)(i.FK,{children:(0,d.Qz)({likesEnabled:l,language:n.language}).map(e=>{let{key:n,text:l}=e;return(0,i.Y)(c.Dr,{onClick:()=>r(n),trailing:n===t?(0,i.Y)(o.A,{}):void 0,children:l},n)})})}},42774:function(e,t,n){n.d(t,{Ud:()=>v,GL:()=>k,FS:()=>A,Q0:()=>S});var i=n(69277),r=n(79785),o=n(4006),l=n(48635),a=n(70408),s=n(32641),c=n(97731);let d=e=>{var{size:t=24,fill:n="var(--color-fg-primary)"}=e,r=(0,s._)(e,["size","fill"]);return(0,o.Y)(c.A,(0,a._)((0,i._)({},r),{name:"CommentBadgeHeartIcon",svgParams:{viewBox:"0 0 20 20"},width:t,height:t,fill:n,children:(0,o.Y)("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 u=n(76438),m=n(84605),h=n(7684),p=n(76977),g=n(75303),f=n(81929),b=n(66511);function y(){let e=(0,r._)(["Pinned by ",""]);return y=function(){return e},e}function Y(){let e=(0,r._)(["Liked by ",""]);return Y=function(){return e},e}let v=e=>{let{comment:t}=e;return t.pinned_by_user_id?(0,o.Y)(_,{name:t.pinned_by_name}):t.metadata.is_author?(0,o.Y)(w,{}):t.reactor_names.length>0?(0,o.Y)(C,{names:t.reactor_names}):null},_=e=>{let{name:t}=e,{iString:n,iTemplate:r}=(0,m.GO)();return t?(0,o.Y)(b.m_,{text:r(y(),t),children:(0,o.Y)(f.vw,{priority:"secondary",cursor:"pointer",fillIcon:!0,leading:(0,o.Y)(u.A,(0,i._)({},f.Oi)),children:n("Pinned")})}):(0,o.Y)(f.vw,{priority:"secondary-outline",fillIcon:!0,leading:(0,o.Y)(u.A,(0,i._)({},f.Oi)),children:n("Pinned")})},w=()=>{let{iString:e}=(0,m.GO)();return(0,o.Y)(f.vw,{priority:"secondary-outline",theme:"accent",children:e("Author")})},C=e=>{let{names:t}=e,{iTemplate:n}=(0,m.GO)();return(0,o.Y)(f.vw,{theme:"accent",priority:"secondary-outline",fillIcon:!0,leading:(0,o.Y)(d,(0,i._)({},f.Oi)),children:n(Y(),t.join(", "))})},S=e=>{let{comment:t,userBanned:n}=e,{banText:i,shouldShowBanText:r}=(0,h.d3)(t);return!r||n?null:(0,o.Y)(f.vw,{priority:"secondary",children:i})},k=e=>{let{comment:t,userPendingApproval:n}=e,{iString:r}=(0,m.GO)();return n?(0,o.Y)(g.AE,{href:"/publish/moderation/new-commenters?user=".concat(t.user_id),target:"_blank",rel:"noopener",children:(0,o.Y)(f.vw,{priority:"secondary",cursor:"pointer",trailing:(0,o.Y)(l.A,(0,i._)({},f.Oi)),children:r("Awaiting approval")})}):null},A=e=>{let{children:t}=e;return(0,o.Y)(p.fI,{gap:4,children:t})}},17096:function(e,t,n){n.d(t,{Wh:()=>ek,ko:()=>eb,WR:()=>eY,cQ:()=>ef,yQ:()=>ey,Gs:()=>ev});var i=n(99851),r=n(69277),o=n(70408),l=n(79785),a=n(4006),s=n(32485),c=n.n(s),d=n(78659),u=n.n(d),m=n(69843),h=n.n(m),p=n(6498),g=n.n(p),f=n(17402),b=n(15734),y=n.n(b),Y=n(94090),v=n(58398),_=n(52820),w=n(84605),C=n(70145),S=n(45611),k=n(86500),A=n(55376),I=n(54687),D=n(72170),x=n(68611),N=n(55136),E=n(25859),F=n(13022),R=n(76977),T=n(45859),P=n(63136),L=n(28916);let B="link-_X6et2";function O(e){let{pub:t,post:n,comment:i,onChange:r}=e,{iString:o}=(0,w.GO)(),{canRestack:l,isRestacked:s,restacks:d,menuItems:u,nuxModal:m}=(0,L.I)({pub:t,post:n,comment:i,onRestack:e=>{r({restacked:e,restacks:d+(e?1:-1)})}});return l?(0,a.FD)("span",{children:[m,(0,a.Y)(T.W1,{trigger:(0,a.FD)("a",{className:c()("restack-button",s&&"restacked"),href:"javascript:void(0)",children:[(0,a.Y)(x.A,{}),o("Restack"),d>0&&" (".concat(d,")")]}),children:u})]}):null}let G=e=>{var t;let{comment:n,pub:i,user:r,post:o,reaction_token:l,commentsEnabledForPost:s,noRestack:d,onChange:u,startReply:m,shareComment:h,updateCommentReacted:p,hideShare:g,commentActionsOverride:f}=e,{iString:b}=(0,w.GO)(),y=(0,F.Ay)("like_comments_enabled");return(0,a.Y)(R.pT,{gap:16,alignItems:"center",justifyContent:"start",paddingTop:8,className:c()("comment-actions",{"withShareButton-hQzuEn":!!h}),children:!n.deleted&&[y&&(0,a.Y)(N.cy,{user:r,pub:i,post:o,comment:n,height:16,countInParenthesesStyle:!0,token:l,onChange:e=>{let{comment:t}=e;return u(t)},onReactedChange:e=>{p&&p(n.id,e)},noSelfUpdate:!!p,commentActionsOverride:f}),s&&(0,a.Y)(E.Yq,{onClick:f||(()=>m()),className:B,children:(0,a.FD)(R.pT,{gap:6,alignItems:"center",children:[(0,a.Y)(I.A,{stroke:"var(--color-fg-secondary-themed)",size:16}),(0,a.FD)(P.EY.Meta,{color:"pub-secondary-text",children:[b("Reply"),(null==(t=n.children)?void 0:t.length)>0&&" (".concat(n.children.length,")")]})]})}),!g&&!!h&&(0,a.Y)(E.Yq,{onClick:f||(()=>h(n.id)),className:B,children:(0,a.FD)(R.pT,{gap:6,alignItems:"center",children:[(0,a.Y)(D.A,{stroke:"var(--color-fg-secondary-themed)",size:16}),(0,a.Y)(P.EY.Meta,{color:"pub-secondary-text",children:b("Share")})]})}),!d&&(0,a.Y)(O,{pub:i,post:o,comment:n,onChange:u})]})};var U=n(43262),M=n(87087),H=n(35369),j=n(16291),z=n(83873),V=n(39318),W=n(82776),J=n(57324),q=n(70515);let X=e=>{var t;let{comment:n,showHiddenComment:i,setShowHiddenComment:r}=e,{iString:o}=(0,w.GO)(),l=null==(t=n.bans)?void 0:t.find(e=>e.publication_id===n.publication_id),s=l&&(0,j.A)(l.expiry).diff((0,j.A)(),"years")>=1,c=(0,q.Pp)(n)&&(n.user_banned_for_comment||n.reported_by_user),d=o(s?"User was indefinitely suspended for this comment. ":"User was temporarily suspended for this comment. "),u=n.user_banned_for_comment?d:o("You reported this comment. ");return c&&(0,a.Y)("div",{className:"comment_notice",children:(0,a.FD)("i",{children:[u,(0,a.Y)("a",{href:"javascript:void(0)",onClick:()=>r(!i),children:i?"Hide":"Show"})]})})},Z=e=>{let{comment:t}=e,{iString:n}=(0,w.GO)(),{title:i,truncated_body_text:r,date:o,bylines:l,like_count:s,comment_count:c,url:d}=t.reply;return(0,a.FD)("a",{className:"reply-comment",href:(0,V.yRP)(d,{utm_source:J.VU.substack,utm_campaign:J._9.postReplyComment,utm_medium:J.Jn.web}),"data-native":!0,children:[(0,a.Y)("div",{className:"reply-comment-title",children:i}),r&&(0,a.Y)("div",{className:"reply-comment-body",children:(0,W.formatEllipsis)(r)}),(0,a.Y)(P.EY.B4,{weight:"semibold",as:"div",className:"reply-comment-read-more",role:"button",children:n("Read more")}),(0,a.Y)("div",{className:"reply-comment-meta",children:(0,W.getPostEmbedMeta)({date:o,bylines:l,like_count:s,comment_count:c})})]})},K=e=>{let{comment:t,bodyRef:n,expandToggleClicked:i,isLong:r,isExpanded:o}=e;o=o||!r;let[l,s]=(0,f.useState)(!1),d=(t.user_banned_for_comment||t.reported_by_user)&&!l,{iString:u}=(0,w.GO)(),m=t.age_verification&&t.age_verification.status!==z.Y.CompletedAdult;return(0,a.FD)(a.FK,{children:[(0,a.FD)("div",{className:c()("comment-body",{long:r,expanded:o}),ref:n,children:[(0,a.Y)(X,{comment:t,showHiddenComment:l,setShowHiddenComment:s}),m?(0,a.Y)(U.T,{content:t,description:t.body,source:"comment"}):t.hidden?(0,a.Y)("i",{children:u("Comment hidden")}):t.deleted?(0,a.Y)("i",{children:u("Comment deleted")}):d?(0,a.Y)("i",{}):t.suppressed&&!l?(0,a.Y)("i",{children:u("Comment removed")}):"reply"===t.type?(0,a.Y)(Z,{comment:t}):(0,M.yY)(t.body)]}),r&&!o&&(0,a.Y)(H.$n,{size:"sm",priority:"secondary-outline",onClick:()=>i(),children:u("See more")})]})};var $=n(56878),Q=n(57023),ee=n(40972),et=n(24078),en=n(75303),ei=n(49807);function er(e){let{comment:t,onClick:n,utm_content:i,noHover:r}=e,o=(0,M.DH)(t),l=(0,ei.gYq)(o,{utm_source:"comment",utm_content:i}),s=null!=n?n:()=>{};return t.user_banned?(0,a.Y)(en.AE,{href:l,onClick:s,children:(0,a.Y)(et.V0,{size:32,icon:(0,a.Y)(ee.A,{stroke:"var(--color-fg-tertiary)"})})}):eo(o,r,l,s)}let eo=(e,t,n,i)=>t?(0,a.Y)(et.dm,{user:e,size:32,linkProps:{href:n,onClick:i}}):(0,a.Y)(et.tp,{user:e,size:32,linkProps:{href:n,onClick:i}});var el=n(89490);function ea(e){let{onCollapse:t}=e;return(0,a.Y)(R.VP,{className:"collapser-Xs0O6C",onClick:t,children:(0,a.Y)(el.az,{className:"threadLine-BvF1wF",animate:!0})})}var es=n(8149),ec=n(50129),ed=n(18947);function eu(){let e=(0,l._)(["Comment by ",""]);return eu=function(){return e},e}let em=Math.min(Math.ceil((u()(document.body.clientWidth,400,728)-140)/50),10);class eh extends f.Component{componentDidMount(){this.setSelectedHighlight(),this.setReplyStateFromHash(),this.updateIsLong()}componentDidUpdate(e){var t,n;(null==(t=e.comment)?void 0:t.id)!==(null==(n=this.props.comment)?void 0:n.id)&&this.setSelectedHighlight(),e.replying!==this.props.replying&&this.props.replying&&this.startReply()}setReplyStateFromHash(){if(this.props.comment.deleted||"undefined"==typeof window||!window.location.hash)return;let e=/^#comment-(\d+)-reply$/.exec(window.location.hash);e&&Number(e[1])===this.props.comment.id&&(window.location.hash=window.location.hash.replace(/-reply$/,""),this.startReply())}async startReply(){this.props.onStartReply?this.props.onStartReply(this.props.comment):await new Promise(e=>this.setState({replying:!0},e))}onDateClick(e){var t;let[n,i]=e.target.href.split("?")[0].split("#");n===(null==(t=window.location.href.split("?")[0])?void 0:t.split("#")[0])&&i&&(e.preventDefault(),this.setState({hideAnchors:!0},()=>{window.location.hash="#".concat(i),this.setState({hideAnchors:!1})}))}render(){var e,t,n,i,l;let{user:s,comment:d,freeSignup:u,freeSignupEmail:m,pub:p,post:g,reaction_token:f,depth:b,collapseAtDepth:y,onChange:Y,scrollRef:v,retainUserCollapseState:_,onStartReply:w,noHoverProfile:C,onProfileClick:S,onShareComment:k,hideContextMenu:A,noRestack:I,updateCommentReacted:D,iString:x,iTemplate:N,hideShare:E,commentActionsOverride:F}=this.props,{isSelected:T,replying:P,editing:L,hideAnchors:B,isCollapsed:O}=null!=(i=this.state)?i:{},U=p.community_enabled&&g&&"none"!==g.write_comment_permissions,{user_banned:j}=d;if(L&&s)return(0,a.Y)($.g,{autoFocus:!0,user:s,freeSignup:u,freeSignupEmail:m,pub:p,post:g,commentBeingEdited:d,saveEdit:this.saveEdit,token:f,onCancel:()=>this.setState({editing:!1}),onSuccess:Y?this.onSaveEditSuccess:null});let z=null==(e=(0,M.DH)(d))?void 0:e.name,V=z?N(eu(),z):x("Comment"),W=this.state.isLong&&!this.state.isExpanded;return(0,a.FD)("div",{className:c()("comment",{selected:T,"post-reply":"reply"===d.type,collapsed:O}),children:[!B&&[(0,a.Y)("div",{id:"comment-".concat(d.id),className:"comment-anchor"}),(0,a.Y)("div",{id:"comment-".concat(d.id,"-reply"),className:"comment-anchor"})],(0,a.FD)(R.fI,{gap:12,paddingBottom:12,className:"comment-content",role:"article","aria-label":V,children:[(0,a.Y)(R.VP,{ref:this.headContainerRef,children:(0,a.Y)(er,{comment:d,noHover:C,onClick:S?()=>S(d):void 0})}),(0,a.FD)(R.VP,{flex:"grow",children:[(0,a.Y)(Q.P,{post:g,pub:p,comment:d,isCollapsed:O,toggleCollapse:()=>this.setCollapsed(!this.state.isCollapsed),onProfileClick:S,userBanned:null!=j&&j,userPendingApproval:d.status===ec.nJ.new_commenter_approval_required&&!!(null==s?void 0:s.is_admin),onChange:this.onChange,startEdit:()=>this.startEdit(),startReport:this.showReportModal,openBan:this.openBan,hideContextMenu:A}),(0,a.Y)(K,{comment:d,bodyRef:this.bodyRef,expandToggleClicked:this.expandToggleClicked,isLong:W,isExpanded:this.state.isExpanded}),(0,a.Y)(G,{comment:d,pub:p,user:s,post:g,reaction_token:f,commentsEnabledForPost:U,noRestack:I,onChange:this.onChange,startReply:()=>this.startReply(),updateCommentReacted:D,shareComment:k,hideShare:E,commentActionsOverride:F}),(0,a.Y)(es.N,{open:P&&U,children:(0,a.Y)(ep,{children:(0,a.Y)($.g,{autoFocus:!0,user:s,freeSignup:u,freeSignupEmail:m,pub:p,post:g,parent:d,token:f,onCancel:()=>this.setState({replying:!1}),onSuccess:Y?e=>{this.setState({replying:!1}),Y((0,o._)((0,r._)({},d),{children:[e].concat(d.children)}))}:null,alwaysShowButtons:!0})})})]})]}),d.childrenSummary&&(0,a.Y)("div",{className:"more-replies-container",children:(0,a.Y)("a",{className:"more-replies",href:(0,ed.XB)(g,d,p),children:d.childrenSummary})}),!d.childrenSummary&&!h()(b)&&b>=em&&!!(null==(t=d.children)?void 0:t.length)&&(0,a.Y)(R.fI,{className:"more-replies-container",children:(0,a.Y)(H.vx,{size:"sm",priority:"secondary-outline",href:(0,ed.XB)(g,d,p),children:x("Continue thread →")})}),!d.childrenSummary&&!h()(b)&&b0&&(0,a.Y)(ea,{onCollapse:()=>this.setCollapsed(!0)})]},d.id)}constructor(e,t){super(e,t),(0,i._)(this,"bodyRef",(0,f.createRef)()),(0,i._)(this,"headContainerRef",(0,f.createRef)()),(0,i._)(this,"openBan",()=>{this.props.commentActions.openBanDialog({comment:this.props.comment,onReply:()=>{this.startReply()}})}),(0,i._)(this,"updateIsLong",()=>{let e=this.bodyRef.current;if(!e)return;let t=e.scrollHeight>e.clientHeight+200;t!==this.state.isLong&&this.setState({isLong:t})}),(0,i._)(this,"setSelectedHighlight",()=>{let e=(0,M.jv)()===this.props.comment.id;this.setState({isSelected:e})}),(0,i._)(this,"startEdit",()=>{this.setState({editing:!0})}),(0,i._)(this,"saveEdit",async e=>{if(this.state.editing)return{res:await this.props.maybeOAuthRequest.patch("/api/v1/comment/".concat(this.props.comment.id)).send({body:e})}}),(0,i._)(this,"onSaveEditSuccess",e=>{var t,n;let{edited:i}=e;this.setState({editing:!1}),null==(t=(n=this.props).onChange)||t.call(n,(0,r._)({},this.props.comment,i))}),(0,i._)(this,"showReportModal",()=>{var e;let{pub:t,comment:n}=this.props;this.props.onReport({pub:t,canReportToAdmins:!!(null==t?void 0:t.moderation_enabled)&&!(null==(e=n.metadata)?void 0:e.is_author),onSubmit:async e=>{var i,l;let{reportCategory:a,reportedToSubstack:s,details:c}=e;await y().post("/api/v1/comment/".concat(n.id,"/report")).send({publication_id:null==t?void 0:t.id,details:c,reportCategory:a,reportedToSubstack:s}),null==(i=(l=this.props).onChange)||i.call(l,(0,o._)((0,r._)({},this.props.comment),{reported_by_user:!0}))}})}),(0,i._)(this,"expandToggleClicked",()=>{let e=this.bodyRef.current;if(!e)return;let t=e.scrollHeight-e.clientHeight;(0,k.u4)(k.qY.COMMENT_EXPAND_TOGGLE_CLICKED,{hiddenHeight:t>0?t.toString():null}),this.setState({isExpanded:!0})}),(0,i._)(this,"onChange",e=>{this.props.onChange?this.props.onChange((0,r._)({},this.props.comment,e)):document.location.href=(0,M.PG)(this.props.post,this.props.pub)}),(0,i._)(this,"setComment",e=>{this.setState({comment:e})}),(0,i._)(this,"setCollapsed",e=>{var t,n;if(this.setState({isCollapsed:e}),e&&(null==(n=this.headContainerRef)||null==(t=n.current)?void 0:t.scrollIntoView)){let e=this.headContainerRef.current.getBoundingClientRect();e.top<0&&(document.documentElement.scrollTop+=e.top-80)}this.props.retainUserCollapseState&&(0,M.Pm)(this.props.comment.id,e)}),this.state={editing:!1,replying:!1,hideAnchors:!1,isSelected:!1,isCollapsed:this.props.retainUserCollapseState&&(0,M.pz)(this.props.comment.id),isExpanded:!1,isLong:!1}}}(0,i._)(eh,"contextType",_.qL);let ep=(0,el.I4)({display:"flex",flex:"grow",paddingTop:16}),eg=(0,f.memo)((0,w.wr)(function(e){let t=(0,f.useContext)(eA),n=(0,Y.uc)(),i=(0,C.jN)();return(0,a.Y)(eh,(0,o._)((0,r._)({},e),{commentActions:t,onReport:n,maybeOAuthRequest:i}))}));eh.displayName="Comment_Internal";let ef=5,eb=1,ey=16,eY=50,ev=200;function e_(e){return e.reduce((e,t)=>e+1+e_(t.children||[]),0)}let ew=e=>{let{user:t,freeSignup:n,freeSignupEmail:i,pub:r,post:o,comments:l,reaction_token:s,depth:d,collapseAtDepth:u,onChange:m,pageSize:h,retainUserCollapseState:p,updateCommentReacted:b,parent:y,scrollRef:Y,className:_,onStartReply:C,noHoverProfile:k,onProfileClick:A,hideContextMenu:I,noRestack:D,hideShare:x,commentActionsOverride:N}=e,E=h||ey,[F,R]=(0,f.useState)(!1),[T,P]=(0,f.useState)(!1),[L,B]=(0,f.useState)(E),[O,G]=(0,f.useState)(-1),[U,M]=(0,f.useState)(new Set(l.map(e=>{let{id:t}=e;return t}))),[j,z]=(0,f.useState)(!1),[V,W]=(0,f.useState)(void 0),{iString:q,iPlural:X}=(0,w.GO)();(0,f.useEffect)(()=>{O>=0&&window.scrollTo(window.scrollX,O)},[O]);let Z=(0,S._)(e=>{W(e),z(!0)});if(0===(l||[]).length)return null;let[K,$]=g()(null!=l?l:[],e=>{let{id:n,user_id:i}=e;return U.has(n)||i===(null==t?void 0:t.id)}),Q=K.slice(0,L);return(0,a.FD)(a.FK,{children:[(0,a.FD)("div",{className:c()("comment-list",_,{"has-new-comments":$.length>0}),children:[$.length>0&&(0,a.Y)(H.$n,{size:"sm",priority:"secondary-outline",onClick:()=>{setTimeout(()=>{M(new Set(l.map(e=>{let{id:t}=e;return t}))),P(!1)},0),P(!0)},children:T?X("loading 1 new reply","loading %1 new replies",e_($)):X("1 new reply","%1 new replies",e_($))}),(0,a.Y)("div",{className:"comment-list-items",children:Q.map(e=>(0,a.Y)(eg,{user:t,freeSignup:n,freeSignupEmail:i,pub:r,post:o,comment:e,parent:y,reaction_token:s,collapseAtDepth:u,depth:d||0,onChange:m,scrollRef:Y,retainUserCollapseState:p,onStartReply:C,noHoverProfile:k,onShareComment:Z,onProfileClick:A,hideContextMenu:I,noRestack:D,updateCommentReacted:b,hideShare:x,commentActionsOverride:N},e.id))}),K.length>Q.length&&(0,a.Y)(H.$n,{size:"sm",priority:"secondary-outline",loading:F,onClick:()=>{G(window.scrollY),setTimeout(()=>{B(L+E),R(!1)},0),R(!0)},children:q("Load More")})]}),(0,a.Y)(v.Z,{isOpen:j,onClose:()=>z(!1),pub:r,post:o,commentId:V,comments:l,user:null!=t?t:void 0,utm_campaign:J._9.commentListShareCta,medium:"web"})]})};ew.displayName="CommentList";let eC=(0,f.memo)(ew);eC.displayName="CommentList";let eS=eC;function ek(e){let[t,n]=(0,f.useState)(null),i=(0,f.useMemo)(()=>({openBanDialog:n}),[]);return(0,a.FD)(eA.Provider,{value:i,children:[(0,a.Y)(eS,(0,r._)({},e)),(0,a.Y)(A.wI,(0,o._)((0,r._)({},t),{onClose:()=>n(null),onBan:(t,n)=>{let{onChange:i}=e;i?i((0,o._)((0,r._)({},t),{user_banned:!0,bans:n.concat(t.bans)})):document.location.href=(0,M.PG)(e.post,e.pub)}}))]})}let eA=(0,f.createContext)({openBanDialog:()=>void 0})},12010:function(e,t,n){n.d(t,{U:()=>r});var i=n(4006);let r=()=>(0,i.FD)("div",{className:"comment-silhouette",children:[(0,i.Y)("div",{className:"comment-silhouette-head"}),(0,i.FD)("div",{className:"comment-silhouette-content",children:[(0,i.Y)("div",{className:"comment-silhouette-meta"}),(0,i.Y)("div",{className:"comment-silhouette-body"}),(0,i.Y)("div",{className:"comment-silhouette-actions"})]})]})},7684:function(e,t,n){n.d(t,{Mr:()=>y,c4:()=>f,d3:()=>b,d4:()=>Y,eu:()=>_,yy:()=>v});var i=n(79785),r=n(17402),o=n(15734),l=n.n(o),a=n(84605),s=n(70145),c=n(68349),d=n(66729),u=n(16291),m=n(50129),h=n(18947);function p(){let e=(0,i._)(["Are you sure you want to unpin this comment?"]);return p=function(){return e},e}function g(){let e=(0,i._)(["Are you sure you want to pin this comment?"]);return g=function(){return e},e}function f(){let e=(0,r.useContext)(d.I);if(!e)throw Error("useCommentMenu must be used within a CommentMenuProvider");return e}let b=e=>{var t;let{iString:n}=(0,a.GO)(),i=null==(t=e.bans)?void 0:t.find(t=>t.publication_id===e.publication_id),r=i&&(0,u.A)(i.expiry).diff((0,u.A)(),"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 y(e){let{comment:t,onChange:n}=e,{iTemplate:i}=(0,a.GO)(),[o,s]=(0,r.useState)(!1),d=!!t.pinned_by_user_id,u=async()=>{if(!o&&window.confirm(d?i(p()):i(g()))&&!o){s(!0);try{await l().patch("/api/v1/comment/".concat(t.id,"/pin")).send({pinned:!d}),n({pinned:!d}),document.location.reload()}catch(e){alert((0,c.uX)(e)),s(!1)}}};return{pinned:d,togglingPin:o,togglePinned:u}}function Y(e){let{comment:t,onChange:n}=e,[i,o]=(0,r.useState)(!1),a=w("remove"),s=async()=>{if(!i&&a()){o(!0);try{await l().patch("/api/v1/comment/".concat(t.id,"/status")).send({status:m.nJ.moderator_removed}),n({suppressed:!0,status:m.nJ.moderator_removed,body:null})}catch(e){alert((0,c.uX)(e))}o(!1)}};return{isRemoving:i,removeComment:s}}function v(e){let{comment:t,onChange:n}=e,[i,o]=(0,r.useState)(!1),l=w("delete"),a=(0,s.jN)(),d=async()=>{if(!i&&l()){o(!0);try{await a.delete("/api/v1/comment/".concat(t.id)).send(),n({status:m.nJ.deleted,deleted:!0,user_id:null,name:null,body:null})}catch(e){alert((0,c.uX)(e))}o(!1)}};return{isDeleting:i,deleteComment:d}}function _(e){let{comment:t,post:n,pub:i}=e;return{addCommentToLinear:()=>{let e,r;window.open((e=(0,h.XB)(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)),"https://linear.app/substackinc/team/TPT/new?description=".concat(r,"&status=Triage")),"_blank")}}}function w(e){let{iString:t}=(0,a.GO)(),{isOAuthProvider:n}=(0,s.ey)();return()=>!!n||window.confirm("".concat(t("Are you sure you want to ".concat(e," this comment? This action cannot be reversed."))))}},93354:function(e,t,n){n.d(t,{t:()=>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,c;(n.children&&t.children?e(n.children,t.children):t.children)!==n.children||r.some(e=>n[e]!==t[e])||!(0,i.bN)(null!=(s=n.reactions)?s:{},null!=(c=t.reactions)?c:{})?(o.push(t),l=!0):o.push(n)}else o.push(t),l=!0}return l?o:t}});var i=n(38123);let r=["edited_at","deleted","status"]},36757:function(e,t,n){n.d(t,{f:()=>o});var i=n(69277),r=n(70408);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.split(".").map(Number))?o:[],t)}},87087:function(e,t,n){n.d(t,{DH:()=>y,EQ:()=>f,PG:()=>g,Pm:()=>Y,Wn:()=>p,cx:()=>function e(t,n){for(let[o,l]of t.entries())if(l.id===n.id)return t.with(o,n);else if(l.children){let a=e(l.children,n);if(a!==l.children)return t.with(o,(0,r._)((0,i._)({},l),{children:a}))}return t},jv:()=>h,pU:()=>function e(t,n){if(!t||!n||!n.length)return null;for(let i of n)if(i.id===t)return i;else if(i.children&&i.children.length){let n=e(t,i.children);if(n)return n}return null},pz:()=>v,yY:()=>b});var i=n(69277),r=n(70408),o=n(4006),l=n(95201),a=n.n(l),s=n(17186),c=n(39318),d=n(82776);let u="comment-collapse-state",m=function(){try{return(0,s.xm)(u,[])}catch(e){return console.error("Failed to load comment collapse state:",e),[]}}(),h=()=>{if("undefined"!=typeof window&&window.location.hash){let e=/^#comment-(\d+)/.exec(window.location.hash);if(e)return Number(e[1])}return null},p=()=>"undefined"!=typeof window&&"#input"===window.location.hash;function g(e,t,n){return(0,c.yRP)((0,c.wu9)(t,e,{comments:!(0,d.shouldUseInlineComments)(t,e)}),n)}function f(e,t,n){return(0,c.yRP)("".concat((0,c.$_T)(t),"/embed/comments/").concat(e.id),{access_token:n})}function b(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"p";return(e||"").split("\n").filter(e=>e.trim()).map(e=>(0,o.Y)(t,{children:(0,o.Y)(a(),{options:{validate:{url:e=>!!e&&!e.startsWith("/")},attributes:{rel:"nofollow ugc noopener"}},children:e})}))}let y=e=>{var t,n,i,r,o,l;return{id:e.user_id,slug:"user_slug"in e?e.user_slug:void 0,photo_url:e.photo_url,name:null!=(o=e.name)?o:null,bestseller_tier:e.user_bestseller_tier,status:e.userStatus,primary_publication:e.user_primary_publication,is_free_subscribed:["free_signup, subscribed"].includes(null!=(l=null==(t=e.metadata)?void 0:t.membership_state)?l:""),is_subscribed:(null==(n=e.metadata)?void 0:n.membership_state)==="subscribed",is_founding:null==(i=e.metadata)?void 0:i.founding,is_author:null==(r=e.metadata)?void 0:r.is_author}};function Y(e,t){let n=!1;if(t)!m.includes(e)&&(n=!0,m.push(e),m.length>250&&m.splice(0,m.length-250));else{let t=m.indexOf(e);t>=0&&(n=!0,m.splice(t,1))}if(n)try{(0,s.X3)(u,m)}catch(e){console.error("Failed to store comment collapse state:",e)}}function v(e){return m.includes(e)}},82286:function(e,t,n){n.d(t,{Xn:()=>l});var i=n(4006);n(32485),n(17402),n(84605),n(86500),n(35369),n(33727),n(97515);var r=n(76977);n(57820);var o=n(75303);function l(e){let{children:t,flex:n}=e;return(0,i.Y)(r.fI,{gap:8,alignItems:"center",flex:n,children:t})}n(63136),n(65259),(0,o.I4)({display:"flex",direction:"column",gap:16}),(0,o.I4)({display:"flex",direction:{desktop:"row",mobile:"column"},gap:12,alignItems:{desktop:"center",mobile:"stretch"},justifyContent:{desktop:"space-between",mobile:void 0}}),(0,o.I4)({display:"flex",direction:"column",minHeight:280}),(0,o.I4)({display:"flex",direction:"column",gap:32}),(0,o.I4)({display:"flex",direction:"row",gap:12,alignItems:"center",justifyContent:"space-between",wrap:"wrap"}),(0,o.I4)({display:"flex",wrap:"wrap",direction:"row",gap:12,alignItems:"center"})},3046:function(e,t,n){n.d(t,{Ac:()=>x,Nf:()=>S,T_:()=>R,XK:()=>B,Xx:()=>A,YX:()=>L,ZT:()=>D,Zh:()=>I,b5:()=>N,dU:()=>k});var i=n(69277),r=n(70408),o=n(32641),l=n(4006),a=n(32485),s=n.n(a),c=n(14792),d=n.n(c);n(83673);var u=n(82853);n(18993);var m=n(8853),h=n(38685);n(66443),n(94090);var p=n(33764);n(82936),n(84605);var g=n(46275);n(10398),n(94729),n(24078),n(15040);var f=n(17028),b=n(97515);n(45859);var y=n(22602),Y=n(45974),v=n(75303);n(92028),n(36372),n(89955),n(46647),n(87782),n(80351),n(69089),n(70486),n(42831),n(20437),n(16291),n(39318);var _=n(49807);n(82776);var w=n(69706),C=n(36083);function S(e){var t;let{user:n}=e,i=(0,g.BR)().isOnDestination;return(0,l.Y)(f.az,{paddingX:12,children:(0,l.Y)(f.EY.B4,{as:"a",color:"secondary",decoration:"hover-underline",href:(0,_.gYq)(n,{noBase:i}),target:"_blank",children:null!=(t=n.name)?t:"Substack user"})})}let k=(0,f.I4)({className:C.A.messageBubbleGroup,position:"relative",gap:2},v.VP);function A(e){let{direction:t,isLink:n,backgroundColor:i,isAuthorContributor:r}=e,o="incoming"===t&&r,a="".concat(i,"1A");return(0,l.FD)("svg",{viewBox:"0 0 16 13",className:s()(C.A.bubbs,C.A[t],n&&C.A.isLink,r&&C.A.author),style:o?{fill:a}:{},children:[(0,l.Y)("circle",{cx:"5",cy:"5",r:"5",className:C.A.bubb}),(0,l.Y)("circle",{cx:"13.5",cy:"10.5",r:"2.5",className:C.A.bubb}),o&&(0,l.FD)(l.FK,{children:[(0,l.Y)("circle",{cx:"5",cy:"5",r:"5",fill:a}),(0,l.Y)("circle",{cx:"13.5",cy:"10.5",r:"2.5",fill:a})]})]})}function I(e){var{messageDirection:t,isFirst:n=!1,isLast:a=!1,forceTheme:c,pubThemeAccentColor:u,isAuthorContributor:m,className:h}=e,p=(0,o._)(e,["messageDirection","isFirst","isLast","forceTheme","pubThemeAccentColor","isAuthorContributor","className"]);let g="incoming"===t&&m,b=g&&u;return(0,l.Y)(f.fI,(0,r._)((0,i._)({},p),{className:s()(C.A.bubble,C.A[t],n&&C.A.isFirst,a&&C.A.isLast,c&&C.A["force".concat(d()(c),"Theme")],g&&C.A.author,h),style:{"--color-chat-author-bg-overlay":b?"".concat(u,"1A"):"oklch(from var(--color-bg-accent-themed) l c h / 0.1)"}}))}function D(e){let{metadata:t,publication:n,direction:i,isFirst:r,isLast:o}=e,a=x(t.url);return a?(0,l.Y)(I,{messageDirection:i,isFirst:r,isLast:o,maxWidth:400,forceTheme:"incoming",outline:"detail",children:(0,l.Y)(E,{videoId:a})}):(0,l.Y)(I,{as:"a",href:t.url,target:"_blank",rel:"nofollow noopener ugc",messageDirection:i,isFirst:r,isLast:o,maxWidth:400,forceTheme:"incoming",outline:"detail",children:!function(e){let{metadata:t}=e;if(!t.image)return!1;let n=(0,_.d4Y)(t.image);return!!n&&(n.width<401||n.height<401)}({metadata:t})?(0,l.Y)(T,{publication:n,metadata:t}):(0,l.Y)(R,{metadata:t})})}function x(e){try{let n=new URL(e);if("youtube.com"===n.hostname||"www.youtube.com"===n.hostname){let e=n.searchParams.get("v");if("/watch"===n.pathname&&e)return e;let i=n.pathname.match(/\/(?:embed|v|shorts|live)\/([^\s\/]+)/);if(i){var t;return null!=(t=i[1])?t:null}}else if("youtu.be"===n.hostname){let e=n.pathname.slice(1);if(e)return e}}catch(e){console.error("Error parsing URL:",e)}return null}function N(e){try{var t,n;let i=new URL(e);if(i.pathname.startsWith("/player/v1/"))return null!=(t=i.pathname.split("/").pop())?t:null;if(i.pathname.includes("/video/")){let e=i.pathname.split("/"),t=e.indexOf("video")+1;if(ti});function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise(t=>{setTimeout(t,e)})}},54542:function(e,t,n){n.d(t,{y1:()=>i});function*i(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;for(let i=e;i