!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@9a5020d"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ae14bc37-a51e-4bc5-bc9c-0a6c6865a9f2",e._sentryDebugIdIdentifier="sentry-dbid-ae14bc37-a51e-4bc5-bc9c-0a6c6865a9f2")}catch(e){}}();"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["8478"],{49639:function(e,t,n){n.d(t,{y$:()=>M});var r=n(69277),i=n(70408),a=n(79785),l=n(4006),o=n(17402),s=n(47963),c=n(85048),d=n(58050),u=n(84605),p=n(46271),m=n(86500),h=n(94729),f=n(17186),g=n(68349),b=n(24078),Y=n(35369),y=n(76977),v=n(16993),w=n(63136),_=n(65842),E=n(36372),I=n(11510),A=n(16291),L=n(39318),F=n(41086),S=n(50963),k=n(57324),N=n(24258),C=n(60710);function x(){let e=(0,a._)(["Already following ",""]);return x=function(){return e},e}function O(){let e=(0,a._)(["",", a paid subscriber of ",", shared this with you."]);return O=function(){return e},e}function D(){let e=(0,a._)(["",", a subscriber of ",", shared this with you."]);return D=function(){return e},e}function R(){let e=(0,a._)([""," shared this with you."]);return R=function(){return e},e}function T(){let e=(0,a._)(["Follow "," and continue reading"]);return T=function(){return e},e}function P(){let e=(0,a._)(["Sign up and follow ",""]);return P=function(){return e},e}let M=e=>{let{pub:t,post:n,referringUser:a,freeSignupEmail:s,forceFollowPrompt:c,surface:b}=e,[Y,w]=(0,o.useState)(!1),[_,I]=(0,o.useState)(!1),[k,N]=(0,o.useState)(0),[C,O]=(0,o.useState)(s),[D,R]=(0,o.useState)(!1),{iString:T,iTemplate:P}=(0,u.GO)(),M=(0,E.d)(),$=(0,p.Jd)(),q=!!$||!!s,U=(0,d.cC)(a,null!=b?b:"follow-referrer-prompt",void 0,{auto:q}),W=(0,o.useMemo)(()=>({free_signup_email:s,post_id:null==n?void 0:n.id,referring_user_id:a.id}),[s,null==n?void 0:n.id,a.id]);(0,o.useEffect)(()=>{if(q&&!U.isLoaded||U.isFollowing){c&&U.isFollowing&&M.popToast(()=>(0,l.Y)(E.y,{text:P(x(),(0,S.$k)(a.name))}));return}try{let e=new URL(document.referrer);if(/(\b|\.)google\./.test(e.hostname)||["news.ycombinator.com","hckrnews.com"].includes(e.hostname))return}catch(e){}if($&&(0,F.y)("follow-referrer-on-load")){(0,g.qm)("follow-referrer-on-load"),(0,m.u4)(m.qY.FOLLOW_REFERRER_PROMPT_REDIRECTED,W),V({fromRedirect:!0}).then(()=>w(!0));return}let e="follow-prompt-for-post-".concat(null==n?void 0:n.id,"-and-referrer-").concat(a.id,"-shown-at"),t=(0,f.xm)(e);!c&&t&&(0,A.A)().subtract(7,"days").isBefore(t)||((0,f.X3)(e,Date.now()),w(!0),(0,m.u4)(m.qY.FOLLOW_REFERRER_PROMPT_SHOWN,W))},[$,U.isLoaded]);let j=(0,o.useCallback)(()=>{(0,m.u4)(m.qY.FOLLOW_REFERRER_PROMPT_DISMISSED,(0,i._)((0,r._)({},W),{step:k})),w(!1)},[W,w,k]),K=(0,o.useCallback)(function(){let{email:e,reason:n="sign-in-click"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,m.u4)(m.qY.FOLLOW_REFERRER_PROMPT_SIGN_IN_INITIATED,(0,i._)((0,r._)({},W),{reason:n}));let l=(0,L.oRR)({"follow-referrer-on-load":a.id});(0,g.V2)((0,L.a7q)({email:e,for_pub:null==t?void 0:t.subdomain,redirect:l}))},[W,null==t?void 0:t.subdomain,a.id]),G=(0,o.useCallback)(async function(){let e,t,n,{email:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{({user:e,userExists:t}=await (0,h.x6)("/api/v1/reader/signup/just_email",{method:"POST",json:{email:a}}))}catch(e){e instanceof h.fk&&(n=e.getMessage())}return e?(O(a),0):t?((0,m.u4)(m.qY.FOLLOW_REFERRER_PROMPT_EXISTING_EMAIL_ENTERED,(0,i._)((0,r._)({},W),{email:a})),O(a),2):((0,m.u4)(m.qY.FOLLOW_REFERRER_PROMPT_SIGNUP_FAILED,(0,i._)((0,r._)({},W),{email:a,error:n})),M.popToast(()=>(0,l.Y)(E.y,{text:n||T("Something went wrong. Please try again later.")})),1)},[W,M,T]),V=(0,o.useCallback)(async function(){let e,{email:t,fromRedirect:n=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!_){if(I(!0),n||(0,m.u4)(m.qY.FOLLOW_REFERRER_PROMPT_CTA_CLICKED,(0,i._)((0,r._)({},W),{email:t})),!q){if(!t){N(1),I(!1);return}if(1===(e=await G({email:t})))return void I(!1)}U.isFollowing||void 0!==e&&0!==e||(await U.toggle(),R(!0)),!$||n?N(2):w(!1),I(!1)}},[$,q,U,W,_,I,N,G]);return(0,l.Y)(v.aF,{fullscreenMobile:0!==k,isOpen:Y,onClose:j,children:(0,l.FD)(y.I1,{style:{height:"100%"},children:[(0,l.Y)(v.rQ,{onClose:j}),(0,l.FD)(y.I1,{flex:"grow",gap:48,paddingX:32,paddingBottom:32,paddingTop:12,children:[0===k&&(0,l.Y)(B,{pub:t,referringUser:a,loading:_,onFollowClick:V,onDismiss:j}),1===k&&(0,l.Y)(J,{referringUser:a,loading:_,onFollowWithEmail:V,onSignInClick:K}),2===k&&(0,l.Y)(H,{email:C,referringUser:a,followed:D,onDismiss:j})]})]})})},B=e=>{var t,n,r,i,a;let o,{pub:s,referringUser:c,loading:d,onFollowClick:p,onDismiss:m}=e,{iTemplate:h,iString:f}=(0,u.GO)(),g=null!=(a=null!=(i=null!=(r=c.photo_url)?r:null==s?void 0:s.logo_url)?i:null==s?void 0:s.author_photo_url)?a:(0,L.Ji1)(c.id),v=(0,S.$k)(c.name),_=null==(n=c.subscriptions)||null==(t=n.find(e=>e.publication_id==(null==s?void 0:s.id)))?void 0:t.membership_state;return o=s&&"subscribed"===_?h(O(),c.name,s.name):s&&"free_signup"===_?h(D(),c.name,s.name):h(R(),c.name),(0,l.FD)(y.I1,{alignItems:"center",gap:8,children:[(0,l.FD)(y.I1,{alignItems:"center",gap:16,paddingBottom:16,children:[(0,l.Y)("div",{className:C.A.avatarContainer,children:(0,l.Y)(b.eu,{className:C.A.avatar,user:{photo_url:g},size:64})}),(0,l.Y)(w.EY.H3,{align:"center",weight:"heavy",children:o})]}),(0,l.Y)(Y.$n,{priority:"primary",disabled:d,onClick:p,children:h(T(),v)}),(0,l.Y)(Y.$n,{priority:"secondary",onClick:m,children:f("Skip")})]})},J=e=>{let{referringUser:t,loading:n,onFollowWithEmail:r,onSignInClick:i}=e,[a,s]=(0,o.useState)(""),{iTemplate:d}=(0,u.GO)(),p=(0,o.useRef)(null);(0,o.useEffect)(()=>{var e;null==(e=p.current)||e.focus()},[]);let m=(0,o.useCallback)(e=>{e.preventDefault(),""!==a&&r({email:a})},[r,a]),h=(0,S.$k)(t.name);return(0,l.FD)(l.FK,{children:[(0,l.FD)(y.I1,{alignItems:"center",gap:8,children:[(0,l.FD)(w.EY.H3,{translated:!0,align:"center",weight:"heavy",children:["Sign up to follow ",I18N.p(h)]}),(0,l.Y)(w.EY.B4,{translated:!0,align:"center",color:"secondary",children:"Discover great writing and follow your friends on Substack"})]}),(0,l.FD)(y.I1,{gap:12,children:[(0,l.Y)(w.EY.B4,{translated:!0,weight:"semibold",children:"Your email address"}),(0,l.Y)("form",{onSubmit:m,children:(0,l.Y)(_.ks,{ref:p,placeholder:"bob@gmail.com",value:a,onChange:e=>s(e.currentTarget.value)})})]}),(0,l.FD)(y.I1,{alignItems:"center",gap:16,justifyContent:"center",children:[(0,l.Y)(Y.$n,{disabled:n||""===a,onClick:m,children:d(P(),h)}),(0,l.FD)(w.EY.B4,{translated:!0,align:"center",color:"secondary",children:["Already have a Substack account?"," ",(0,l.Y)(w.EY.B4,{translated:!0,color:"secondary",decoration:"underline",as:"a",href:"#",onClick:i,children:"Sign in"})]})]}),(0,l.Y)(y.I1,{flex:"grow",justifyContent:"end",children:(0,l.Y)(w.EY.B4,{align:"center",children:(0,l.Y)(c.qd,{className:C.A.termsFooter,publication:N.A})})})]})},H=e=>{let{onDismiss:t,email:n,referringUser:a,followed:o}=e,{iString:c}=(0,u.GO)(),d=(0,I.Iu)(),p={utm_medium:k.Jn.web,utm_campaign:k._9.postFollowReferrerPrompt,utm_source:k.VU.post};return(0,l.FD)(l.FK,{children:[o?(0,l.FD)(y.I1,{alignItems:"center",gap:4,children:[(0,l.Y)(w.EY.H3,{translated:!0,align:"center",weight:"heavy",children:"Read and follow in the app"}),(0,l.FD)(w.EY.B4,{translated:!0,align:"center",color:"secondary",children:["See who else ",I18N.p((0,S.$k)(a.name))," reads in the Substack app"]})]}):(0,l.FD)(y.I1,{alignItems:"center",gap:4,children:[(0,l.FD)(w.EY.H3,{translated:!0,align:"center",weight:"heavy",children:["Finish following ",I18N.p((0,S.$k)(a.name))," in the app"]}),(0,l.FD)(w.EY.B4,{translated:!0,align:"center",color:"secondary",children:["See who else ",I18N.p((0,S.$k)(a.name))," reads on Substack"]})]}),d?(0,l.FD)(l.FK,{children:[(0,l.Y)(y.Ye,{alignSelf:"center",children:(0,l.Y)("img",{src:(0,L.dJ9)("/img/app-preview-card.png"),height:265})}),(0,l.Y)(y.Ye,{flex:"grow",children:(0,l.FD)(y.I1,{alignItems:"center",flex:"grow",gap:8,children:[(0,l.Y)(Y.$n,{href:(0,L.wHz)(p),children:c("Get the Substack app")}),(0,l.Y)(Y.$n,{priority:"tertiary",onClick:t,children:c("Skip")})]})})]}):(0,l.FD)(y.I1,{alignItems:"center",gap:24,children:[(0,l.Y)("div",{style:{minHeight:231},children:(0,l.Y)(s.gF,(0,i._)((0,r._)({},p),{suggestedEmail:n,size:180,padding:0}))}),(0,l.Y)(Y.$n,{priority:"secondary",onClick:t,children:c("Continue reading")})]})]})}},49897:function(e,t,n){n.d(t,{M:()=>y});var r=n(4006),i=n(32485),a=n.n(i),l=n(17402),o=n(84605),s=n(35369),c=n(76977),d=n(37598),u=n(75303),p=n(63136),m=n(58278),h=n(98949),f=n(15974);let g=e=>e?/^H[1-5]$/i.test(e.tagName)?e:g(e.parentElement):null,b=e=>{let{toc:t,minLevel:n,activeItem:i}=e;return(0,r.Y)(c.I1,{gap:12,paddingY:12,paddingX:8,alignItems:"end",children:t.map((e,t)=>{let l=e.level-n,o="indent-".concat(Math.min(l,3)),s=(0,m.uB)(e.text.toLowerCase(),!0);return(0,r.Y)("div",{className:a()(f.A.line,f.A[o],i===s&&f.A.active)},t)})})},Y=e=>{let{toc:t,minLevel:n,activeItem:i,onItemClick:l}=e,{iString:s}=(0,o.GO)();return(0,r.FD)(c.I1,{gap:4,padding:8,className:f.A.menu,children:[(0,r.Y)(p.EY.Meta,{padding:4,color:"primary",children:s("Contents")}),t.map((e,t)=>{let o=(0,m.uB)(e.text.toLowerCase(),!0),s=e.level-n,d="indent-".concat(Math.min(s,3));return(0,r.Y)(u.AE,{href:"#\xa7".concat(o),onClick:e=>{e.preventDefault(),l(o)},children:(0,r.Y)(c.Ye,{padding:4,className:a()(f.A.row),children:(0,r.Y)(p.EY.B3,{className:a()(f.A.label,f.A[d],i===o&&f.A.active),ellipsis:!0,children:e.text})})},t)})]})},y=e=>{let{toc:t,position:n="fixed"}=e,{iString:i}=(0,o.GO)(),c=Math.min(...t.map(e=>e.level)),[u,p]=(0,l.useState)(null),y=(e=>{let[t,n]=(0,l.useState)(null);return(0,l.useEffect)(()=>{let t=[];return e.forEach(e=>{let r=(0,m.uB)(e.text.toLowerCase(),!0),i=document.getElementById("\xa7".concat(r));if(i){let e=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&e.intersectionRatio>=.8&&n(r)})},{threshold:.5,rootMargin:"0px 0px -90% 0px"});e.observe(i),t.push(e)}}),()=>t.forEach(e=>e.disconnect())},[e]),t})(t);return t.length<2||(0,h.Fr)()?null:(0,r.Y)(d.A,{trigger:(0,r.Y)(s.Nm,{className:a()(f.A.trigger,f.A[n]),"aria-label":i("Table of Contents"),position:n,showFocus:!0,children:(0,r.Y)(b,{toc:t,minLevel:c,activeItem:y})}),side:"right",children:(0,r.Y)(Y,{toc:t,minLevel:c,activeItem:y,onItemClick:e=>{let t=document.getElementById("\xa7".concat(e));if(t){let n=g(t);if(n){if(u){let e=document.getElementById("\xa7".concat(u)),t=e?g(e):null;null==t||t.classList.remove("highlight")}n.classList.add("highlight"),p(e),t.scrollIntoView({behavior:"smooth",block:"start"})}}}})})}},80707:function(e,t,n){n.d(t,{Rv:()=>q,bs:()=>$});var r=n(69277),i=n(70408),a=n(4006),l=n(31386),o=n(32485),s=n.n(o),c=n(58156),d=n.n(c),u=n(17402),p=n(9751),m=n(58600),h=n(38893),f=n(48246),g=n(98107),b=n(12153),Y=n(64998),y=n(64099),v=n(56455),w=n(93038),_=n(81209),E=n(84605),I=n(96156),A=n(79313),L=n(51131),F=n(89490),S=n(76977),k=n(30192),N=n(90292),C=n(65942),x=n(98111),O=n(39318),D=n(41086),R=n(98949),T=n(5035),P=n(8283);let M=(e,t)=>(0,a.Y)(E.Pz,{language:t,children:e}),B=function(e,t){var n,o,c,E,B,J,$,q,U;let{recursive:W}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(e instanceof Element)||1!==e.nodeType)return 3===e.nodeType?(0,u.createElement)("span",{},e.textContent):8===e.nodeType?(0,u.createElement)("x_preact_compatible_html_comment_x",{},e.textContent):(0,u.createElement)("span",{},"");let j=e.tagName.toLowerCase(),K=(e=>{let t={};for(let{name:n,value:r}of Array.from(e))t[n]=r;return t})(e.attributes);"A"!==e.nodeName||e.getAttribute("rel")||e.setAttribute("rel","pub"in t&&(null==(c=t.pub)?void 0:c.no_follow)?"nofollow ugc noopener":""),e.classList.contains("image2")&&e.classList.add("can-restack"),"undefined"!=typeof window&&e.classList.contains("file-embed-button")&&"href"in e&&e.href&&!(0,D.y)(e.href,"token")&&(e.href=(0,O.yRP)(e.href,{token:(0,D.y)(window._preloads.original_url,"token")}));let G=d()(t,"props.post.id");if(G&&e.classList.contains("footnote")&&(e.id&&(e.id+="-".concat(G)),"href"in e&&e.href&&(e.href+="-".concat(G))),!W||"script"===j&&e.innerHTML===P.I)return(0,u.createElement)(j,(0,i._)((0,r._)({},K),{dangerouslySetInnerHTML:{__html:e.innerHTML}}));if("pub"in t&&t.pub&&"P"===e.nodeName&&e.classList.contains("button-wrapper")){let n=((e,t)=>{try{let n=JSON.parse((0,C.A)(e.getAttribute("data-attrs")));if(["".concat(t.pub.base_url,"/subscribe?"),"".concat(t.pub.base_url,"/subscribe?plan=founding"),x.T.CHECKOUT_URL,x.T.FOUNDING_CHECKOUT_URL].includes(n.url)){let n=JSON.parse((0,C.A)(e.getAttribute("data-attrs")));return(0,a.Y)(_.A,(0,r._)({pub:t.pub,subscribeButtonAttrs:n},t.props))}}catch(e){console.error("Failed to parse button:",e)}return null})(e,t);if(n)return n}let V="pub"in t&&(null==(n=t.pub)?void 0:n.language)||"en";if(e.classList.contains("subscription-widget-wrap-editor")||e.classList.contains("subscription-widget-wrap"))return M((0,a.Y)("div",{className:"subscription-widget-wrap",children:(0,a.FD)("div",{className:"subscription-widget show-subscribe",children:[(0,a.Y)("div",{className:"preamble",children:(0,a.Y)("p",{dangerouslySetInnerHTML:{__html:null!=($=null==(J=e.children[0])||null==(B=J.children[0])||null==(E=B.children[0])?void 0:E.innerHTML)?$:""}})}),(0,a.Y)(_.A,(0,r._)({pub:t.pub,subscribeButtonAttrs:null,source:"subscribe-widget-preamble"},t.props))]})}),V);if(e.classList.contains("cashtag-wrap"))return M((e=>{try{let t=JSON.parse(e.dataset.attrs).symbol;if(t)return(0,a.Y)(g.A,{symbol:t,prependSymbol:JSON.parse(e.dataset.attrs).prependSymbol,isStatic:JSON.parse(e.dataset.attrs).isStatic});return(0,a.Y)(a.FK,{})}catch(e){return console.error("failed to parse cashtag"),(0,a.Y)(a.FK,{})}})(e),V);if(e.classList.contains("mention-wrap"))return M((e=>{try{let{name:t,id:n,type:r,url:i,photo_url:l,uuid:o,isStatic:s}=JSON.parse(e.dataset.attrs);if(t)return(0,a.Y)(w.Ay,{name:t,id:n,type:r,url:i,photo_url:l,uuid:o,isStatic:s});return(0,a.Y)(a.FK,{})}catch(e){return(0,a.Y)(a.FK,{})}})(e),V);if("pub"in t&&t.pub&&e.classList.contains("native-audio-url-embed"))return M(((e,t)=>{let{pub:n,props:{isStatic:r,post:i}}=t;try{let t=e.getAttribute("data-attrs");if(t){let e=JSON.parse((0,C.A)(t));return r?(0,a.Y)(f.x,{label:e.label,pub:n,post:i,duration:e.duration}):(0,a.Y)(h.$g,{label:e.label,pub:n,post:i,src:e.url,duration:e.duration,downloadable:e.downloadable,autoPlay:!1})}}catch(e){console.error("Failed to parse audio:",e)}return null})(e,t),V);if("pub"in t&&t.pub&&e.classList.contains("native-audio-embed"))return M(((e,t)=>{let{pub:n,props:{isStatic:r,post:i}}=t;try{let t=e.getAttribute("data-attrs");if(t){let e=JSON.parse((0,C.A)(t));return r?(0,a.Y)(f.x,{label:e.label,pub:n,post:i,duration:e.duration}):(0,a.Y)(h.$g,{label:e.label,pub:n,post:i,src:"/api/v1/audio/upload/".concat(e.mediaUploadId,"/src"),duration:e.duration,downloadable:e.downloadable,autoPlay:!1,mediaUpload:{id:e.mediaUploadId}})}}catch(e){console.error("Failed to parse audio:",e)}return null})(e,t),V);if("pub"in t&&t.pub&&e.classList.contains("native-video-embed"))return M((0,b.nu)(e,t),V);if("pub"in t&&t.pub&&e.classList.contains("meeting-embed"))return M(((e,t)=>{let{props:{isStatic:n}}=t;try{let t=e.getAttribute("data-attrs");if(t){let{name:e,avatarUrl:r,url:i}=JSON.parse((0,C.A)(t));return n?(0,a.Y)(L.D,{name:e,avatarUrl:r,url:i}):(0,a.Y)(L.l,{name:e,avatarUrl:r,url:i})}}catch(e){console.error("Failed to parse audio:",e)}return null})(e,t),V);if(e.classList.contains("poll-embed"))return M(((e,t)=>{try{let i=JSON.parse((0,C.A)(e.getAttribute("data-attrs")));if(null==i?void 0:i.isEmail){var n,r;return(0,a.Y)("table",{className:"poll-embed poll-email",cellSpacing:"16px",width:"100%",children:(0,a.Y)("tbody",{children:(0,a.Y)("tr",{children:(0,a.Y)("td",{align:"center",children:(0,a.Y)(Y.a1,{id:i.id,embeddedPolls:null!=(r=null==(n=t.props.dataForEmailRender)?void 0:n.embeddedPolls)?r:[],pub:t.pub})})})})})}return(0,a.Y)("div",{className:"poll-embed",dataAttrs:e.getAttribute("data-attrs"),children:(0,a.Y)(Y.sP,{id:i.id,isEditor:!1,post:t.props.post,isVersionView:!!t.props.isVersionView})})}catch(e){return console.error("Failed to parse poll:",e),(0,a.Y)(a.FK,{})}})(e,t),V);if(e.classList.contains("recipe-embed"))return M((0,b.hA)(e,t),V);if(e.classList.contains("instagram-embed-wrap"))return M((e=>{try{let t=e.getAttribute("data-attrs");if(!t)return null;let n=JSON.parse((0,C.A)(t));return(0,a.Y)(v.w,{attrs:n})}catch(e){return null}})(e),V);if(e.classList.contains("twitter-embed"))return M((0,b.Ev)(e),V);if(e.classList.contains(T._1))return M((0,b.Im)(e,t),V);if(e.classList.contains("pinterest-embed"))return M((0,b.H0)(e),V);if(e.classList.contains("polymarket-embed"))return M((0,b.Ri)(e,t),V);if(e.classList.contains("sponsorship-campaign-embed"))return M((0,b.tT)(e,t),V);if(e.classList.contains("fp-recirc-block"))return M((0,b.E9)(e,t),V);if(e.classList.contains("image-gallery-embed"))return M((0,b.mN)(e,t),V);if(e.classList.contains("image3"))return M((0,b.Nq)(e,t),V);if(e.classList.contains("directMessage"))return M((0,b.Jo)(e,t),V);if(e.classList.contains("latex-rendered"))return M(((e,t)=>{let{pub:n,props:{isStatic:r}}=t,{iString:i}=I18N.i({pub:n});try{if(r){let t=e.getAttribute("data-attrs");if(t){let e=JSON.parse((0,C.A)(t)),n=null==e?void 0:e.persistentExpression;return n?(0,a.Y)("img",{src:(0,O.Ojn)(n),style:{transform:"scale(0.5)"},"data-component-name":"LatexImg"}):(0,a.Y)("p",{children:i("Failed to render LaTeX expression — no expression found in email")})}return(0,a.Y)("p",{children:i("Failed to render LaTeX expression — data attributes not found")})}let t=e.getAttribute("data-attrs"),n=JSON.parse((0,C.A)(t)),o=null==n?void 0:n.persistentExpression;return o?(0,a.Y)(S.Ye,{className:"latex-rendered",justifyContent:"center",flex:"grow",paddingBottom:"4px",paddingTop:"4px","data-component-name":"Latex",children:(0,a.Y)(S.I1,{justifyContent:"center",children:(0,a.Y)(l.A,{inline:!1,children:"\\(".concat(o,"\\)")})})}):(0,a.Y)("p",{children:i("Failed to render LaTeX expression — no expression found")})}catch(e){return console.error("failed to render mathjax",e),(0,a.Y)("p",{children:i("Failed to render LaTeX expression — error")})}})(e,t),V);if(e.classList.contains("latex-inline"))return M(((e,t)=>{let{props:{isStatic:n}}=t;try{let t=e.getAttribute("data-attrs");if(!t)return null;let r=JSON.parse((0,C.A)(t)),i=null==r?void 0:r.persistentExpression;if(!i)return null;if(n)return(0,a.Y)("img",{src:(0,O.Ojn)(i),alt:"LaTeX: ".concat(i),style:{height:"1.2em",verticalAlign:"middle",display:"inline"},"data-component-name":"InlineLatexImg"});return(0,a.Y)(N.q,{children:(0,a.Y)("span",{className:"latex-inline","data-component-name":"InlineLatex",children:(0,a.Y)(l.A,{inline:!0,children:"\\(".concat(i,"\\)")})})})}catch(e){return console.error("failed to render inline mathjax",e),null}})(e,t),V);if(e.classList.contains("community-chat"))return M(function(e,t){let{props:{isStatic:n}}=t;try{let t=e.getAttribute("data-attrs"),i=JSON.parse((0,C.A)(t));if(!i.pub||!i.subdomain)return console.error("could not deepPrepare communityChat, subdomain or pub missing from node"),(0,a.Y)(u.Fragment,{});return(0,a.Y)("div",{className:"community-chat",dataAttrs:t,children:n?(0,a.Y)(p.$,(0,r._)({},i)):(0,a.Y)(p.b,{pub:i.pub,subdomain:i.subdomain})})}catch(e){return console.error("Failed to parse chat embed:",e),(0,a.Y)(u.Fragment,{})}}(e,t),V);if(e.classList.contains("community-post"))return M(function(e,t){let{props:{isStatic:n,is_freemail:i}}=t;try{let t=e.getAttribute("data-attrs"),l=JSON.parse((0,C.A)(t));return n?(0,a.Y)(m.T,(0,r._)({is_freemail:i},l)):(0,a.Y)(m.B,(0,r._)({},l))}catch(e){return console.error("Failed to parse chat post embed:",e),(0,a.Y)(u.Fragment,{})}}(e,t),V);if(e.classList.contains("digest-post-embed"))return M((0,b.mt)(e,t),V);if(e.classList.contains("comment"))return M(function(e,t){let{props:{isStatic:n}}=t;try{let t=e.getAttribute("data-attrs"),i=JSON.parse((0,C.A)(t));return n?(0,a.Y)(A.pK,(0,r._)({},i)):(0,a.Y)(I.H,(0,r._)({},i))}catch(e){return console.error("Failed to parse chat post embed:",e),(0,a.Y)(u.Fragment,{})}}(e,t),V);if(e.classList.contains("referrals-tier-card"))return M((0,b.h)(e,t),V);if(e.classList.contains("footnote-anchor"))return M(((e,t,n,i)=>{var l;let o=(0,u.createElement)(e,(0,r._)({},t,(0,R.Fr)()?{href:"#_"}:{}),n.textContent),[s,,c]=n.id.split("-"),d=null==(l=i.wrapper.querySelector("#".concat(s,"-").concat(c)))?void 0:l.nextElementSibling;return d?(0,a.Y)(k.j,{trigger:o,children:(0,a.Y)(F.az,{padding:12,maxWidth:360,sizing:"border-box",className:"markup typography footnote-hovercard",children:H(d,i,{recursive:!1})})}):o})(j,K,e,t),V);let X=e.children&&e.children.length>0?Array.from(e.childNodes).map(e=>H(e,t,{recursive:!0})):[e.textContent],z=!!(null==(o=e.parentElement)?void 0:o.getAttribute("data-prose-mirror-wrapper"));return t&&"pub"in t&&t.pub&&z&&["h1","h2","h3","h4"].includes(j)&&!e.className?(q=t.pub,(0,u.createElement)(j,(0,i._)((0,r._)({},K),{className:s()("header-anchor-post",K.className)}),...X,(0,a.Y)(y.A,{text:null!=(U=e.textContent)?U:"",pub:q,post:"props"in t&&t.props&&"post"in t.props&&t.props.post?t.props.post:void 0,offsetTop:!0,isAboutPage:"props"in t&&!!t.props&&"isAboutPage"in t.props&&!!t.props.isAboutPage}))):(0,u.createElement)(j,K,...X)},J=0,H=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=++J>2500;try{return i&&console.error("Too many post nodes to recurse",{postId:d()(t,"props.post.id"),depth:J}),B(e,t,(0,r._)({},n,i?{recursive:!1}:{}))}finally{J--}};function $(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=document.createElement("div");return r.setAttribute("data-prose-mirror-wrapper","1"),r.innerHTML=e,Array.from(r.childNodes).map(e=>H(e,{wrapper:r,pub:t,props:n},{recursive:!0}))}function q(e,t){if("undefined"==typeof window)return[];let n=document.createElement("div");n.innerHTML=e;let r=[];for(let e of n.querySelectorAll(null!=t?t:"h1, h2, h3, h4")){var i,a;let t=e.tagName[1],n=t?parseInt(t):NaN;r.push({level:null!=n?n:0,text:null!=(i=e.textContent)?i:"",id:null!=(a=e.id)?a:""})}return r}},73484:function(e,t,n){n.d(t,{gJ:()=>a}),n(4006),n(32485);var r=n(17402);n(89490),n(10996),n(36372),n(50587);let i=(0,r.createContext)({initialTab:"settings",isDrawerOpen:()=>!1,openDrawerId:null,setInitialTab:()=>void 0,setIsDrawerOpen:()=>void 0,setPreventChange:()=>void 0});function a(){return(0,r.useContext)(i)}},42509:function(e,t,n){n.d(t,{i:()=>f});var r=n(4006),i=n(32485),a=n.n(i),l=n(82853),o=n(78649),s=n(33764),c=n(64632),d=n(76977),u=n(63136),p=n(11510),m=n(69706),h=n(44307);function f(e){let{image:t,title:n,description:i,url:f,host:g,readOnly:b,isExplicit:Y,onClick:y}=e,v=(0,p.Iu)(),{isHidden:w,onShow:_}=(0,c.k_)(!!Y);return(0,r.Y)(o.Q,{children:(0,r.FD)(d.pT,{"data-testid":"feed-attachment-link",className:a()(h.A.postAttachment,b&&h.A.readOnly),position:"relative",bg:"primary",radius:"md",minWidth:0,padding:12,gap:12,alignItems:"center",onClick:y,as:b?"div":"a",href:b?void 0:f,rel:"nofollow noopener ugc",target:"_blank",pressable:"lg",draggable:!1,showFocus:!0,children:[(0,r.FD)(d.I1,{gap:2,flex:"grow",minWidth:0,children:[g&&(0,r.Y)(u.EY.B4,{as:"p",color:"secondary",clamp:v?1:2,children:g}),(0,r.Y)(u.EY.B3,{clamp:v?1:2,color:"primary",weight:"medium",children:n}),i&&(0,r.Y)(u.EY.B4,{as:"p",color:"secondary",clamp:v?1:2,children:i})]}),t?(0,r.Y)(s.o,{className:a()(h.A.linkImage),src:null!=t?t:"",useRetinaSizing:!0,imageIsFixedWidth:!0,maxWidth:64,imageProps:{smartCrop:!0,aspect:m.Zi}}):(0,r.Y)(d.pT,{width:64,height:64,bg:"secondary",radius:"md",alignItems:"center",justifyContent:"center",children:(0,r.Y)(l.A,{stroke:"var(--color-fg-secondary)"})}),w&&(0,r.Y)(c.Np,{onShow:_})]})})}},58418:function(e,t,n){n.d(t,{A:()=>s});var r=n(17402),i=n(86500),a=n(17186),l=n(16291);let o=()=>{};function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,[s,d]=(0,r.useState)(!!e&&c(e,t,l));return((0,r.useEffect)(()=>{e&&d(c(e,t,l));let n=()=>{d(!0)};if(e){document.addEventListener("dismiss: ".concat(e),n,!1);let t=(0,a.xm)("".concat(e,"-seen-count"))||0;(!l||t{document.removeEventListener("dismiss: ".concat(e),n)}},[e]),e)?[s,()=>{n(),(0,i.u4)(i.qY.DASHBOARD_ACTION_BOX_DISMISSED,{key:e});let t=new Date;(0,a.X3)(e,t.toString()),d(!0);let r=new Event("dismiss: ".concat(e));document.dispatchEvent(r)}]:[!0,o]}function c(e,t,n){let r="undefined"==typeof window?new Date().toString():(0,a.xm)(e),i="undefined"==typeof window?0:(0,a.xm)("".concat(e,"-seen-count")),o=r||n&&i>=n;return o&&t?(0,l.A)(r).add(t,"second").isAfterNow():!!(r||o)}},66238:function(e,t,n){n.d(t,{C:()=>a});var r=n(9740),i=n(82776);function a(e,t){var n,a,o,s;let c,d,u=null==(n=e.name)?void 0:n.trim(),p=u;(0,i.endsWithPunctuation)(u)&&(p='"'.concat(u,'"'));let m=(0,r.MV)(e.contributors);return(e.invite_only?(c=null,d=null):(c=(null==(o=e.rankingDetailFreeIncluded)?void 0:o.toLowerCase().includes("subscribers"))?e.rankingDetailFreeIncluded.toLowerCase():null,d=e.rankingDetailFreeIncluded||e.rankingDetail),"profile"===e.homepage_type&&e.author_name)?l({name:e.author_name,bio:e.author_bio,primaryDescriptionOverride:t,readerCount:c,rankingDetail:d}):(0,r.w4)(null!=(s=null!=t?t:null==(a=e.hero_text)?void 0:a.trim())?s:"",m,c,p,d)}let l=e=>{let{name:t,bio:n,primaryDescriptionOverride:i,readerCount:a,rankingDetail:l}=e,o="";if(i||n){var s;o="".concat((0,r.pH)(null!=(s=null!=i?i:n)?s:"")," ")}return o+(a?"Click to read ".concat(t,", a Substack with ").concat(a,"."):l?"Click to read ".concat(t," on Substack. ").concat(l,"."):"Click to read ".concat(t," on Substack."))}},52585:function(e,t,n){n.d(t,{h:()=>m});var r=n(4006),i=n(35426),a=n(38390),l=n(23623),o=n(90460),s=n(8012),c=n(85205),d=n(35843),u=n(80988),p=n(45346);function m(e){let{isOpen:t,onClose:n=()=>void 0,children:m}=e;return(0,o.h)(t),(0,r.Y)(a.bL,{open:t,onOpenChange:e=>{e||n()},children:(0,r.Y)(a.ZL,{forceMount:!0,children:(0,r.Y)(i.e.Root,{show:t,children:(0,r.FD)(u.k,{children:[(0,r.Y)(p.B,{children:(0,r.Y)(s.p,{onClose:n})}),(0,r.Y)(l.a,{children:(0,r.Y)(d.O,{children:(0,r.Y)(c.D,{children:m})})})]})})})})}},17762:function(e,t,n){n.d(t,{u:()=>b});var r=n(4006),i=n(17402),a=n(58398),l=n(46271),o=n(83441),s=n(68923),c=n(52347),d=n(99978),u=n(98722),p=n(40306),m=n(13064),h=n(49807),f=n(82776),g=n(57324);function b(e){let{isLoading:t=!1,publication:n,post:b,onLike:Y}=e,y=(0,l.Jd)(),[v,w]=(0,i.useState)(!1),{isLiked:_,likeCount:E,handleLike:I}=(0,u.V)(b,Y),{handleRestack:A,postWithRestackState:L}=(0,p.T)(b);if(t)return(0,r.Y)(m.M,{});if(!n||!b)return null;let F=!y||!n.community_enabled,S=(0,f.showCommentsOnPost)({publication:n,post:b}),k="profile"===n.homepage_type?(0,h.q$n)(n,b):(0,h.wu9)(n,b,{comments:!0,urlParams:{utm_source:g.VU.substack,utm_medium:g.Jn.web,utm_campaign:g._9.postViewer}});return(0,r.FD)(r.FK,{children:[(0,r.Y)(s.c,{onClick:I,count:E,active:_,disabled:F,priority:"primary"}),(0,r.Y)(o.k,{href:k,count:b.comment_count,newTab:"profile"!==n.homepage_type,disabled:F||!S,priority:"primary"}),(0,r.Y)(c.H,{pub:n,post:L,priority:"primary",onRestack:A}),(0,r.Y)(d.w,{priority:"primary",onClick:()=>{w(!0)}}),(0,r.Y)(a.Z,{isOpen:v,onClose:()=>w(!1),medium:"post viewer",utm_campaign:"post-expanded-share",user:y,post:b,pub:n})]})}},7963:function(e,t,n){n.d(t,{t:()=>l});var r=n(4006),i=n(76977),a=n(6606);function l(e){let{children:t}=e;return(0,r.Y)(i.fI,{justifyContent:"space-between",alignItems:"center",sizing:"border-box",gap:32,className:a.A.layout,children:t})}},51683:function(e,t,n){n.d(t,{lp:()=>a}),n(4006),n(45994),n(32485),n(17159),n(96790),n(78895),n(66443),n(89607),n(95282);var r=n(2675);n(78479),n(58292),n(24078),n(89490),n(16074),n(76977),n(63136),n(35276);var i=n(70568);function a(e){let{linkAttachment:t,imageAttachments:n,videoAttachments:a,quoteAttachments:l}=(0,i.B)(e);return!!t&&("comment"===t.type||"post"===t.type&&null!==(0,r.VA)({post:t.post,compact:!1,readOnly:!0}))||n.length>0||a.length>0||l.length>0}n(16291),n(39318),n(49807),n(11993),n(44307)},70568:function(e,t,n){function r(e){var t,n,r,i,a,l,o,s,c;let d=null==(t=e.attachments)?void 0:t.find(e=>["post","comment","link","publication"].includes(e.type)),u=null!=(l=null==(n=e.attachments)?void 0:n.filter(e=>"image"===e.type))?l:[],p=null!=(o=null==(r=e.attachments)?void 0:r.filter(e=>"video"===e.type))?o:[];return{linkAttachment:d,imageAttachments:u,videoAttachments:p,quoteAttachments:null!=(s=null==(i=e.attachments)?void 0:i.filter(e=>"post"===e.type&&!!e.postSelection))?s:[],imageRestackAttachments:null!=(c=null==(a=e.attachments)?void 0:a.filter(e=>"post"===e.type&&!!e.postImageSelection))?c:[]}}n.d(t,{B:()=>r}),n(4006),n(10278),n(42686),n(2675),n(8103),n(22858),n(78479),n(89490),n(93812),n(39318)},92967:function(e,t,n){n.d(t,{P6:()=>a,i:()=>l,kq:()=>i,lL:()=>r,wG:()=>o});let r=e=>{let t=Math.floor(e/60),n=Math.floor(e%60);return"".concat(t,":").concat(n.toString().padStart(2,"0"))};function i(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e<0)return"0:00";let n=Math.floor(e),r=Math.floor(n/60),i=n%60;if(t){let t=Math.round((e-n)*10);return"".concat(r,":").concat(String(i).padStart(2,"0"),".").concat(t)}return"".concat(r,":").concat(String(i).padStart(2,"0"))}let a=e=>/^[0-9.:]*$/.test(e),l=e=>/^(?:(?:[0-9]{1,3}):)?(?:[0-5][0-9]|[0-9]{1,2})(?:\.[0-9]{1,3})?$/.test(e),o=e=>{let[t="",n=""]=e.split("."),r=t.split(":").reverse().map(e=>parseInt(e)),i=r[0]||0,a=r[1]||0;return 3600*(r[2]||0)+60*a+i+parseInt(n.padEnd(3,"0"))/1e3}}}]);