!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@47b17f0"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="cd2b0a60-9032-4ec9-af7e-365016dbff3d",e._sentryDebugIdIdentifier="sentry-dbid-cd2b0a60-9032-4ec9-af7e-365016dbff3d")}catch(e){}}();"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["49229"],{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"}},9751:function(e,t,n){n.d(t,{$:()=>m,b:()=>p});var i=n(4006),r=n(84605),l=n(6049),a=n(24078),o=n(35369),s=n(76977),d=n(63136),c=n(49807),u=n(57324),h=n(36092);function p(e){let{pub:t,subdomain:n}=e,{iString:l}=(0,r.GO)();return(0,i.FD)(s.I1,{className:h.A.webContainer,alignItems:"center",border:"detail-themed",radius:"md",padding:20,gap:16,as:"a",href:g(n),target:"_blank","data-component-name":"CommunityChatEmbed",children:[(0,i.Y)(a.eu,{size:64,photoUrl:(0,c.dJ9)(t.author_photo_url)}),(0,i.FD)(s.I1,{gap:4,alignItems:"center",children:[(0,i.FD)(d.EY.H3,{translated:!0,as:"div",color:"pub-primary-text",children:["Join ",I18N.p(t.author_name),"’s subscriber chat"]}),(0,i.Y)(d.EY.B4,{translated:!0,color:"pub-secondary-text",children:"Available in the Substack app and on web"})]}),(0,i.Y)(s.I1,{alignSelf:"stretch",children:(0,i.Y)(o.$n,{priority:"primary",href:g(n),children:l("Join chat")})})]})}function m(e){let{pub:t,subdomain:n}=e,{iString:a}=(0,r.GO)();return(0,i.Y)("a",{className:h.A.emailWrapper,href:g(n),"data-component-name":"EmailCommunityChatEmbed",children:(0,i.FD)("div",{className:h.A.container,children:[(0,i.Y)(l.Kb,{size:64,src:(0,c.dJ9)(t.author_photo_url),framed:!0}),(0,i.FD)("div",{className:h.A.text,children:[(0,i.FD)(d.EY.H3,{translated:!0,className:h.A.title,as:"div",color:"pub-primary-text",children:["Join ",I18N.p(t.author_name),"’s subscriber chat"]}),(0,i.Y)(d.EY.B4,{translated:!0,color:"pub-secondary-text",children:"Available in the Substack app and on web"})]}),(0,i.Y)(l.M_,{tableClassName:h.A.button,children:a("Join chat")})]})})}function g(e){return(0,c.xWO)({pubKey:e,utm_source:u.VU.chatEmbed})}},58600:function(e,t,n){n.d(t,{B:()=>A,T:()=>F});var i=n(69277),r=n(70408),l=n(4006),a=n(18993),o=n(87677),s=n(41873),d=n(6049);n(89490);var c=n(63136);n(39318);var u=n(49807),h=n(82776);function p(e){var t,n,i;let{communityPost:r,author:u,cta:p,withAttribution:b,attributionText:y,hideReply:v,truncateBodyAt:_}=e,w=!r,C=null==r||null==(n=r.threadMediaUploads)||null==(t=n[0])?void 0:t.mediaUpload,S=null;return!w&&r.body&&(S=_?(0,h.truncateText)(r.body,_):r.body),(0,l.FD)(d.ZB,{gap:12,verticalAlign:"top",children:[(0,l.Y)(d.Kb,{src:null!=(i=null==u?void 0:u.photo_url)?i:"",size:40}),(0,l.FD)(d.jJ,{gap:4,style:{lineHeight:0},children:[b&&(0,l.Y)(a.mj,{isStatic:!0,text:y||"From ".concat((null==u?void 0:u.name)?(0,h.possessive)(u.name):"Substack user"," subscriber chat")}),w?(0,l.Y)(g,{}):["media"===r.type&&r.media_assets?r.media_assets.slice(0,1).map(e=>(0,l.Y)(Y,{asset:e},e.url)):"link"===r.type&&(0,l.Y)(f,{communityPost:r}),C&&(0,l.Y)(s.b,{mediaUpload:C}),S&&(0,l.Y)(m,{children:(0,l.FD)("span",{children:[(0,l.Y)(c.EY,{as:"span",weight:"bold",children:u?u.name:"Substack writer"})," ",S]})})],!v&&(0,l.Y)(m,{children:(0,l.Y)(d.h2,{children:(0,l.FD)("tr",{children:[(0,l.Y)("td",{align:"left",children:(0,l.Y)(c.EY,{as:"span",color:"secondary",children:"Reply..."})}),(0,l.Y)("td",{align:"right",children:(0,l.Y)(o.A,{size:20,stroke:"var(--color-secondary}"})})]})})}),p&&(0,l.Y)(d.KJ,{fullWidth:!0,href:p.url,children:p.text}),p&&p.blurb&&(0,l.Y)("div",{children:(0,l.Y)(c.EY,{color:"secondary",align:"center",size:14,lineHeight:20,children:p.blurb})})]})]})}function m(e){return(0,l.Y)("div",(0,i._)({className:"bubble-ufWvfM"},e))}function g(){return(0,l.Y)("div",{className:"paywallBubble-VDFuNU bubble-ufWvfM",style:{backgroundImage:"url(".concat((0,u.dJ9)("/img/community/paywall-pixels-light.png"),")")},children:(0,l.Y)(c.EY.Meta,{children:"SUBSCRIBERS ONLY"})})}function Y(e){var t;let{asset:n}=e;return(0,l.Y)("img",{className:"img-cbG6oW",width:400,src:(0,u.dJ9)(null!=(t=n.url)?t:"",800,{crop:"limit",height:800})})}function f(e){var t,n;let i,{communityPost:r}=e,{link_metadata:a,link_url:o}=r,s=null!=(n=null!=(t=null==a?void 0:a.url)?t:o)?n:"";try{let e=new URL(s);i="".concat(e.host).concat(e.pathname).concat(e.search).concat(e.hash)}catch(e){i=s}return(0,l.Y)(m,{children:(0,l.Y)(d.h2,{style:{width:"400px"},children:(0,l.FD)("tr",{children:[(0,l.FD)("td",{align:"left",style:{verticalAlign:"top"},children:[(null==a?void 0:a.title)&&(0,l.Y)(c.EY,{font:"serif",lineHeight:24,children:a.title}),(0,l.Y)(c.EY.Meta,{color:"secondary",children:i})]}),(0,l.Y)("td",{width:"16"}),(0,l.Y)("td",{align:"right",children:(null==a?void 0:a.image)&&(0,l.Y)("img",{className:"linkImg-_n19TI",src:(0,u.dJ9)(a.image,144,{height:144,smartCrop:!0})})})]})})})}var b=n(86500),y=n(94729),v=n(12501),_=n(44333),w=n(76977),C=n(57324),S=n(91348);function A(e){var t,n,i,r,o;let s,{postId:d}=e,{path:c}=(0,_.zy)();"undefined"!=typeof window&&(s=c.startsWith("/inbox/post/")?Number(c.split("/post/")[1]):"post"in window._preloads?null==(o=window._preloads)||null==(r=o.post)?void 0:r.id:void 0);let{error:h,result:p}=(0,v.st)({pathname:"/api/v1/community/posts/".concat(d),auto:!0,deps:[d]}),m=h instanceof y.fk&&402===h.response.status&&((null==(t=h.body)?void 0:t.status)==="PAID_SUBSCRIPTION_REQUIRED"||(null==(n=h.body)?void 0:n.status)==="FOUNDING_SUBSCRIPTION_REQUIRED"||(null==(i=h.body)?void 0:i.status)==="FREE_SUBSCRIPTION_REQUIRED")?h.body:null;return(0,l.Y)(w.pT,{as:"a",className:S.A.container,target:"_blank",href:(0,u.sWz)({postId:d,utm_source:C.VU.threadEmbed}),"data-component-name":"CommunityPostEmbed",onClick:()=>(0,b.u4)(b.qY.EMBEDDED_COMMUNITY_POST_CLICKED,{post_id:s,community_post_id:d}),children:m?"FREE_SUBSCRIPTION_REQUIRED"===m.status&&m.communityPost?(0,l.Y)(a.lS,{author:m.user,communityPost:m.communityPost,surface:"community_post_embed",communityPostEmbedPostId:s,useClientSideRouting:!1,withAttribution:!0,isReadOnly:!0,utmSource:C.VU.threadEmbed}):(0,l.Y)(a.I8,{author:m.user,audience:"FREE_SUBSCRIPTION_REQUIRED"===m.status?"all_subscribers":"PAID_SUBSCRIPTION_REQUIRED"===m.status?"only_paid":"only_founding"}):h?"Could not load chat message: Click to view":p&&(0,l.Y)(a.lS,{author:p.user,communityPost:p.communityPost,surface:"community_post_embed",communityPostEmbedPostId:s,utmSource:C.VU.threadEmbed,useClientSideRouting:!1,withAttribution:!0,isReadOnly:!0})})}function F(e){let{postId:t}=e;return(0,l.Y)("a",{className:S.A.emailWrapper,href:(0,u.sWz)({postId:t,utm_source:C.VU.threadEmbed,modal:"1"}),"data-component-name":"EmailCommunityPostEmbed",children:(0,l.Y)("div",{className:S.A.container,children:(0,l.Y)(p,(0,r._)((0,i._)({},e),{withAttribution:!0}))})})}},21805:function(e,t,n){n.d(t,{a9:()=>w,i_:()=>_});var i=n(69277),r=n(70408),l=n(4006),a=n(32485),o=n.n(a),s=n(84934),d=n(17402),c=n(52742),u=n(33764),h=n(17028),p=n(76977),m=n(49807),g=n(36008);let Y=(e,t)=>1===t?"large":2===t||4===t?"medium":t%3==0?"small":5===t||7===t?e<=2?"small":"medium":e<=5?"small":"medium",f={small:237,medium:360,large:728},b=e=>{let{src:t,size:n,onSelectImage:i,useViewer:r=!1,alt:a}=e;return(0,l.Y)(u.o,{src:t,alt:a,maxWidth:2*f[n],className:o()(g.A.image,g.A[n],r&&g.A.zoom,(0,h.iF)({pressable:"lg"})),onClick:()=>{r&&i()}})},y=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=[];for(let r in e){let l=e[r],{height:a=0,width:o=0}=l&&(0,m.d4Y)(l.src)||{},s="(".concat(Number(r)+1," of ").concat(e.length,")"),d={src:l.src,height:a,width:o,alt:"".concat(n," ").concat(s),title:"".concat(t," ").concat(s)};i.push({attrs:d})}return i},v=e=>{let{onEditGallery:t}=e;return(0,l.Y)(h.mZ,{priority:"primary",onClick:t,className:g.A.edit,children:(0,l.Y)(s.A,{size:20})})},_=e=>{var t;let{node:n,editor:a,post:s,publication:u,onLike:h}=e,{gallery:m}=n.attrs,f=n.attrs.isEditor||a,{caption:_,alt:w}=null!=m?m:{},C=null!=(t=null==m?void 0:m.images.map((e,t)=>(0,r._)((0,i._)({},e),{idx:t})))?t:[],S="undefined"!=typeof window&&!window.location.pathname.startsWith("/publish"),[A,F]=(0,d.useState)(!1),[N,E]=(0,d.useState)(0),D=1===C.length,k=y(C,_),I=e=>{E(e),F(!0)};if(0===C.length)return null;let x=function e(t){let n=4===t.length?2:3,i=[t.slice(0,n)],r=t.slice(n);return r.length>0&&(i=i.concat(e(r))),i}(C);return(0,l.FD)("figure",{className:g.A.gallery,"data-drag-handle":!0,"data-component-name":"ImageGallery",children:[f&&m&&(0,l.Y)(v,{onEditGallery:()=>{document.dispatchEvent(new Event("editSelectedImageGallery"))}}),(0,l.FD)(p.I1,{gap:8,children:[D?(0,l.Y)(b,{src:C[0].src,alt:w,caption:_,size:Y(0,1),onSelectImage:()=>I(0),useViewer:S}):x.map(e=>(0,l.Y)(p.pT,{className:o()(g.A.imageRow,g.A["length-".concat(e.length)]),gap:8,children:e.map(e=>(0,l.Y)(b,{src:e.src,alt:w,caption:_,size:Y(e.idx,C.length),onSelectImage:()=>I(e.idx),useViewer:S}))})),_&&(0,l.Y)("figcaption",{className:g.A.imageCaption,children:_})]}),(0,l.Y)(c.V6,{isOpen:A,modalContent:k,onClose:()=>F(!1),step:N,post:s,publication:u,onLike:h})]})},w=e=>{let{node:t}=e,{gallery:n}=t.attrs;if(!n)return null;let{alt:i,staticGalleryImage:r,caption:a}=n;return r?(0,l.FD)("div",{className:o()(g.A.static,g.A.gallery),"data-component-name":"ImageGalleryStatic",children:[(0,l.Y)("img",{src:(0,m.dJ9)(r.src,2*f.large),alt:i}),a&&(0,l.Y)("div",{className:o()(g.A.imageCaption,g.A.static),children:a})]}):null}},38893:function(e,t,n){n.d(t,{$g:()=>m,ju:()=>Y,lC:()=>g});var i=n(4006),r=n(13295),l=n(14506),a=n(48617),o=n(99070),s=n(4169),d=n(84605),c=n(89490),u=n(63136),h=n(82286),p=n(53076);function m(e){let{label:t,src:n,duration:c,downloadable:p,autoPlay:m,post:f,pub:b,mediaUpload:y,trackingProps:v}=e,{iString:_}=(0,d.GO)();return(0,i.Y)(o.A,{src:n,duration:c,autoPlay:m,post:f,pub:b,metricsPost:f,feature:"Embed audio",mediaUpload:y,trackingProps:null!=v?v:{},render:e=>{let{currentTime:o,isPlaying:d,progress:m,progressBarRef:f,progressBarOnMouseDown:b,remainingTime:y,playbackRate:v,setPlaybackRate:w,togglePlayback:C}=e;return(0,i.FD)(Y,{"aria-label":_("Audio embed player"),role:"region","data-component-name":"AudioEmbedPlayer",children:[(0,i.Y)(l.e,{isPlaying:d,onClick:C}),(0,i.FD)(g,{children:[t&&(0,i.Y)(u.EY.B4,{weight:"medium",color:"secondary",children:t}),(0,i.Y)(s.b,{currentTime:o,remainingTime:y,containerRef:f,progress:m,onMouseDown:b})]}),(0,i.FD)(h.Xn,{children:[p&&(0,i.Y)(r.Y,{src:n}),c&&c>600&&(0,i.Y)(a.x,{onSetPlaybackRate:w,playbackRate:v})]})]})}})}let g=(0,c.I4)({display:"flex",flex:"grow",direction:"column",gap:6}),Y=(0,c.I4)({display:"flex",flex:"grow",radius:"sm",bg:"primary",userSelect:"none",sizing:"border-box",alignItems:"center",gap:12,padding:12,border:"detail",className:p.A.embed})},48246:function(e,t,n){n.d(t,{x:()=>p});var i=n(4006),r=n(32485),l=n.n(r),a=n(69277),o=n(70408),s=n(32641),d=n(97731);let c=e=>{var{stroke:t="var(--color-fg-primary)"}=e,n=(0,s._)(e,["stroke"]);return(0,i.FD)(d.A,(0,o._)((0,a._)({},n),{name:"PlayIconRound",svgParams:{height:24,width:24},stroke:t,children:[(0,i.Y)("path",{className:"outer-circle",d:"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,i.Y)("path",{className:"inner-triangle",d:"M10 8L16 12L10 16V8Z",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}))};var u=n(84605),h=n(82776);function p(e){var t;let{pub:n,post:r,duration:a,label:o}=e,{iString:s}=(0,u.GO)();return(0,i.Y)("table",{"data-component-name":"AudioEmbedPlayerStatic",className:"tw-w-full tw-rounded-full tw-bg-substack-wash",children:(0,i.Y)("tr",{children:(0,i.Y)("td",{className:"tw-text-center tw-font-meta tw-text-ssm tw-uppercase tw-text-substack-primary",children:(0,i.FD)("a",{href:null==r?void 0:r.canonical_url,className:l()("tw-block tw-w-full tw-p-4 tw-text-substack-primary","noUnderline-s6VF_k"),children:[(0,i.Y)(c,{className:"tw-w-max-4 tw-mr-2 tw-inline-block tw-w-4 tw-align-middle",stroke:null==(t=n.theme)?void 0:t.background_pop_color,isStatic:!0}),(0,i.FD)("span",{className:"tw-align-middle",children:[(0,h.truncateText)(o,10)||s("Listen now")," \xb7 ",(0,h.secondsToHHMMSS)(a||0)]})]})})})})}},12153:function(e,t,n){n.d(t,{Nq:()=>e6,h:()=>e4,Ev:()=>tt,Ri:()=>e5,tT:()=>e3,hA:()=>e9,Jo:()=>e8,mt:()=>e1,E9:()=>te,nu:()=>e0,Im:()=>tn,H0:()=>e7,mN:()=>e2});var i=n(69277),r=n(70408),l=n(4006),a=n(61579),o=n(32641),s=n(32485),d=n.n(s),c=n(43327),u=n(47663),h=n(12988),p=n(6049),m=n(39318);let g="iconLink-hKp_3x",Y={spotify:(0,m.dJ9)("/img/thefp/spotify-red.png"),apple:(0,m.dJ9)("/img/thefp/apple-red.png"),rss:(0,m.dJ9)("/img/thefp/rss-red.png")},f=e=>{let{showLinks:t,feedUrl:n}=e;return(0,l.FD)(p.ZB,{gap:12,verticalAlign:"middle",children:[t.spotify_url&&(0,l.Y)("a",{className:g,href:t.spotify_url,rel:"noreferrer noopener",target:"_blank",children:(0,l.Y)("img",{alt:"Spotify",height:20,src:Y.spotify,width:20})}),t.apple_podcasts_url&&(0,l.Y)("a",{className:g,href:t.apple_podcasts_url,rel:"noreferrer noopener",target:"_blank",children:(0,l.Y)("img",{alt:"Apple Podcasts",height:20,src:Y.apple,width:20})}),(0,l.Y)("a",{className:g,href:n,rel:"noreferrer noopener",target:"_blank",children:(0,l.Y)("img",{alt:"RSS",height:20,src:Y.rss,width:20})})]})},b=e=>{let{youtubeUrl:t}=e;return t?(0,l.Y)("a",{className:"link-lpm56C",href:t,rel:"noopener noreferrer",target:"_blank",children:(0,l.Y)(p.ZB,{gap:8,verticalAlign:"middle",children:(0,l.Y)("img",{alt:"YouTube",height:20,src:(0,m.dJ9)("/img/thefp/youtube-red.png"),width:20})})}):null};var y=n(84605);let v=e=>{let{cta:t,feedUrl:n,href:i,onlyMedia:r,post:a,showLinks:o,size:s="sm",youtubeUrl:d}=e,{iString:c}=(0,y.GO)(),u="podcast"===a.type,h=!!a.video_upload_id,m=u&&(o||n),g=h&&d;if(r&&!(m||g))return null;let Y=t;return m?Y=c("Listen on"):g&&(Y=c("Watch on youtube")),(0,l.FD)(p.ZB,{gap:8,verticalAlign:"middle",children:[(0,l.Y)("div",{className:"button-fZfkQf",children:(0,l.Y)("a",{className:"md"===s?"buttonMd-Lg5kyv":"buttonSm-PaaWgJ",href:!m&&d?d:i,children:Y})}),u&&o&&n&&(0,l.Y)(f,{feedUrl:n,showLinks:o}),h&&!m&&d&&(0,l.Y)(b,{youtubeUrl:d})]})};var _=n(84297);let w=e=>{let{feedUrl:t,post:n,showLinks:i,youtubeUrl:r}=e,{title:a,canonical_url:o}=n,s=(0,_.a)(n);return(0,l.FD)(p.jJ,{gap:4,children:[(0,l.Y)("div",{className:"heading-UGv4c2",children:s}),(0,l.Y)("a",{className:"link-jbVsqJ",href:o,children:a}),(0,l.Y)(v,{feedUrl:t,href:o,onlyMedia:!0,post:n,showLinks:i,size:"sm",youtubeUrl:r})]})};var C=n(38305),S=n(49807);let A=e=>{let{bylines:t}=e;return(null==t?void 0:t.length)?(0,l.Y)("div",{className:"meta-XhipYq",children:(0,l.Y)(C.K,{array:t||[],formatter:e=>{let{id:t,name:n}=e;return(0,l.Y)("a",{className:"inheritColor-eP1Bab",href:(0,S.rfn)(t,n),children:n})},limit:3})}):null},F=e=>{let{href:t,size:n,title:i}=e;return(0,l.Y)("a",{className:"link-AiRTNr",href:t,children:(0,l.Y)("div",{className:"title-RKep04",style:{fontSize:n},children:i})})};var N=n(39891);let E=e=>{let{caption:t,cta:n,feedUrl:i,post:r,showBylines:a,showLinks:o,youtubeUrl:s}=e,{publishedBylines:d,title:c,canonical_url:u,cover_image:h,cover_image_alt:m}=r;return(0,l.FD)(p.jJ,{gap:16,style:{width:"100%"},children:[(0,l.Y)(F,{href:u,size:24,title:c}),a&&(0,l.Y)(A,{bylines:d}),h&&(0,l.Y)("a",{href:u,children:(0,l.Y)("img",{alt:null!=m?m:c,src:(0,N.dJ)(h,1100,{quality:"auto:good",smartCrop:!0}),style:{width:"auto",height:"auto",maxWidth:"100%"},width:550})}),(0,l.FD)(p.jJ,{gap:16,children:[(0,l.Y)("div",{dangerouslySetInnerHTML:{__html:t}}),(0,l.Y)(v,{cta:n,feedUrl:i,href:u,post:r,showLinks:o,size:"md",youtubeUrl:s})]})]})};var D=n(69706);let k=e=>{let{cta:t,feedUrl:n,post:i,showBylines:r,showLinks:a,youtubeUrl:o}=e,{publishedBylines:s,title:d,canonical_url:c,cover_image:u,cover_image_alt:h}=i;return(0,l.Y)(p.h2,{style:{width:"100%"},children:(0,l.FD)("tr",{children:[u&&(0,l.FD)(l.FK,{children:[(0,l.Y)("td",{style:{verticalAlign:"top"},width:90,children:(0,l.Y)("a",{href:c,children:(0,l.Y)("img",{alt:null!=h?h:d,src:(0,N.dJ)(u,180,{quality:"auto:good",smartCrop:!0,aspect:D.Zi}),style:{width:"auto",height:"auto",maxWidth:"100%"},width:90})})}),(0,l.Y)("td",{style:{minWidth:"16px"},width:16})]}),(0,l.Y)("td",{style:{verticalAlign:"top"},children:(0,l.FD)(p.jJ,{gap:16,children:[(0,l.Y)(F,{href:c,size:18,title:d}),r&&(0,l.Y)(A,{bylines:s}),(0,l.Y)(v,{cta:t,feedUrl:n,href:c,post:i,showLinks:a,size:"sm",youtubeUrl:o})]})})]})})},I=e=>{let{cta:t,feedUrl:n,post:i,showBylines:r,showLinks:a,youtubeUrl:o}=e,{publishedBylines:s,title:d,canonical_url:c}=i;return(0,l.FD)(p.jJ,{gap:16,children:[(0,l.Y)(F,{href:c,size:18,title:d}),r&&(0,l.Y)(A,{bylines:s}),(0,l.Y)(v,{cta:t,feedUrl:n,href:c,post:i,showLinks:a,size:"sm",youtubeUrl:o})]})};var x=n(41232),T=n(4016),R=n(20004);let B=e=>{var{caption:t,size:n,pub:i,cta:r,showBylines:a,youtube_url:s,show_links:c,feed_url:u}=e,h=(0,o._)(e,["caption","size","pub","cta","showBylines","youtube_url","show_links","feed_url"]);if(!h)return null;let p=(0,T.lu)({pub:i});return(0,l.Y)("div",{className:d()(R.A.digestPostEmbed,x.A.digestPostEmbed),"data-component-name":"DigestPostEmbedStatic",children:P({size:n,post:h,caption:t,isTheFP:p,cta:r,showBylines:a,mediaLinkProps:{youtubeUrl:null!=s?s:null,showLinks:null!=c?c:null,feedUrl:null!=u?u:void 0}})})},P=e=>{let{size:t,post:n,caption:r,isTheFP:a,cta:o,showBylines:s,mediaLinkProps:d}=e;switch(t){case"lg":return a?(0,l.Y)(E,(0,i._)({caption:r,cta:o,post:n,showBylines:s},d)):(0,l.Y)(c.hx,{post:n,children:L(r)});case"md":return a?(0,l.Y)(k,(0,i._)({cta:o,post:n,showBylines:s},d)):(0,l.Y)(u.J,{post:n,children:L(r)});case"sm":return a?(0,l.Y)(I,(0,i._)({cta:o,post:n,showBylines:s},d)):(0,l.Y)(h.g,{post:n});case"xs":return a?(0,l.Y)(w,(0,i._)({post:n},d)):(0,l.Y)(h.g,{post:n});default:return console.warn("unrecognized size",t),null}},L=e=>(0,l.Y)("p",{className:R.A.caption,dangerouslySetInnerHTML:{__html:e}});var O=n(79785);function U(e){let{children:t,href:n,className:i}=e;return(0,l.Y)("a",{className:d()("button primary email cta subscribe-btn",i),href:n,children:t})}var J=n(15567);function z(){let e=(0,O._)(["Message ",""]);return z=function(){return e},e}let M=e=>{let{userId:t,userName:n}=e,{iTemplate:i}=(0,y.GO)();return(0,l.Y)("p",{className:"button-wrapper","data-component-name":"DirectMessageStatic",children:(0,l.Y)(U,{href:(0,J.qO)({userId:t,userName:n}),children:i(z(),n)})})};var W=n(27775),H=n(67078),j=n(97213),G=n(17402),V=n(13950),K=n(25006),q=n(46271),Z=n(86500),X=n(12501),$=n(35369),Q=n(76977),ee=n(16993),et=n(63136),en=n(19256);function ei(){let e=(0,O._)(["Message ",""]);return ei=function(){return e},e}let er=e=>{let{userId:t,userName:n}=e,{iTemplate:i}=(0,y.GO)(),r=(0,K.df)(),a=(0,q.Jd)(),[o,s]=(0,G.useState)(!1),[d,c]=(0,G.useState)([]),[u,h]=(0,G.useState)(!1),[p,m]=(0,G.useState)(!1),[g,Y]=(0,G.useState)(!1),f=(0,S.LRz)({userId:t,userName:n}),{result:b}=(0,X.st)({pathname:(0,S.lz6)({userId:t,userName:n}),deps:[t],auto:!0});(0,G.useEffect)(()=>{if(b){var e;s(null!=(e=b.can_dm)&&e),c(b.dm_upgrade_options||[])}},[b]);let v=i(ei(),(null==b?void 0:b.name)||n);return(0,l.Y)(l.FK,{children:(0,l.FD)(V.DH,{children:[(0,l.FD)(Q.pT,{flex:"grow",style:{marginBottom:"20px"},justifyContent:"center","data-component-name":"DirectMessageWeb",children:[!!o&&(0,l.Y)($.$n,{priority:"primary",onClick:()=>(0,Z.u4)(Z.qY.DIRECT_MESSAGE_WRITER_BUTTON_CLICKED,{locked:!1}),href:(0,J.pV)({urlParams:{user:f,utm_source:"direct-message-writer"}}),newTab:!0,leading:(0,l.Y)(W.A,{size:20}),children:v}),!o&&(0,l.Y)($.$n,{onClick:()=>{(0,Z.u4)(Z.qY.DIRECT_MESSAGE_WRITER_BUTTON_CLICKED,{locked:!0}),a?a.id===t?Y(!0):h(!0):m(!0)},priority:"secondary",leading:(0,l.Y)(H.A,{size:20}),children:v})]}),(0,l.Y)(ea,{isOpen:p,onClose:()=>m(!1),profile:b,pub:r}),(0,l.Y)(el,{isOpen:g,onClose:()=>Y(!1)}),(0,l.Y)(en._,{isOpen:u,onClose:()=>h(!1),profile:b,dmUpgradeOptions:d,isEditor:!0})]})})},el=e=>{let{isOpen:t,onClose:n}=e,{iString:i}=(0,y.GO)();return(0,l.Y)(ee.aF,{width:360,isOpen:t,onClose:n,children:(0,l.Y)(ee.cw,{children:(0,l.FD)(Q.I1,{gap:16,children:[(0,l.Y)(Q.pT,{alignSelf:"center",flex:"auto",bg:"secondary",radius:"full",padding:16,children:(0,l.Y)(j.A,{size:24})}),(0,l.Y)(Q.I1,{children:(0,l.Y)(et.EY.B2,{weight:"semibold",align:"center",children:i("You can't message yourself, but others will be able to message you via this button.")})}),(0,l.Y)(Q.I1,{children:(0,l.Y)($.$n,{justifyContent:"center",onClick:n,priority:"secondary",children:i("Okay")})})]})})})},ea=e=>{let{isOpen:t,onClose:n,profile:i,pub:r}=e,{iString:a}=(0,y.GO)();return(0,l.Y)(ee.aF,{width:360,isOpen:t,onClose:n,children:(0,l.Y)(ee.cw,{children:(0,l.FD)(Q.I1,{gap:16,children:[(0,l.Y)(Q.pT,{alignSelf:"center",flex:"auto",bg:"secondary",radius:"full",padding:16,children:(0,l.Y)(H.A,{size:24})}),(0,l.Y)(Q.I1,{children:(0,l.Y)(et.EY.B2,{weight:"semibold",align:"center",children:a("Sign in to send ".concat(null==i?void 0:i.name," a message"))})}),(0,l.FD)(Q.I1,{gap:8,children:[(0,l.Y)($.$n,{justifyContent:"center",href:(0,m.a7q)({for_pub:null==r?void 0:r.subdomain}),children:a("Sign in")}),(0,l.Y)($.$n,{justifyContent:"center",onClick:n,priority:"secondary",children:a("Maybe later")})]})]})})})};var eo=n(18999);let es=e=>{let{href:t,children:n}=e;return t?(0,l.Y)("a",{href:t,target:"_blank",rel:"noopener",style:{textDecoration:"none"},children:n}):n};var ed=n(60177);let ec=e=>{let{src:t,alt:n,title:i,width:r,height:a,align:o,href:s,captionHtml:c}=e,u="100%"===r?m.oSl:r;return(0,l.Y)("div",{className:d()(ed.A.staticView),"data-component-name":"Image3Static",children:(0,l.Y)(es,{href:s,children:(0,l.FD)("div",{style:(e=>{let{align:t,width:n}=e,i={};return"center"===t||"100%"===n||n>=m.oSl||(i["left"===t?"paddingRight":"paddingLeft"]=m.oSl-n),i})({align:o,width:r}),className:d()(ed.A.staticImageWrap),children:[(0,l.Y)("img",{width:u,height:a,src:(0,m.dJ9)(t,2*m.oSl),alt:n}),!c&&i&&(0,l.Y)("div",{className:d()(ed.A.caption,ed.A.static),children:i}),!!c&&(0,l.Y)("div",{className:d()(ed.A.caption,ed.A.static),dangerouslySetInnerHTML:{__html:c}})]})})})};var eu=n(52742),eh=n(33764);let ep=e=>{let{src:t,alt:n,title:i,width:r,size:a,align:o,href:s,captionHtml:c}=e,u=s||null,[h,p]=(0,G.useState)(!1),g=(0,G.useRef)(null);return(0,l.FD)("figure",{className:d()(ed.A.mediaNodeView,o&&ed.A["align-".concat(o)||""]),"data-component-name":"Image3Dynamic",children:[(0,l.Y)(Q.Ye,{className:d()(ed.A.imageContainer,ed.A[a],{[ed.A.pointer]:u,[ed.A.zoom]:!u}),onClick:()=>{s?window.open(s,"_blank"):p(!0)},children:(0,l.FD)(Q.I1,{gap:8,children:[(0,l.Y)(eh.o,{className:ed.A[a],src:t,alt:n,title:i,maxWidth:(()=>{switch(a){case"large":return m.T$x;case"full":if("undefined"!=typeof window)return window.innerWidth;return m.YL9;default:if("100%"===r)return m.EZZ;return r}})(),imageRef:g,useRetinaSizing:!0,imageIsFixedWidth:!1}),!c&&!!i&&(0,l.Y)("figcaption",{"data-component-name":"Image3DynamicTitle",className:ed.A.caption,children:i}),!!c&&(0,l.Y)("figcaption",{"data-component-name":"Image3DynamicCaption",className:ed.A.caption,dangerouslySetInnerHTML:{__html:c}})]})}),(0,l.Y)(eu.V6,{isOpen:h,modalContent:[{attrs:{src:t,alt:n,title:i}}],onClose:()=>p(!1),step:0})]})};var em=n(73653),eg=n(65113),eY=n(21805),ef=n(21471),eb=n(54515),ey=n(68695),ev=n(41873);let e_=e=>{let{mediaUpload:t,post:n,pub:i}=e;if(!t)return(0,l.Y)("div",{"data-component-name":"video-embed-player-static-missing-media",children:"Did not find video"});let r=(0,S.py2)({pub:i,post:n,mediaUploadId:t.id});return(0,l.Y)(ev.b,{mediaUpload:t,href:r})};var ew=n(74728),eC=n.n(ew);let eS={allowedTags:["pre","code","span"],allowedAttributes:{pre:["class","style","tabindex"],code:["class","style"],span:["class","style"]}};function eA(e){let{code:t,highlightedHtml:n}=e;if(n){let e=eC()(n,eS);return(0,l.Y)("div",{dangerouslySetInnerHTML:{__html:e}})}return(0,l.Y)("pre",{children:(0,l.Y)("code",{children:t})})}var eF=n(71335),eN=n(97884);function eE(e){let{code:t,language:i}=e,[r,a]=(0,G.useState)(null);return((0,G.useEffect)(()=>{n.e("65118").then(n.bind(n,30605)).then(e=>{a(()=>e.CodeBlock)})},[]),r)?(0,l.Y)(eF.v,{children:(0,l.Y)(r,{code:t,language:i,showCopyButton:!0,showLineNumbers:!0})}):(0,l.Y)(eF.v,{padding:20,children:(0,l.Y)(Q.VP,{overflow:"auto",scrollBar:"hidden",className:eN.A.code,"data-line-numbers":"true",children:(0,l.Y)("pre",{children:(0,l.Y)("code",{children:t})})})})}var eD=n(95977),ek=n(89490),eI=n(76270);function ex(e){let{equipment:t}=e,{iString:n}=(0,y.GO)();return t?(0,l.FD)(p.jJ,{gap:20,style:{width:"100%"},children:[(0,l.Y)(p.mV,{}),(0,l.FD)(p.jJ,{gap:2,children:[(0,l.Y)(eI.I5,{label:n("Equipment")}),(0,l.Y)(eI.BX,{value:t})]})]}):null}var eT=n(48575),eR=n(53448);function eB(e){let{ingredients:t}=e,{iString:n}=(0,y.GO)();return t&&0!==t.length?(0,l.FD)(p.jJ,{gap:20,style:{width:"100%"},children:[(0,l.Y)(p.mV,{}),(0,l.FD)(p.jJ,{gap:12,children:[(0,l.Y)(eT.bK,{title:n("Ingredients")}),(0,l.Y)(p.h2,{width:"100%",children:t.map((e,n)=>{let{number:i,text:r}=(0,eR.L_)(e),a=n===t.length-1;return(0,l.FD)("tr",{children:[(0,l.Y)("td",{style:{verticalAlign:"top",paddingRight:8,paddingBottom:4*!a,width:"auto"},children:(0,l.Y)(et.EY.B3,{as:"span",weight:"semibold",children:i||""})}),(0,l.Y)("td",{style:{verticalAlign:"top",paddingBottom:4*!a},children:(0,l.Y)(et.EY.B3,{as:"span",children:r})})]},n)})})]})]}):null}function eP(e){let{steps:t}=e,{iString:n}=(0,y.GO)();return t&&0!==t.length?(0,l.FD)(p.jJ,{gap:20,style:{width:"100%"},children:[(0,l.Y)(p.mV,{}),(0,l.FD)(p.jJ,{gap:12,children:[(0,l.Y)(eT.bK,{title:n("Preparation")}),(0,l.Y)(p.jJ,{gap:16,children:t.map((e,t)=>(0,l.FD)(p.jJ,{gap:4,children:[(0,l.FD)(et.EY.B3,{as:"span",weight:"bold",children:[n("Step")," ",t+1]}),(0,l.Y)(et.EY.B3,{as:"span",children:e})]},t))})]})]}):null}function eL(e){let{recipeYield:t}=e,{iString:n}=(0,y.GO)();return t?(0,l.Y)("td",{width:"25%",style:{verticalAlign:"top"},children:(0,l.FD)(p.jJ,{gap:2,children:[(0,l.Y)(eI.I5,{label:n("Serves")}),(0,l.Y)(eI.BX,{value:t})]})}):null}function eO(e){let{values:t,getLabel:n}=e;return t&&0!==t.length?(0,l.Y)(l.FK,{children:t.map(e=>(0,l.Y)(ek.az,{display:"inline-block",paddingRight:12,paddingBottom:12,children:(0,l.Y)(ek.az,{paddingX:4,paddingY:2,bg:"secondary",radius:"xs",children:(0,l.Y)(et.EY.B4,{as:"span",weight:"medium",children:n?n(e):e})},e)},e))}):null}function eU(e){var t;let n,i,{label:r,time:a}=e;if(0===a)return null;let o=(n=Math.floor((t=a)/60),i=t%60,n>0&&i>0?"".concat(n,"h ").concat(i,"m"):n>0?"".concat(n,"h"):"".concat(i,"m"));return(0,l.Y)("td",{width:"25%",style:{verticalAlign:"top",paddingRight:8},children:(0,l.FD)(p.jJ,{gap:2,children:[(0,l.Y)(eI.I5,{label:r}),(0,l.Y)(eI.BX,{value:o})]})})}function eJ(e){let{recipe:t}=e,{iString:n}=(0,y.GO)();if(!t)return null;let i=t.metadata,r=i.prepTime||i.cookTime||i.totalTime||i.recipeYield,a=i.category||i.keywords||i.cuisine||i.diet;return(0,l.FD)(ek.az,{border:"detail",radius:"md",overflow:"hidden",children:[(0,l.Y)(eD.A,{src:(0,m.dJ9)(t.image_url,2*m.oSl),width:m.oSl,style:{width:m.oSl,height:"auto",objectFit:"cover"}}),(0,l.FD)(p.jJ,{gap:20,style:{padding:20,width:"100%"},children:[(0,l.FD)(p.jJ,{gap:12,children:[(0,l.Y)(et.EY.H2,{weight:"heavy",children:t.name}),i.description&&(0,l.Y)(et.EY.B3,{as:"span",children:i.description})]}),r&&(0,l.Y)(p.mV,{}),(0,l.Y)(p.h2,{width:"100%",children:(0,l.FD)("tr",{children:[(0,l.Y)(eU,{label:n("Prep time"),time:i.prepTime}),(0,l.Y)(eU,{label:n("Cook time"),time:i.cookTime}),(0,l.Y)(eU,{label:n("Total time"),time:i.totalTime}),(0,l.Y)(eL,{recipeYield:i.recipeYield})]})}),(0,l.Y)(ex,{equipment:i.tools}),(0,l.Y)(eB,{ingredients:t.ingredients||[]}),(0,l.Y)(eP,{steps:t.steps||[]}),a&&(0,l.Y)(p.mV,{}),(0,l.FD)("div",{style:{display:"block",width:"100%"},children:[(0,l.Y)(eO,{values:i.category,getLabel:eR.F$}),(0,l.Y)(eO,{values:i.keywords}),(0,l.Y)(eO,{values:i.cuisine,getLabel:eR.lX}),(0,l.Y)(eO,{values:i.diet,getLabel:eR.TD})]})]})]})}var ez=n(20956);function eM(e){return(0,l.Y)(p.jJ,{gap:8,style:{width:"100%"},children:(0,l.Y)(ez.Y,(0,r._)((0,i._)({},e),{separator:(0,l.Y)(p.mV,{})}))})}var eW=n(5955);function eH(e){var t;let{username:n,name:i,profile_image_url:r}=e;return(0,l.FD)(p.ZB,{gap:12,verticalAlign:"middle",children:[(0,l.Y)(p.Kb,{src:null!=(t=null==r?void 0:r.replace("_normal",""))?t:"",alt:(0,eW.sK)(n),size:40}),(0,l.FD)(p.jJ,{children:[(0,l.Y)(et.EY.B4,{weight:"semibold",children:i}),(0,l.FD)(et.EY.B4,{color:"secondary",children:["@",n]})]})]})}function ej(e){let{expandedUrl:t}=e,{title:n,domain:i,image:r}=t,a="string"==typeof r?r:null==r?void 0:r.url;return(0,l.FD)(p.ZB,{gap:12,style:{width:"100%",padding:12,backgroundColor:"#f7f7f7",borderRadius:8},children:[(0,l.FD)(p.jJ,{gap:2,children:[i&&(0,l.Y)(et.EY.B4,{color:"secondary",children:i}),n&&(0,l.Y)(et.EY.B3,{weight:"medium",children:n})]}),a&&(0,l.Y)(eG,{src:a,alt:n})]})}function eG(e){let{src:t,alt:n}=e;return(0,l.Y)("td",{style:{width:64},children:(0,l.Y)("img",{src:(0,S.dJ9)(t,128,{aspect:D.Zi,crop:"fill"}),alt:n||"Link preview",width:64,height:64,style:{borderRadius:8,objectFit:"cover"}})})}function eV(e){let{photos:t}=e;return t&&0!==t.length&&t[0]?(0,l.Y)(eD.A,{src:(0,S.dJ9)(t[0].img_url,550),alt:t[0].alt_text||"Image",style:{display:"inline",width:"auto",height:"auto",maxWidth:"100%",maxHeight:420,borderRadius:8}}):null}function eK(e){let{quotedTweet:t}=e;if(!(null==t?void 0:t.full_text))return null;let n=t.full_text.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();return(0,l.Y)(p.h2,{width:"100%",style:{border:"1px solid #eeeeee",borderRadius:8,padding:12},children:(0,l.Y)("tr",{children:(0,l.Y)("td",{children:(0,l.FD)(p.jJ,{gap:8,children:[(0,l.FD)(p.ZB,{gap:8,verticalAlign:"middle",children:[t.username&&(0,l.Y)(p.Kb,{src:(0,eW.Wk)(t.username,20),size:20}),(0,l.FD)(et.EY.B4,{children:[(0,l.Y)("span",{style:{fontWeight:600},children:t.name||""})," ",(0,l.FD)("span",{style:{color:"#888888"},children:["@",t.username]})]})]}),(0,l.Y)(et.EY.B3,{children:n})]})})})})}var eq=n(98505);function eZ(e){let{fullText:t}=e,n=t.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();return(0,l.Y)(et.EY.B3,{style:{whiteSpace:"pre-wrap"},className:eq.A.text,children:n})}function eX(e){let{attrs:t}=e,{url:n,full_text:i,username:r,name:a,profile_image_url:o,date:s,photos:d,quoted_tweet:c,expanded_url:u,retweet_count:h,like_count:m,reply_count:g,impression_count:Y}=t,f=d&&d.length>0,b=c&&Object.keys(c).length>0;return(0,l.Y)(p.h2,{className:"twitter-embed tweet",width:"100%","data-component-name":"TweetToDOMStatic",style:{marginBottom:20,marginTop:20},children:(0,l.Y)("tbody",{children:(0,l.Y)("tr",{children:(0,l.Y)("td",{style:{padding:0},children:(0,l.Y)("a",{href:n,style:{textDecoration:"none",color:"inherit",display:"block"},children:(0,l.FD)(p.jJ,{gap:12,children:[(0,l.Y)(eH,{username:r,name:a,profile_image_url:o}),(0,l.Y)(eZ,{fullText:i}),f&&(0,l.Y)(eV,{photos:d}),!f&&!b&&null!=u&&(0,l.Y)(ej,{expandedUrl:u}),b&&(0,l.Y)(eK,{quotedTweet:c}),(0,l.Y)(eM,{date:s,replyCount:g,retweetCount:h,likeCount:m,impressionCount:Y})]})})})})})})}var e$=n(62765),eQ=n(65942);let e0=(e,t)=>{let{pub:n,props:{isStatic:i,post:r,dataForEmailRender:a}}=t;try{let t=e.getAttribute("data-attrs");if(t){let{mediaUploadId:e}=JSON.parse((0,eQ.A)(t));if(i){var o,s;return(0,l.Y)(e_,{pub:n,post:r,mediaUpload:null!=(s=null==(o=a.idToMediaUpload)?void 0:o[e])?s:null})}return(0,l.Y)(ey.i,{pub:n,post:r,mediaUploadId:e})}}catch(e){console.error("Failed to parse video:",e)}return(0,l.Y)(l.FK,{})},e1=(e,t)=>{let{pub:n,props:{isStatic:o,dataForEmailRender:s,useEnhancedVideoEmbed:d}}=t;try{let t=e.getAttribute("data-attrs");if(t){var c;let e=JSON.parse((0,eQ.A)(t)),u=null==s||null==(c=s.postIdToHeroVideo)?void 0:c[e.id],h=e.canonical_url,p="lg"===e.size;if(d&&o&&u&&h&&p)return(0,l.Y)(ev.b,{mediaUpload:u,href:h});return o?(0,l.Y)(B,(0,r._)((0,i._)({},e),{pub:n,isEditor:!1})):(0,l.Y)(a.S,(0,r._)((0,i._)({},e),{pub:n,isEditor:!1}))}}catch(e){console.error("Failed to parse digest post embed:",e)}return(0,l.Y)(l.FK,{})},e4=(e,t)=>{let{pub:n,props:{isStatic:a}}=t;try{let t=e.getAttribute("data-attrs"),o=JSON.parse((0,eQ.A)(t));return a?(0,l.Y)(ef.F,(0,r._)((0,i._)({},o),{pub:n})):(0,l.Y)(ef.P,(0,r._)((0,i._)({},o),{pub:n}))}catch(e){console.error("Failed to parse referrals card:",e)}return(0,l.Y)(l.FK,{})},e6=(e,t)=>{let{props:{isStatic:n}}=t;try{let t=e.getAttribute("data-attrs");if(t){var a;let o=null!=(a=JSON.parse(t))?a:{};return n?(0,l.Y)(ec,(0,r._)((0,i._)({},o),{captionHtml:e.innerHTML})):(0,l.Y)(ep,(0,r._)((0,i._)({},o),{captionHtml:e.innerHTML}))}}catch(e){console.error("Failed to parse image3:",e)}return(0,l.Y)(l.FK,{})},e2=(e,t)=>{let{pub:n,props:{isStatic:a,post:o,onLike:s}}=t;try{let t=e.getAttribute("data-attrs");if(t){let e=JSON.parse(t),d={node:{attrs:(0,r._)((0,i._)({},e),{isEditor:!1})}};return a?(0,l.Y)(eY.a9,(0,i._)({},d)):(0,l.Y)(eY.i_,(0,r._)((0,i._)({},d),{post:o,publication:n,onLike:s}))}}catch(e){console.error("Failed to parse image gallery embed:",e)}return(0,l.Y)(l.FK,{})},e8=(e,t)=>{let{props:{isStatic:n}}=t;try{let t=e.getAttribute("data-attrs");if(t){let e=JSON.parse(t),r=(0,i._)({},e);return n?(0,l.Y)(M,(0,i._)({},r)):(0,l.Y)(er,(0,i._)({},r))}}catch(e){console.error("Failed to parse direct message embed:",e)}return(0,l.Y)(l.FK,{})},e9=(e,t)=>{try{let i=JSON.parse((0,eQ.A)(e.getAttribute("data-attrs")));if(null==i?void 0:i.isEmail){var n;let e=null==(n=t.props.dataForEmailRender)?void 0:n.recipes[i.id];return(0,l.Y)("table",{className:"recipe-embed",width:"100%",cellPadding:"0",cellSpacing:"0",style:{marginBottom:20},children:(0,l.Y)("tbody",{children:(0,l.Y)("tr",{children:(0,l.Y)("td",{style:{padding:0},children:(0,l.Y)(eJ,{recipe:e})})})})})}return(0,l.Y)("div",{"data-attrs":e.getAttribute("data-attrs"),children:(0,l.Y)(eT.h5,{node:{attrs:{id:i.id}},post:t.props.post})})}catch(e){return console.warn("Failed to parse recipe:",e),(0,l.Y)(l.FK,{})}},e7=e=>{try{let t=JSON.parse((0,eQ.A)(e.getAttribute("data-attrs")));return(0,l.Y)(em.L,{attrs:t})}catch(e){console.error("Failed to parse pinterest:",e)}return(0,l.Y)(l.FK,{})},e5=(e,t)=>{try{let i=e.getAttribute("data-attrs");if(i){var n;let e=JSON.parse((0,eQ.A)(i));return(0,l.Y)(eg.t,{attrs:e,postId:null==(n=t.props.post)?void 0:n.id})}}catch(e){console.error("Failed to parse polymarket:",e)}return(0,l.Y)(l.FK,{})},e3=(e,t)=>{var n,i,r,a,o,s,d,c,u,h,p;let m=null!=(d=null==(i=t.props)||null==(n=i.post)?void 0:n.sponsorshipCampaigns)?d:null==(a=t.props)||null==(r=a.dataForEmailRender)?void 0:r.sponsorshipCampaigns;if(!m)return(0,l.Y)(l.FK,{});let g=e.getAttribute("data-attrs"),Y=m[JSON.parse((0,eQ.A)(g)).id];if(!Y||"active"!==Y.status)return(0,l.Y)(l.FK,{});let f=Y.exclude_audience_minimum;if("paid"===f&&!1===t.props.is_freemail||"paid"===f&&(null==(o=t.props.user)?void 0:o.is_subscribed)||"founding"===f&&(null==(s=t.props.user)?void 0:s.is_founding))return(0,l.Y)(l.FK,{});try{let n=JSON.parse((0,eQ.A)(e.getAttribute("data-attrs")));if(null==n?void 0:n.isEmail)return(0,l.Y)(eb._U,{campaign:Y,pub:t.pub,post:null!=(p=null==(u=t.props)?void 0:u.republishingPost)?p:null==(h=t.props)?void 0:h.post,placementId:n.campaignPostId});return(0,l.Y)(eb.eF,{dataAttrs:e.getAttribute("data-attrs"),pub:t.pub,campaign:Y,post:null==(c=t.props)?void 0:c.post,placementId:n.campaignPostId})}catch(e){return console.warn("Failed to parse sponsorship campaign:",e),(0,l.Y)(l.FK,{})}},te=(e,t)=>{try{let n=JSON.parse((0,eQ.A)(e.getAttribute("data-attrs")));if(n.isEmail)return(0,l.Y)(eo.O,(0,i._)({pub:t.pub},n));return(0,l.Y)(eo.u,(0,i._)({pub:t.pub,isEditor:!1},n))}catch(e){return console.warn("Failed to parse stories section:",e),(0,l.Y)(l.FK,{})}},tt=e=>{try{let t=e.getAttribute("data-attrs");if(!t)return(0,l.Y)(l.FK,{});let n=JSON.parse((0,eQ.A)(t));if(n.isEmail)return(0,l.Y)(eX,{attrs:n});return(0,l.Y)(e$.K,{attrs:n})}catch(e){return console.warn("Failed to parse tweet:",e),(0,l.Y)(l.FK,{})}},tn=(e,t)=>{let{props:{isStatic:n,dataForEmailRender:i}}=t;try{let t=e.getAttribute("data-attrs");if(!t)return(0,l.Y)(l.FK,{});let o=JSON.parse((0,eQ.A)(t)),s=e.textContent||"";if(n){var r,a;let e=o.nodeId?null==i||null==(a=i.idToHighlightedCodeBlock)||null==(r=a[o.nodeId])?void 0:r.highlightedHtml:void 0;return(0,l.Y)(eA,{code:s,highlightedHtml:e})}return(0,l.Y)(eE,{code:s,language:o.language})}catch(e){return console.warn("Failed to parse highlighted code block:",e),(0,l.Y)(l.FK,{})}}},47663:function(e,t,n){n.d(t,{J:()=>f,T:()=>Y});var i=n(4006),r=n(32485),l=n.n(r),a=n(12018),o=n(86938),s=n(74019),d=n(43327),c=n(33764),u=n(89490),h=n(76977),p=n(63136),m=n(11510),g=n(20004);let Y=e=>{var t,n,r;let{caption:d,disableLinks:Y,post:f,isEditingCaption:b,onEditCaption:y,onSaveCaption:v,onCancelCaption:_}=e,{publishedBylines:w,title:C,canonical_url:S,post_date:A,section_name:F,cover_image:N,cover_image_alt:E}=f,D=(0,m.Iu)();return(0,i.FD)(h.I1,{children:[F&&(0,i.Y)("a",{className:l()({[null!=(t=g.A.disableLink)?t:""]:Y}),href:S,rel:"noopener",target:"_blank",children:(0,i.Y)(p.EY.Meta,{color:"pub-primary-text",paddingBottom:8,children:F})}),(0,i.Y)("a",{className:l()({[null!=(n=g.A.disableLink)?n:""]:Y}),href:S,rel:"noopener",target:"_blank",children:(0,i.Y)(p.EY.H2,{color:"pub-primary-text",children:C})}),(0,i.Y)(s.W,{bylines:w,date:A,disableLinks:Y}),(0,i.FD)(h.pT,{direction:{mobile:"column",desktop:"row"},gap:16,paddingTop:16,children:[N&&(0,i.Y)(u.az,{style:{width:D?"unset":140},children:(0,i.Y)("a",{className:l()({[null!=(r=g.A.disableLink)?r:""]:Y}),href:S,rel:"noopener",target:"_blank",children:(0,i.Y)(c.o,{alt:null!=E?E:C,className:D?g.A.fullWidth:g.A.mdSquare,imageProps:{height:Math.round(D?1300:280),smartCrop:!0},maxWidth:D?1300:280,src:N})})}),(0,i.FD)(h.I1,{flex:"grow",children:[b&&v&&_?(0,i.Y)(a.y,{initialCaption:d,onCancel:_,onSave:v}):(0,i.Y)("p",{className:g.A.caption,dangerouslySetInnerHTML:{__html:d},onClick:null!=y?y:void 0}),(0,i.Y)(o.w,{disableLinks:Y,href:S,post:f})]})]})]})},f=e=>{let{post:t,children:n}=e;return(0,i.Y)(d.hx,{children:n,post:t})}},12988:function(e,t,n){n.d(t,{g:()=>g,w:()=>m});var i=n(4006),r=n(32485),l=n.n(r),a=n(86938),o=n(74019),s=n(33764),d=n(6049),c=n(89490),u=n(76977),h=n(63136),p=n(20004);let m=e=>{var t;let{post:n,disableLinks:r}=e,{publishedBylines:d,title:m,canonical_url:g,post_date:Y,cover_image:f,cover_image_alt:b}=n;return(0,i.Y)("a",{className:l()({[null!=(t=p.A.disableLink)?t:""]:r}),href:g,rel:"noopener",target:"_blank",children:(0,i.FD)(u.Ye,{gap:16,children:[f&&(0,i.Y)(c.az,{style:{width:70,height:70},children:(0,i.Y)(s.o,{alt:null!=b?b:m,className:p.A.smSquare,imageProps:{height:Math.round(140),smartCrop:!0},maxWidth:140,src:f})}),(0,i.FD)(u.I1,{children:[(0,i.Y)(h.EY.H4,{color:"pub-primary-text",children:m}),(0,i.Y)(o.W,{bylines:d,date:Y,disableLinks:r}),(0,i.Y)(a.w,{disableLinks:r,href:g,includeUfi:!1,post:n})]})]})})},g=e=>{let{post:t}=e,{publishedBylines:n,title:r,canonical_url:l,post_date:u,cover_image:m,cover_image_alt:g}=t;return(0,i.FD)(d.ZB,{gap:16,children:[m&&(0,i.Y)(c.az,{style:{width:70},children:(0,i.Y)("a",{href:l,children:(0,i.Y)(s.o,{alt:null!=g?g:r,className:p.A.smSquare,imageProps:{height:140,smartCrop:!0},maxWidth:140,src:m})})}),(0,i.FD)(d.jJ,{children:[(0,i.Y)(h.EY.H4,{color:"pub-primary-text",children:(0,i.Y)("a",{href:l,children:r})}),(0,i.Y)(o._,{bylines:n,date:u}),(0,i.Y)(a.s,{href:l})]})]})}},18999:function(e,t,n){n.d(t,{O:()=>F,u:()=>A});var i=n(4006),r=n(32485),l=n.n(r),a=n(80964),o=n(87332),s=n(69308),d=n(92919),c=n(65892),u=n(17402),h=n(81704),p=n(13950),m=n(33764),g=n(15894),Y=n(6049),f=n(35369),b=n(76977),y=n(45859),v=n(16993),_=n(63136),w=n(39318),C=n(31933),S=n(96473);let A=e=>{let{title:t,postIds:n,showCount:r,posts:Y,pub:w,isEditor:A,updateAttributes:F,align:N}=e,[E,D]=(0,u.useState)(Y||[]),[k,I]=(0,u.useState)(!Y&&!A),[x,T]=(0,u.useState)(!1),[R,B]=(0,u.useState)(t),[P,L]=(0,u.useState)(!1),[O,U]=(0,u.useState)(null),[J,z]=(0,u.useState)(0),[M,W]=(0,u.useState)(!1),[H,j]=(0,u.useState)(""),G=(0,u.useRef)(null),V=e=>{if(null===O)return;let t=[...E];Oe.id)}),L(!1),U(null),$()},{searchQuery:K,searchResults:q,isSearching:Z,handleSearch:X,clearSearch:$,getLatestPostsByTag:Q,fetchAvailableTags:ee,availableTags:et}=(0,h.E)({pubId:w.id,onSelectPost:V});(0,u.useEffect)(()=>{let e=!1;return(async()=>{if(!Y||(null==n?void 0:n.length)===0||A&&0===E.length&&!(null==n?void 0:n.length)){A||I(!0);try{let t=await (0,C.tZ)((null==n?void 0:n.length)>0?n:void 0);if(e)return;let i=t.slice(0,r);D(i),F&&F({posts:i,postIds:i.map(e=>e.id)})}catch(t){e||console.error("Error fetching posts:",t)}finally{e||I(!1)}}})(),()=>{e=!0}},[n,r,Y,F,A,E.length]),(0,u.useEffect)(()=>{x&&G.current&&(G.current.focus(),G.current.select())},[x]);let en=()=>{F&&F({title:R}),T(!1)},ei=E.slice(0,r),er=async(e,t)=>{let n=await Q(e);if(n.length>0){let e=n.slice(0,r);D(e),F&&F({title:t,posts:e,postIds:e.map(e=>e.id)}),B(t)}W(!1),j("")},el=async()=>{await ee(),W(!0),j("")};return(0,i.FD)(i.FK,{children:[(0,i.Y)("div",{className:"the-free-press-theme",children:(0,i.Y)(p.DH,{children:(0,i.FD)("div",{className:l()(S.A.fpRecircBlock,A?S.A.editor:"","left"===N&&S.A.alignLeft,"right"===N&&S.A.alignRight),"data-component-name":"FpRecircBlock",children:[(0,i.FD)(b.pT,{justifyContent:"space-between",alignItems:"center",style:{marginBottom:24},className:S.A.header,children:[x&&A?(0,i.Y)("input",{ref:G,type:"text",value:R,onChange:e=>B(e.target.value),onBlur:en,onKeyDown:e=>{"Enter"===e.key&&en(),"Escape"===e.key&&(B(t),T(!1))},className:S.A.titleInput}):(0,i.Y)("div",{className:l()(S.A.sectionTitle,A?S.A.editable:""),onClick:A?()=>T(!0):void 0,children:(0,i.Y)(g.T,{preset:"body",children:(0,i.Y)("span",{style:{fontWeight:700},children:t})})}),A&&(0,i.FD)(y.W1,{trigger:(0,i.Y)(f.K0,{size:"sm",priority:"tertiary",className:S.A.settingsButton,children:(0,i.Y)(a.A,{})}),children:[(0,i.FD)(y.H9,{title:"Count",isFirst:!0,children:[(0,i.Y)(y.Dr,{onClick:()=>null==F?void 0:F({showCount:3}),priority:3===r?"accent":"secondary",children:"Show 3 stories"}),(0,i.Y)(y.Dr,{onClick:()=>null==F?void 0:F({showCount:4}),priority:4===r?"accent":"secondary",children:"Show 4 stories"})]}),(0,i.Y)(y.H9,{title:"Populate",children:(0,i.Y)(y.Dr,{onClick:()=>el(),priority:"secondary",children:"Populate by tag"})}),(0,i.FD)(y.H9,{title:"Alignment",children:[(0,i.Y)(y.Dr,{onClick:()=>null==F?void 0:F({align:null}),priority:N?"secondary":"accent",leading:(0,i.Y)(o.A,{}),children:"Center"}),(0,i.Y)(y.Dr,{onClick:()=>null==F?void 0:F({align:"left"}),priority:"left"===N?"accent":"secondary",leading:(0,i.Y)(s.A,{}),children:"Float left"}),(0,i.Y)(y.Dr,{onClick:()=>null==F?void 0:F({align:"right"}),priority:"right"===N?"accent":"secondary",leading:(0,i.Y)(d.A,{}),children:"Float right"})]})]})]}),k&&!A?(0,i.Y)("div",{className:S.A.loading,children:"Loading posts..."}):(0,i.Y)(i.FK,{children:ei.length>0&&(0,i.Y)(b.pT,{direction:"column",gap:16,children:ei.map((e,t)=>(0,i.Y)("div",{className:S.A.postWrapper,children:(0,i.FD)("a",{href:A?"#":e.canonical_url,className:S.A.postCard,onClick:A?e=>e.preventDefault():void 0,children:[(0,i.FD)(b.pT,{gap:12,children:[(0,i.Y)("div",{className:S.A.imageWrapper,children:e.cover_image?(0,i.Y)(m.o,{className:S.A.postImage,imageIsFixedWidth:!0,maxWidth:300,src:e.cover_image,useRetinaSizing:!0}):(0,i.Y)("div",{className:S.A.imagePlaceholder})}),(0,i.FD)(b.pT,{direction:"column",justifyContent:"center",gap:8,className:S.A.postContent,children:[(0,i.Y)(g.T,{preset:"lg-preview-byline",className:S.A.postTitle,children:e.title}),e.author_names&&e.author_names.length>0&&(0,i.Y)(g.T,{preset:"detail-small",color:"accent",className:S.A.postAuthor,children:e.author_names.join(", ")})]})]}),A&&(0,i.Y)("div",{className:S.A.editButtonContainer,children:(0,i.Y)(f.K0,{priority:"primary-mono",size:"sm",onClick:e=>{e.preventDefault(),e.stopPropagation(),U(t),L(!0),z(0),$()},children:(0,i.Y)(c.A,{size:16})})})]})},"post-".concat(e.id)))})})]})})}),(0,i.Y)(v.aF,{isOpen:P,onClose:()=>{L(!1),U(null),$()},className:S.A.modalContainer,children:(0,i.Y)("div",{className:"the-free-press-theme",children:(0,i.Y)(p.DH,{children:(0,i.FD)("div",{className:S.A.searchModal,children:[(0,i.Y)("div",{className:S.A.searchModalTitle,children:"Search Posts"}),(0,i.Y)("input",{type:"text",placeholder:"Search posts...",value:K,onChange:e=>{X(e.target.value),z(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),z(e=>Math.min(e+1,q.length-1))):"ArrowUp"===e.key?(e.preventDefault(),z(e=>Math.max(e-1,0))):"Enter"===e.key&&q.length>0&&q[J]&&(e.preventDefault(),V(q[J]))},className:S.A.searchModalInput,autoFocus:!0}),(0,i.FD)("div",{className:S.A.searchModalResults,children:[Z&&(0,i.Y)("div",{className:S.A.loading,children:(0,i.Y)(_.EY,{color:"secondary",children:"Searching..."})}),!Z&&q.map((e,t)=>(0,i.Y)("div",{className:l()(S.A.postWrapper,t===J&&S.A.selected),onClick:()=>V(e),role:"option","aria-selected":t===J,children:(0,i.Y)("a",{href:"#",className:S.A.postCard,onClick:e=>e.preventDefault(),children:(0,i.FD)(b.pT,{gap:12,children:[(0,i.Y)("div",{className:S.A.imageWrapper,children:e.cover_image?(0,i.Y)(m.o,{className:S.A.postImage,imageIsFixedWidth:!0,maxWidth:300,src:e.cover_image,useRetinaSizing:!0}):(0,i.Y)("div",{className:S.A.imagePlaceholder})}),(0,i.FD)(b.pT,{direction:"column",justifyContent:"center",gap:8,className:S.A.postContent,children:[(0,i.Y)(g.T,{preset:"lg-preview-byline",className:S.A.postTitle,children:e.title}),e.author_names&&e.author_names.length>0&&(0,i.Y)(g.T,{preset:"detail-small",color:"accent",className:S.A.postAuthor,children:e.author_names.join(", ")})]})]})})},e.id)),!Z&&K&&0===q.length&&(0,i.Y)("div",{className:S.A.noResults,children:(0,i.Y)(_.EY,{color:"secondary",children:"No posts found"})})]})]})})})}),(0,i.Y)(v.aF,{isOpen:M,onClose:()=>{W(!1),j("")},className:S.A.modalContainer,children:(0,i.Y)("div",{className:"the-free-press-theme",children:(0,i.Y)(p.DH,{children:(0,i.FD)("div",{className:S.A.searchModal,children:[(0,i.Y)("div",{className:S.A.searchModalTitle,children:"Select Tag"}),(0,i.Y)("input",{type:"text",placeholder:"Search tags...",value:H,onChange:e=>j(e.target.value),className:S.A.searchModalInput,autoFocus:!0}),(0,i.FD)("div",{className:S.A.searchModalResults,style:{maxHeight:"400px",overflowY:"auto"},children:[0===et.length?(0,i.Y)("div",{className:S.A.loading,children:(0,i.Y)(_.EY,{color:"secondary",children:"No tags available"})}):et.filter(e=>e.name.toLowerCase().includes(H.toLowerCase())||e.slug.toLowerCase().includes(H.toLowerCase())).map(e=>(0,i.Y)("div",{className:S.A.postWrapper,onClick:()=>er(e.id,e.name),role:"option",style:{cursor:"pointer",padding:"12px"},children:(0,i.Y)(_.EY,{children:e.name})},e.id)),0===et.filter(e=>e.name.toLowerCase().includes(H.toLowerCase())||e.slug.toLowerCase().includes(H.toLowerCase())).length&&H&&(0,i.Y)("div",{className:S.A.noResults,children:(0,i.Y)(_.EY,{color:"secondary",children:"No matching tags found"})})]})]})})})})]})},F=e=>{let{title:t,posts:n,showCount:r,pub:l,postIds:a}=e;if(!n||0===n.length)return a&&a.length>0?(0,i.Y)("div",{className:S.A.fpRecircBlockEmail,"data-component-name":"FpRecircBlockEmail",children:(0,i.FD)(Y.jJ,{gap:24,style:{width:"100%"},children:[(0,i.Y)("h3",{className:S.A.sectionTitleEmail,children:t}),(0,i.FD)(_.EY,{size:14,color:"secondary",children:["FP Recirc block with ",a.length," posts"]})]})}):(0,i.Y)("div",{className:S.A.fpRecircBlockEmail,"data-component-name":"FpRecircBlockEmail",children:(0,i.FD)(Y.jJ,{gap:24,style:{width:"100%"},children:[(0,i.Y)("h3",{className:S.A.sectionTitleEmail,children:t}),(0,i.Y)(_.EY,{size:14,color:"secondary",children:"No stories available"})]})});let o=n.slice(0,r);return(0,i.Y)("div",{className:S.A.fpRecircBlockEmail,"data-component-name":"FpRecircBlockEmail",children:(0,i.FD)(Y.jJ,{gap:24,style:{width:"100%"},children:[(0,i.Y)("h3",{className:S.A.sectionTitleEmail,children:t}),(0,i.Y)(Y.jJ,{gap:16,children:o.map(e=>(0,i.Y)("a",{href:e.canonical_url,className:S.A.emailLink,children:(0,i.FD)(Y.ZB,{gap:12,verticalAlign:"middle",children:[(0,i.Y)("div",{className:S.A.imageWrapperEmail,children:e.cover_image?(0,i.Y)("img",{src:(0,w.dJ9)(e.cover_image,400),alt:e.title,className:S.A.postImageEmail}):(0,i.Y)("div",{className:S.A.imagePlaceholderEmail})}),(0,i.FD)("div",{children:[(0,i.Y)("div",{className:S.A.postTitleEmail,children:e.title}),e.author_names&&e.author_names.length>0&&(0,i.Y)("div",{className:S.A.postAuthorEmail,children:e.author_names.join(", ")})]})]})},e.id))})]})})}},64998:function(e,t,n){n.d(t,{Uf:()=>x,a1:()=>R,sP:()=>T});var i=n(79785),r=n(4006),l=n(32485),a=n.n(l),o=n(82853),s=n(98188),d=n(17402),c=n(18203),u=n(48329),h=n(39232),p=n(15469),m=n(39469),g=n(31245),Y=n(60294),f=n(49386),b=n(66710),y=n(17744),v=n(84605),_=n(25006),w=n(46271),C=n(6049),S=n(68349),A=n(76977),F=n(63136),N=n(36372),E=n(16291),D=n(4016),k=n(39318);function I(){let e=(0,i._)(["Option ",""]);return I=function(){return e},e}let x=(e,t)=>{let{iTemplate:n}=I18N.i(t);return n(I(),e+1)},T=e=>{var t,n;let{id:i,isEditor:l,post:C,isVersionView:I}=e,{iString:T,language:R}=(0,v.GO)(),B=(0,_.df)(),P=(0,N.d)(),L=(0,y.m)(),O=(0,D.lu)({pub:B}),U=(0,w.Jd)()||{},[J,z]=(0,d.useState)(!1),[M,W]=(0,d.useState)(!1),[H,j]=(0,d.useState)(!1),G=(0,d.useCallback)(()=>{z(!1)},[]),{error:V,loading:K,poll:q,savePoll:Z,voteForOption:X}=(0,g.j)({isEditor:l,isVersionView:!!I,pollId:i,post:C,onFinishSaving:G}),$=!!(null==q?void 0:q.is_published),Q=q&&q.published_at&&(0,E.A)(q.published_at).add(q.expiry,"hour"),ee=(0,E.A)(),et=!!$&&!!Q&&Q.isBefore(ee),en=Q?Q.diff(ee,"hour"):0,ei=l&&((null==q?void 0:q.post_type)!=="adhoc_email"||!$),er=!!q&&q.options.some(e=>e.my_vote),el=(null==q?void 0:q.audience)==="only_paid"?!!U.is_subscribed:!!(U.is_free_subscribed||L),ea=!er&&$&&!et&&el&&(!l||(null==q?void 0:q.post_type)==="adhoc_email"),eo=l?null:"".concat((0,k.wu9)(B,C),"#poll-").concat(i),es=ei?Array(Math.max(2,(null==q||null==(t=q.options)?void 0:t.length)||0)).fill("").map((e,t)=>{var n,i,r;return q&&(null==(n=q.options)?void 0:n.length)>t?null!=(r=null==(i=q.options[t])?void 0:i.label)?r:"":x(t,R)}):null==q||null==(n=q.options)?void 0:n.map(e=>e.label),ed=(0,d.useCallback)(async e=>{if(!l&&!et&&$){if(!el)return void j(!0);await X(e)}},[el,l,et,$,X]);return null===V||q?(0,r.FD)(A.I1,{className:a()("poll-wrapper poll-web",{"poll-wrapper--thefp":O}),"data-component-name":"Poll",gap:24,children:[eo&&(0,r.Y)("div",{className:"poll-anchor-target",id:"poll-".concat(i),children:(0,r.Y)("div",{className:"poll-anchor-copy-button",onClick:e=>{var t;(null==(t=location)?void 0:t.href)&&(e.preventDefault(),(0,S.lW)(eo),P.popToast(()=>(0,r.Y)(N.y,{Icon:o.A,text:T("Copied link to clipboard")})))},children:(0,r.Y)("a",{href:eo,children:(0,r.Y)(o.A,{size:20})})})}),ei&&q&&(0,r.Y)(c.z,{isOpen:J,isPublished:$,poll:q,shouldShowAudiencePicker:"adhoc_email"!==q.post_type,onClose:()=>{z(!1)},onSave:Z}),!l&&q&&B&&(0,r.Y)(h.u,{audience:q.audience,isOpen:H,pollId:q.id,post:C,pub:B,user:U,onClose:()=>j(!1)}),K?(0,r.Y)(A.I1,{alignItems:"center",gap:8,justifyContent:"center",paddingY:48,children:(0,r.Y)(F.EY.Meta,{translated:!0,children:"Loading..."})}):(0,r.FD)(r.FK,{children:[ei&&(0,r.Y)("button",{className:"poll-edit",disabled:K,onClick:()=>{z(!0)},children:(0,r.Y)(s.A,{height:20})}),O?(0,r.Y)(Y.D,{poll:q}):(0,r.Y)(u.f,{poll:q}),null!==V&&(0,r.Y)("div",{className:"poll-error",children:V}),(0,r.Y)(A.I1,{className:a()("poll-options",{"no-margins":!$}),gap:O?16:12,children:es&&es.map((e,t)=>{var n,i,l,a,o,s;return O?(0,r.Y)(b.H,{currentVotes:(null==q||null==(n=q.options[t])?void 0:n.votes)||0,hasVoted:er,id:(null==q||null==(i=q.options[t])?void 0:i.id)||null,index:t,myVote:(null==q||null==(l=q.options[t])?void 0:l.my_vote)||!1,showVotes:er||et||!!(U.is_contributor||U.is_admin||U.is_author)&&M,text:e,totalVotes:(null==q?void 0:q.total_votes)||0,onVote:ed}):(0,r.Y)(m.h,{canVote:ea,currentVotes:(null==q||null==(a=q.options[t])?void 0:a.votes)||0,id:(null==q||null==(o=q.options[t])?void 0:o.id)||null,myVote:(null==q||null==(s=q.options[t])?void 0:s.my_vote)||!1,showVotes:er||et||!!(U.is_contributor||U.is_admin||U.is_author)&&M,text:e,totalVotes:(null==q?void 0:q.total_votes)||0,onVote:ed})})}),$&&q&&(O?(0,r.Y)(f.h,{hasVoted:er,poll:q,user:U}):(0,r.Y)(p.r,{hasVoted:er,isExpired:et,poll:q,remainingHours:en,showResults:M,user:U,onToggleShowResults:()=>{W(!M)}}))]})]}):(0,r.Y)("div",{className:"poll-wrapper poll-web",children:(0,r.Y)("div",{className:"poll-error",children:V})})},R=e=>{let{id:t,embeddedPolls:n,pub:i}=e,l=n.find(e=>e.id===t),{iString:o,language:s}=(0,v.GO)(),d=(0,D.lu)({pub:i});return l?(0,r.Y)(C.h2,{className:a()("poll-email-wrapper",{"poll-email-wrapper--thefp":d}),"data-component-name":"StaticPoll",children:(0,r.Y)("tr",{children:(0,r.Y)("td",{children:(0,r.FD)(C.h2,{width:"100%",children:[!d&&(0,r.Y)("tr",{children:(0,r.Y)("td",{className:"poll-header",children:o((null==l?void 0:l.audience)==="only_paid"?"SUBSCRIBER-ONLY POLL":"POLL")})}),(0,r.Y)("tr",{className:"poll-question",width:"100%",children:(0,r.Y)("td",{children:l.question||o("New Poll")})}),l.description&&(0,r.Y)("tr",{className:"poll-description",width:"100%",children:(0,r.Y)("td",{children:l.description})}),(0,r.Y)("tr",{children:(0,r.Y)("td",{children:(0,r.Y)(C.h2,{className:"poll-options",width:"100%",children:l.options.map((e,t)=>{let{label:n,id:i}=e;return(0,r.Y)("tr",{children:(0,r.Y)("td",{className:"poll-option",width:"100%",children:(0,r.Y)("a",{className:"poll-vote-link",href:"%%poll_vote_option_".concat(i,"_url%%"),width:"100%",children:(0,r.Y)("div",{className:"poll-vote-contents",children:n||x(t,s)})})})})})})})})]})})})}):(0,r.Y)("table",{className:"poll-wrapper","data-component-name":"StaticPollError",children:o("Something went wrong.")})}},64099:function(e,t,n){n.d(t,{A:()=>f});var i=n(4006),r=n(32485),l=n.n(r),a=n(82853),o=n(17402),s=n(13950),d=n(8609),c=n(86500),u=n(72569),h=n(89490),p=n(35369),m=n(76977),g=n(58278),Y=n(39318);function f(e){let{text:t,post:n,pub:r,offsetTop:f,isAboutPage:b}=e,y=(0,o.useContext)(d.a),{isStatic:v}=null!=y?y:{isStatic:!1},_=(0,u.c)(),w=(0,g.HN)(t,(null==n?void 0:n.id)||0);if(!n&&!b||!r||v)return null;let C=b?"".concat((0,Y.DNs)(r,{addBase:!0}),"#\xa7").concat(w):"".concat((0,Y.$_T)(r),"/i/").concat(null==n?void 0:n.id,"/").concat(w);return(0,i.Y)(m.pT,{position:"absolute",alignItems:"center",className:"header-anchor-parent",children:(0,i.FD)(s.DH,{children:[(0,i.Y)(h.az,{className:l()("header-anchor",{"offset-top":f}),id:"\xa7".concat(w)}),(0,i.Y)(p.K0,{priority:"secondary",rounded:!1,size:"sm",onClick:e=>{var t;(null==(t=location)?void 0:t.href)&&(e.preventDefault(),(0,c.u4)(c.qY.HEADER_ANCHOR_WIDGET_CLICKED,{destination:C}),_(C))},href:C,children:(0,i.Y)(a.A,{size:18})})]})})}},73040:function(e,t,n){n.d(t,{A:()=>s});var i=n(69277),r=n(70408),l=n(4006),a=n(822),o=n(97731);let s=e=>(0,l.Y)(o.A,(0,r._)((0,i._)({},e),{name:"LucideCornerDownRight",svgParams:{height:24,width:24,fill:"#000000",strokeWidth:0},children:(0,l.Y)(a.A,{height:24,stroke:e.stroke,fill:e.fill,strokeWidth:e.strokeWidth})}))},43427:function(e,t,n){n.d(t,{A:()=>s});var i=n(69277),r=n(70408),l=n(4006),a=n(23345),o=n(97731);let s=e=>(0,l.Y)(o.A,(0,r._)((0,i._)({},e),{name:"LucideHeart",svgParams:{height:24,width:24,fill:"#000000",strokeWidth:0},children:(0,l.Y)(a.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),l=n(32641),a=n(4006),o=n(97731);let s=e=>{var{size:t=24,color:n="var(--color-fg-primary)",className:s}=e,d=(0,l._)(e,["size","color","className"]);return(0,a.Y)(o.A,(0,r._)((0,i._)({},d),{name:"SkinnyUnlockIcon",svgParams:{viewBox:"0 0 24 24"},stroke:"none",width:t,height:t,fill:n,className:s,children:(0,a.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:()=>I});var i=n(69277),r=n(79785),l=n(4006),a=n(12215),o=n(17402),s=n(58398),d=n(84605),c=n(85478),u=n(86500),h=n(1459),p=n(68349),m=n(35369),g=n(76977),Y=n(16993),f=n(84843),b=n(67958),y=n(63136),v=n(16291),_=n(28194),w=n(91392),C=n(49807),S=n(82776),A=n(57324);function F(){let e=(0,r._)(["Support ",""]);return F=function(){return e},e}function N(){let e=(0,r._)(["Since you liked this post, why not support "," with a subscription?"]);return N=function(){return e},e}let E=w.FI.LIKE_UPSELL_LAST_SHOWN_AT;function D(e){var t,n;let{isOpen:r,onClose:a,pub:s}=e,{iString:h,iTemplate:v}=(0,d.GO)(),w=(0,c.mJ)(),[E,D]=(0,o.useState)(null==s||null==(t=s.plans)?void 0:t[0]),k=w.getConfigFor("disable_monthly_subscriptions"),I=w.getConfigFor("disable_annual_subscriptions");return(0,l.FD)(Y.aF,{isOpen:r,onClose:a,children:[(0,l.Y)(f.rQ,{title:v(F(),s.name),description:v(N(),s.name),onClose:a}),(0,l.Y)(Y.cw,{children:(0,l.Y)(b.z,{name:"plan",value:E?String(E.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&&D(n)},children:null==s||null==(n=s.plans)?void 0:n.map(e=>{if("month"===e.interval&&k||"year"===e.interval&&I)return null;let t=E&&E.id===e.id;return(0,l.FD)(g.fI,{as:"label",alignItems:"center",gap:12,cursor:"pointer",userSelect:"none",children:[(0,l.Y)(b.s,{value:String(e.id)}),(0,l.Y)(y.EY.B4,{as:"span",weight:"semibold",color:t?"primary":"secondary",children:(0,S.getPlanTitle)(e,s.language)}),(0,l.Y)(y.EY.B4,{as:"span",color:"secondary",children:(0,_.xB)(e)})]},e.id)})})}),(0,l.Y)(Y.jl,{direction:"column",primaryButton:(0,l.Y)(m.$n,{onClick:()=>{(0,u.u4)(u.qY.LIKE_UPSELL_PLAN_SELECTED),(0,p.V2)((0,C.eV6)(s,{params:(0,i._)({utm_source:A.VU.likeButtonUpsell},E&&{selectedPlanId:E.id})}),{local_navigation:!1})},children:h("Select")})})]})}function k(e){let{isOpen:t,onClose:n,onShareClick:i}=e,{iString:r}=(0,d.GO)();return(0,l.FD)(Y.aF,{isOpen:t,onClose:n,children:[(0,l.Y)(f.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,l.Y)(Y.q1,{}),(0,l.Y)(Y.jl,{direction:"column",primaryButton:(0,l.Y)(m.$n,{onClick:()=>{(0,u.u4)(u.qY.LIKE_UPSELL_SHARE_CLICKED),i(),n()},children:r("Share")})})]})}function I(e){let{user:t,pub:n,post:r}=e,[d,c]=(0,o.useState)(!1),m=(()=>{let e=a.get(E);if(e){let t=(0,v.A)(e),n=(0,v.A)().subtract(30,"days");if(t.isAfter(n))return!1}return!0})(),[g,Y]=(0,o.useState)(m);(0,o.useEffect)(()=>{(!m||(null==t?void 0:t.is_contributor)||(null==t?void 0:t.is_admin))&&(0,p.qm)("show_reaction_upsell")},[m,t]),(0,o.useEffect)(()=>{m&&g&&t&&((0,u.u4)(u.qY.LIKE_UPSELL_MODAL_SEEN,{source:"email",type:(0,h.e)(t,n)?"share":"paid"}),a.set(E,(0,v.A)().format(),(0,i._)({expires:3650},!n.custom_domain&&{domain:".".concat(new URL((0,C.$_T)()).hostname)})))},[m,g,n,t]);let f=()=>{Y(!1),(0,p.qm)("show_reaction_upsell")};return t&&!t.is_contributor&&!t.is_admin&&(m||d)?(0,l.FD)(l.FK,{children:[(0,h.e)(t,n)?(0,l.Y)(k,{isOpen:g,onClose:f,onShareClick:()=>c(!0)}):(0,l.Y)(D,{isOpen:g,onClose:f,pub:n}),(0,l.Y)(s.Z,{isOpen:d,medium:"web",pub:n,user:t,post:r,onClose:()=>c(!1)})]}):null}},21471:function(e,t,n){n.d(t,{F:()=>y,P:()=>b});var i=n(4006),r=n(17402),l=n(15734),a=n.n(l),o=n(18468),s=n(84605),d=n(6049),c=n(76977),u=n(45974),h=n(63136),p=n(98111),m=n(47851),g=n(39318),Y=n(57324),f=n(86972);let b=e=>{let{tierNumber:t,rewardDescription:n,numReferralsRequired:l,pub:d}=e,[p,Y]=(0,r.useState)([]),f=async()=>{let{body:e}=await a().get("/api/v1/reader_referrals/tiers");Y(e.tiers)},{iString:b}=(0,s.GO)();if((0,r.useEffect)(()=>{f()},[]),!t||!d.id)return(0,i.Y)("div",{"data-component-name":"ReferralsTierCardError"});let y=p[t-1],v=y?"custom"===y.reward_type?y.reward_description:b(m.mn[y.reward_type]):n,_=y?y.num_referrals_required:l;return _?(0,i.FD)(c.I1,{"data-component-name":"ReferralsTierCard",className:"milestone-tier-card",justifyContent:"start",border:"detail-themed",radius:"md",padding:20,gap:16,children:[(0,i.Y)("div",{className:"tier-stars-container",children:Array(t).fill(0).map((e,t)=>(0,i.Y)(o.A,{width:20,height:20,strokeWidth:2,stroke:d.theme_var_background_pop||"#FF6719",fill:d.theme_var_background_pop||"#FF6719"},t))}),(0,i.FD)(c.I1,{gap:4,children:[(0,i.Y)(h.EY.H4,{children:v}),(0,i.FD)(h.EY.Meta,{translated:!0,children:["Tier ",I18N.p(t)," reward - ",I18N.p(_)," Referrals"]})]}),(0,i.FD)(c.Ye,{alignItems:"center",children:[(0,i.Y)(u.Nq,{pub:d,size:24}),(0,i.Y)(h.EY.Meta,{color:"primary",as:"a",href:(0,g.$_T)(d),decoration:"none",weight:"bold",children:d.name})]})]}):(0,i.Y)("div",{"data-component-name":"ReferralsTierCardError"})},y=e=>{let{tierNumber:t,pub:n}=e;return t&&n.id?(0,i.Y)("a",{href:"".concat(p.T.LEADERBOARD_URL,"&utm_source=").concat(Y.VU.rewardEmail),className:f.A.referralsTierCard,children:(0,i.FD)(d.jJ,{gap:16,children:[(0,i.Y)(d.ZB,{style:{lineHeight:0},gap:4,children:Array(t).fill(0).map((e,t)=>(0,i.Y)(o.A,{width:20,height:20,strokeWidth:2,stroke:n.theme_var_background_pop||"#FF6719",fill:n.theme_var_background_pop||"#FF6719",isStatic:!0},t))}),(0,i.FD)(d.jJ,{gap:4,children:[(0,i.Y)(h.EY.H4,{children:p.T.REWARD_DESCRIPTION}),(0,i.FD)(h.EY.Meta,{translated:!0,children:["Tier ",I18N.p(t)," reward - ",I18N.p(p.T.NUM_REFERRALS_REQUIRED)," Referrals"]})]}),(0,i.FD)(d.ZB,{verticalAlign:"middle",children:[(0,i.Y)(u.VZ,{pub:n,size:24}),(0,i.Y)(h.EY.Meta,{color:"primary",as:"a",href:(0,g.$_T)(n),decoration:"none",weight:"bold",children:n.name})]})]})}):(0,i.Y)("div",{})}},54515:function(e,t,n){n.d(t,{_U:()=>S,eF:()=>C});var i=n(4006),r=n(32485),l=n.n(r),a=n(97213),o=n(56778),s=n(44909),d=n(46271),c=n(6049),u=n(63136),h=n(66511),p=n(98111),m=n(4016),g=n(82455),Y=n(39318),f=n(92636),b=n(49807),y=n(86508),v=n(8242);let _=async(e,t,n)=>{try{await fetch("/api/v1/sponsorship-campaigns/".concat(e,"/track-post-view"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({postId:t,currentUrl:window.location.href,currentReferrer:document.referrer,placementId:n})})}catch(e){console.error("Failed to track sponsorship campaign post view:",e)}};function w(e,t){let n=(0,m.lu)({pub:t})&&"doc"===e.campaign_type;return{useFPThirdPartyStyling:n&&"third_party"===e.campaign_source,useFPHouseStyling:n&&"first_party"===e.campaign_source}}let C=e=>{var t;let{campaign:n,pub:r,isEditor:a,dataAttrs:o,post:s,placementId:d}=e,{useFPThirdPartyStyling:c,useFPHouseStyling:u}=w(n,r);return(0,i.FD)("div",{className:l()("sponsorship-campaign-embed",{"sponsorship-campaign-embed-structured":"structured"===n.campaign_type,"sponsorship-campaign-embed-third-party":c,"sponsorship-campaign-embed-first-party":u,[null!=(t=v.A.editorBorder)?t:""]:a}),dataAttrs:o,children:[!a&&c&&(0,i.Y)("div",{className:"sponsorshipCampaignAdvertisementLabel",children:"ADVERTISEMENT"}),!a&&u&&(0,i.FD)("div",{className:"sponsorshipCampaignStarSeparator",children:[(0,i.Y)("div",{className:"sponsorshipCampaignStarSeparatorBorder"}),(0,i.Y)("img",{alt:"",src:(0,b.dJ9)("".concat((0,f.Ew)(),"/img/thefp/fp-stars.svg"),156),width:78,height:16}),(0,i.Y)("div",{className:"sponsorshipCampaignStarSeparatorBorder"})]}),"structured"===n.campaign_type?(0,i.Y)(A,{campaign:n,pub:r,isEditor:a,post:s,placementId:d}):(0,i.Y)(E,{campaign:n,pub:r,isEditor:a,post:s,placementId:d}),!a&&u&&(0,i.FD)("div",{className:"sponsorshipCampaignStarSeparator",children:[(0,i.Y)("div",{className:"sponsorshipCampaignStarSeparatorBorder"}),(0,i.Y)("img",{alt:"",src:(0,b.dJ9)("".concat((0,f.Ew)(),"/img/thefp/fp-stars.svg"),156),width:78,height:16}),(0,i.Y)("div",{className:"sponsorshipCampaignStarSeparatorBorder"})]})]})},S=e=>{let{campaign:t,pub:n,post:r,placementId:a}=e,{useFPThirdPartyStyling:o,useFPHouseStyling:s}=w(t,n);return(0,i.Y)("table",{className:l()("sponsorship-campaign-embed",{"sponsorship-campaign-embed-third-party":o,"sponsorship-campaign-embed-first-party":s}),width:"100%",children:(0,i.FD)("tbody",{children:[o&&(0,i.Y)("tr",{children:(0,i.Y)("td",{className:"sponsorshipCampaignAdvertisementLabel",children:"ADVERTISEMENT"})}),s?(0,i.Y)("tr",{children:(0,i.FD)("td",{className:"sponsorshipCampaignFirstPartyEmailWrapper",children:[(0,i.Y)("div",{className:"sponsorshipCampaignStarSeparatorText",children:(0,i.Y)("img",{alt:"",src:(0,b.dJ9)("".concat((0,f.Ew)(),"/img/thefp/fp-stars.svg"),156),width:78,height:16,style:{display:"inline"}})}),"structured"===t.campaign_type?(0,i.Y)(F,{campaign:t,pub:n,post:r,placementId:a}):(0,i.Y)(D,{campaign:t,pub:n,post:r,placementId:a}),(0,i.Y)("div",{className:"sponsorshipCampaignStarSeparatorText",children:(0,i.Y)("img",{alt:"",src:(0,b.dJ9)("".concat((0,f.Ew)(),"/img/thefp/fp-stars.svg"),156),width:78,height:16,style:{display:"inline"}})})]})}):(0,i.Y)("tr",{children:(0,i.Y)("td",{children:"structured"===t.campaign_type?(0,i.Y)(F,{campaign:t,pub:n,post:r,placementId:a}):(0,i.Y)(D,{campaign:t,pub:n,post:r,placementId:a})})})]})})},A=e=>{var t,n,r;let{campaign:l,pub:c,isEditor:p,post:m,placementId:g}=e,f=(0,d.Jd)(),{scrollContainerRef:y}=(0,s.o)(),w=(0,i.FD)("a",{className:"sponsorshipCampaignContainer",href:p?"#":(0,Y.qCG)({campaignId:l.id,medium:"web",pubId:null!=(t=null==c?void 0:c.id)?t:0,userId:null==f?void 0:f.id,postId:null==m?void 0:m.id,referrer:"undefined"!=typeof window?window.location.href:void 0,placementId:g}),children:[l.short_text&&(0,i.Y)("span",{className:"sponsorshipCampaignPresentedBy",children:l.short_text}),l.image_url&&(0,i.Y)("div",{className:"sponsorshipCampaignImageContainer",children:(0,i.Y)("img",{alt:null!=(n=l.image_alt_text)?n:"",className:"sponsorshipCampaignImage",src:(0,b.dJ9)(l.image_url,300)})})]});return p?(0,i.FD)("div",{className:v.A.editorWrapper,children:[(0,i.Y)("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:(0,i.FD)(u.EY.Digit,{as:"div",color:"secondary",className:v.A.editorHelperText,children:["paid"===l.exclude_audience_minimum?"Sponsorship Campaign (Free Only)":"Sponsorship Campaign",l.description&&(0,i.Y)(h.m_,{text:l.description,children:(0,i.Y)(a.A,{size:14})}),c&&(0,i.FD)(i.FK,{children:[" - ",(0,i.Y)("a",{href:(0,Y.sTG)({campaignId:l.id,pub:c}),children:"Edit"})]})]})}),w]}):(0,i.Y)(o.A,{parent:null!=(r=null==y?void 0:y.current)?r:void 0,onFirstVisible:()=>_(l.id,null==m?void 0:m.id,g),children:w})},F=e=>{var t;let{campaign:n,pub:r,post:l,placementId:a}=e;return(0,i.Y)("a",{className:"sponsorshipCampaignEmailLink",href:(0,Y.qCG)({campaignId:n.id,medium:"email",pubId:null!=(t=null==r?void 0:r.id)?t:0,userId:p.T.USER_ID,postId:null==l?void 0:l.id,placementId:a}),children:(0,i.Y)(c.h2,{className:"sponsorshipCampaignEmailWrapper","data-component-name":"StaticSponsorshipCampaignBlock",children:(0,i.Y)("tr",{children:(0,i.FD)("td",{className:"sponsorshipCampaignEmailTableCell",children:[n.short_text&&(0,i.Y)("span",{className:"sponsorshipCampaignPresentedByEmailWithSpacing",children:n.short_text}),n.image_url&&(0,i.Y)("img",{className:"sponsorshipCampaignEmailImage",src:(0,b.dJ9)(n.image_url,600),width:200})]})})})})},N=e=>{let{html:t,campaign:n,pub:i,userId:r,medium:l,postId:a,placementId:o}=e;return t.replace(/href="proxy.php?url=https%3A%2F%2Fsubstackcdn.com%2F%28%5B%5E"]*)"/g,(e,t)=>{var s;let d=(0,Y.qCG)({campaignId:n.id,medium:l,pubId:null!=(s=null==i?void 0:i.id)?s:0,userId:r,url:t,postId:a,referrer:"undefined"!=typeof window?window.location.href:void 0,placementId:o});return'href="'.concat(d,'"')})},E=e=>{var t,n,r;let{campaign:l,pub:c,isEditor:p,post:m,placementId:f}=e,b=(0,d.Jd)(),{scrollContainerRef:w}=(0,s.o)();if(!c)return null;let C=l.doc_content,S=f?null==(t=l.placements)?void 0:t[f]:void 0;S&&(null==(n=S.creative)?void 0:n.doc_content)&&(C=S.creative.doc_content);let A=y.toHtml(C,!1,{pubId:c.id}),F=p?A:N({html:(0,g.W)(A,{pub:c,user:b}),campaign:l,pub:c,userId:String(null==b?void 0:b.id),medium:"web",postId:null==m?void 0:m.id,placementId:f}),E=(0,i.Y)("div",{className:"sponsorshipCampaignDocContentWrapper",dangerouslySetInnerHTML:{__html:F}});return p?(0,i.FD)("div",{className:v.A.editorWrapper,children:[(0,i.Y)("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:(0,i.FD)(u.EY.Digit,{color:"secondary",className:v.A.editorHelperText,children:["paid"===l.exclude_audience_minimum?"Sponsorship Campaign (Free Only)":"Sponsorship Campaign",l.description&&(0,i.Y)(h.m_,{text:l.description,children:(0,i.Y)(a.A,{size:14})}),c&&f&&(0,i.FD)(i.FK,{children:[" - ",(0,i.Y)("a",{href:(0,Y.sTG)({campaignId:l.id,pub:c}),children:"Edit campaign"})," | "]}),c&&!f&&(0,i.FD)(i.FK,{children:[" - ",(0,i.Y)("a",{href:(0,Y.sTG)({campaignId:l.id,pub:c}),children:"Edit"})]})]})}),E]}):(0,i.Y)(o.A,{parent:null!=(r=null==w?void 0:w.current)?r:void 0,onFirstVisible:()=>_(l.id,null==m?void 0:m.id,f),children:E})},D=e=>{var t,n;let{campaign:r,pub:l,post:a,placementId:o}=e;if(!l)return null;let s=r.doc_content;if(o&&(null==(t=r.placements)?void 0:t[o])){let e=r.placements[o];(null==(n=e.creative)?void 0:n.doc_content)&&(s=e.creative.doc_content)}let d=N({html:y.toHtml(s,!0,{pubId:l.id}),campaign:r,pub:l,userId:p.T.USER_ID,medium:"email",postId:null==a?void 0:a.id,placementId:o}),c=(0,m.C3)({pub:l})?(0,i.Y)("img",{alt:"",src:(0,b.dJ9)("".concat((0,f.Ew)(),"/img/daily_takes_email/sponsorship-header.png"),384),style:{display:"block",height:"auto",width:"192px",maxWidth:"192px"}}):null;return(0,i.FD)(i.FK,{children:[c,(0,i.Y)("div",{className:"sponsorshipCampaignDocContentWrapperEmail",dangerouslySetInnerHTML:{__html:d}})]})}},81209:function(e,t,n){n.d(t,{A:()=>D,n:()=>E});var i=n(99851),r=n(69277),l=n(70408),a=n(4006),o=n(32485),s=n.n(o),d=n(45773),c=n(17402),u=n(97432),h=n(78943),p=n(1250),m=n(84605),g=n(53989),Y=n(8609),f=n(21076),b=n(89490),y=n(35369),v=n(76977),_=n(98111),w=n(39318),C=n(41086),S=n(82776),A=n(57324);let F=["Subscribe","Subscribe now","Sign up","Sign up now"];function N(e){let{isStatic:t,pub:n,user:i,freeSignup:r,children:l,pledgesEnabled:o}=e;if(t)return(0,a.Y)(Y.a.Consumer,{children:e=>{let{isFreemail:t,isFreeSubscribed:i,isPledged:r}=e;return l({isFreeSubscribed:i,isSubscribed:!t,isFullySubscribed:n.plans?!t:!o||r,isForPaidSubscription:!!n.plans&&t,isPledged:r})}});let s=r||(null==i?void 0:i.is_free_subscribed),d=null==i?void 0:i.is_subscribed,c=(null==i?void 0:i.is_subscribed)&&(null==i?void 0:i.is_founding),u=null==i?void 0:i.is_pledged;return l({isFreeSubscribed:s,isSubscribed:d,isFullySubscribed:n.plans?d:s&&(!o||u),isForPaidSubscription:!!n.plans&&s&&!d,isPledged:u,isFoundingSubscribed:c})}function E(e){let{pub:t,user:n,now:i,isStatic:r}=e,{language:l}=(0,m.GO)();return(0,a.Y)(g.l9.Consumer,{children:e=>{let{getSettingFor:o}=e,s="disabled"===t.payments_state&&!t.invite_only&&!!o("payment_pledges_enabled");return(0,a.Y)(N,{isStatic:r,user:n,pub:t,pledgesEnabled:s,children:e=>{let{isFreeSubscribed:n,isPledged:r}=e;return(0,a.Y)(a.FK,{children:(0,S.getSubscribeText)(t,{now:i,isFreeSubscribed:n,isPledged:r,pledgesEnabled:s,language:l})})}})}})}class D extends c.Component{onSignup(e,t){let{pledgesEnabled:n}=t;this.setState({loading:!0}),this.props.onSignup?this.props.onSignup(e):!this.props.forceEmailInput&&(this.props.pub.plans||this.props.pub.has_recommendations||n)?document.location.href=(0,w.eV6)(this.props.pub,(0,r._)((0,l._)((0,r._)({addBase:!0,utm_medium:A.Jn.web,utm_source:this.props.source||A.VU.subscribeWidget,utm_content:this.props.post&&this.props.post.id,just_signed_up:!0,requires_confirmation:e.body.requires_confirmation?"true":""},e.body.subscription_id&&{subscription_id:e.body.subscription_id},e.body.referral_token&&{referral_token:e.body.referral_token}),{next:this.props.next||document.location.href}),this.props.foundingUpsell&&{plan:"founding"})):(window.history.replaceState({},"",(0,w.yRP)(document.location.href,{just_subscribed:!0})),document.location.reload())}getHref(e,t){let{pub:n,subscribeButtonAttrs:i,isStatic:l,source:a,post:o,next:s,foundingUpsell:d}=this.props,c=(0,r._)({utm_medium:l?A.Jn.email:A.Jn.web,utm_source:a||A.VU.subscribeWidget,utm_content:o&&o.id,next:l?s:s||document.location.href,referring_pub_ids:l?void 0:(0,C.y)("referring_pub_ids")},d&&{plan:"founding"});return e?l?_.T.ACCOUNT_URL:(0,w.FCy)(n,{params:c,addBase:t.isSubstack}):(0,w.eV6)(n,(0,r._)({addBase:!0,root:i?i.url:l?_.T.CHECKOUT_URL:void 0},c))}getButtonLabel(e,t,n){let{isPledged:i,pledgesEnabled:r,foundingUpsell:l,isFoundingSubscribed:a}=n,{pub:o,subscribeButtonAttrs:s}=this.props,{iString:d}=I18N.i({pub:o});if(e||i)return d("Subscribed");let c=s&&s.text;return c&&!F.includes(c)?c:(0,S.getSubscribeText)(o,{now:!t,isFreeSubscribed:t,isPledged:i,pledgesEnabled:r,language:this.context.language,foundingUpsell:l,isFoundingSubscribed:a})}render(){var e;let{additionalPubIds:t,align:n="center",className:i,expectTruncation:r,forceEmailInput:l,foundingUpsell:o,freeSignup:c,freeSignupEmail:m,isStatic:Y,noMargin:_,pub:w,source:C,user:F,onConfirmationRequired:E,onError:D,onPrepareData:k}=this.props,{loading:I}=null!=(e=this.state)?e:{};return(0,a.Y)(g.l9.Consumer,{children:e=>{let{getSettingFor:g}=e;return(0,a.Y)(p.oB.Consumer,{children:e=>{let p=!e.isSubstack&&"undefined"!=typeof window&&w.hostname!==window.location.hostname.replace(/[.]localhost$/,"");return(0,a.Y)(N,{pub:w,user:F,isStatic:Y,freeSignup:c,pledgesEnabled:"disabled"===w.payments_state&&!w.invite_only&&!!g("payment_pledges_enabled"),children:N=>{var x;let{isFreeSubscribed:T,isSubscribed:R,isFullySubscribed:B,isPledged:P,isFoundingSubscribed:L}=N,O=B&&(!o||L),U=this.getButtonLabel(O,T,{isPledged:P,pledgesEnabled:"disabled"===w.payments_state&&!w.invite_only&&!!g("payment_pledges_enabled"),isFoundingSubscribed:L,foundingUpsell:o}),J=T||R;return(0,a.Y)("div",{className:s()("subscribe-widget",{"is-signed-up":J,"is-fully-subscribed":O,"no-margin":_},i),"data-component-name":"SubscribeWidget",children:!l&&(J||Y)?(0,a.Y)(b.az,{className:"button-wrapper",children:Y?(0,a.FD)("a",{className:s()("button subscribe-btn",O?"outline":"primary"),href:this.getHref(O,e),"data-native":Y?void 0:"",children:[O&&(0,a.Y)(h.A,{stroke:(null==w||null==(x=w.theme)?void 0:x.background_pop_color)||(null==w?void 0:w.theme_var_background_pop)||f.vW,fill:"transparent",isStatic:!0,className:"check-icon static",height:20}),(0,a.Y)("span",{children:U})]}):(0,a.Y)(v.Ye,{justifyContent:"left"===n?"start":"center",children:(0,a.Y)(y.$n,{href:this.getHref(O,e),localNavigation:!1,priority:O&&(L||!o)?"secondary-accent":"primary",leading:O&&(L||!o)?(0,a.Y)(d.A,{size:20}):null,children:(0,a.Y)("span",{children:U})})})}):(0,a.Y)(v.Ye,{justifyContent:"left"===n?"start":"center",children:(0,a.Y)(u.A,{disabled:J||I,freeSignup:c,freeSignupEmail:m,expectTruncation:r,next:p?window.location.href:null,pub:w,source:C||"subscribe-widget",submitButtonText:J?"✓":(0,S.getSubscribeText)(w,{language:this.context.language}),useSubscribeLink:p,useGenericEndpoint:null==e?void 0:e.isSubstack,additionalPubIds:t,user:F,utm_campaign:(null==e?void 0:e.isSubstack)?A._9.reader2:p?A._9.crossPost:null,onConfirmationRequired:E||((null==w?void 0:w.payments_state)==="enabled"?()=>null:void 0),onError:D,onPrepareData:k,onSuccess:e=>this.onSignup(e,{pledgesEnabled:"disabled"===w.payments_state&&!w.invite_only&&!!g("payment_pledges_enabled")})})})})}})}})}})}}(0,i._)(D,"contextType",m.OW)},61193:function(e,t,n){n.d(t,{W:()=>d});var i=n(4006),r=n(13950),l=n(15894),a=n(84605),o=n(47570),s=n(17028);let d=e=>{let{comments:t,post:n,commentId:o,notAllowedToFetchComments:d,handleSort:u,publication:h,sort:p,disableMobileBottomSheet:m}=e,{iString:g}=(0,a.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)(l.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)(l.T,{color:"accent",preset:"st4",children:n.comment_count}):null]}),(0,i.FD)(s.az,{className:"sortOptionsContainer-bIIUcJ",children:[!d&&(0,i.Y)(l.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&&!d&&!o&&(0,i.Y)(c,{comments:t,disableMobileBottomSheet:m,handleSort:u,publication:h,sort:p})]})]})},c=e=>{let{publication:t,handleSort:n,sort:r,comments:l,disableMobileBottomSheet:a}=e;return t&&n&&r?(0,i.Y)(o.D,{currentSort:r,disableMobileBottomSheet:a,handleSort:n,isLoading:!l,pub:t}):null}},77481:function(e,t,n){n.d(t,{n:()=>p});var i=n(4006),r=n(34746),l=n(63446),a=n(61193),o=n(15894),s=n(84605),d=n(89490),c=n(76977),u=n(39318),h=n(57324);let p=e=>{let{post:t,publication:n,user:p,freeSignupEmail:m=null,showHeader:g=!1}=e,{iString:Y}=(0,s.GO)(),f=p&&p.email||m||null,b=(0,u.my9)(n,{simple:!0,next:document.location.href,utm_source:h.VU.paywall,utm_medium:h.Jn.web,utm_content:t?t.id:null,just_signed_up:!1}),y=async()=>{window.location.href=b};return(0,i.FD)(c.I1,{className:"container-u0f9W_",children:[g&&(0,i.Y)(a.W,{notAllowedToFetchComments:!0,post:t,publication:n}),(0,i.Y)(d.az,{className:"commentsPaywall-ASd8iy",children:(0,i.FD)(c.I1,{alignItems:"center",gap:24,paddingX:24,paddingY:40,children:[(0,i.Y)(o.T,{color:"white",preset:"h4-sans-condensed",children:Y("Join the conversation")}),(0,i.Y)(o.T,{color:"white",preset:"d3-serif",children:Y("Share your thoughts and connect with other readers by becoming a paid subscriber!")}),(0,i.Y)(l.v,{variant:"inverse",onClick:y,children:Y("Upgrade today")}),(0,i.FD)(o.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:Y(f?"Switch accounts":"Sign in")})]})]})})]})}},58997:function(e,t,n){n.d(t,{D:()=>D,X:()=>E});var i=n(99851),r=n(79785),l=n(4006),a=n(17402),o=n(15734),s=n.n(o),d=n(6212),c=n(41935),u=n(37494),h=n(90847),p=n(46196),m=n(56778),g=n(84605),Y=n(8609),f=n(6049),b=n(86500),y=n(68349),v=n(98111),_=n(4016),w=n(56262),C=n(39318),S=n(82776),A=n(57324);function F(){let e=(0,r._)(["This thread is only visible to "," subscribers of ",""]);return F=function(){return e},e}class N extends a.Component{onTopReached(){this.state.topReached||(this.setState({topReached:!0}),(0,b.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,b.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:o,freeSignup:s,freeSignupEmail:g,isStatic:Y,truncated:b,invisible:y,post_reaction_token:N,onChange:E,showCta:D=b,showUnsubscribeNotice:k,dataForEmailRender:I={},showReactions:x=!0,gap:T=16,iString:R,iTemplate:B,iPlural:P,language:L,showShare:O}=this.props,{hidden:U}=this.props;"boolean"!=typeof U&&(U=r.hidden),U?(e=R("Subscribe to view"),t=(0,C.yRP)("/subscribe",{simple:!0,next:document.location.href,utm_source:A.VU.thread,utm_medium:A.Jn.web,utm_content:r.id})):(t=(0,C.wu9)(i,r,{noBase:!0}),e="thread"!==r.type||b?(0,S.getPostCtaText)(r,L):r.comment_count?P("View 1 comment","View %1 comments",r.comment_count):R("Reply"));let J=Y&&!this.context.isAmp,z=(0,_.lu)({pub:i}),M=z?h.Z:a.Fragment;return(0,l.Y)(f.h2,{className:"thread-head typography ".concat(n||""),children:(0,l.Y)("tr",{children:(0,l.Y)("td",{children:(0,l.FD)(f.jJ,{width:"100%",children:[!y&&!U&&(0,l.Y)(m.A,{onVisible:()=>this.onTopReached()}),(0,l.FD)(f.jJ,{gap:T,width:"100%",children:[D&&z&&(0,l.Y)(p.$,{post:r,ctaUrl:t,ctaText:e,hidden:U}),(0,l.Y)(d.I0,{pub:i,post:r,user:o,isStatic:Y,reaction_token:N,allowEdit:!0,allowTruncate:b,showReactions:!!D||x,showShare:O,showComments:!!r.comment_count,inThreadHead:!0,onChange:E,showLabel:!0}),(0,l.Y)(M,{inThreadHead:!0,children:(0,l.Y)(u.A,{user:o,freeSignup:s,freeSignupEmail:g,pub:i,post:r,html:U||b||!r.body_html?null:r.body_html,isStatic:Y,dataForEmailRender:I,children:U?(0,l.Y)("p",{children:(0,l.Y)("i",{children:B(F(),(0,w.isFoundingAudience)(r.audience)?"founding":"paid",i.name)})}):b?(0,l.Y)("p",{children:r.description}):null})}),D?!z&&(0,l.FD)("a",{className:"thread-head-cta",href:t,"data-native":!0,children:[e," →"]}):U&&(0,l.FD)("p",{className:"thread-head-cta",children:[(0,l.Y)("a",{href:(0,C.eV6)(i,{simple:!0,next:document.location.href,utm_source:A.VU.thread,utm_medium:A.Jn.web,utm_content:r.id}),className:"button primary subscribe-btn","data-native":Y?void 0:"",children:(0,S.getSubscribeText)(i)}),(0,l.Y)("a",{href:(0,C.a7q)({for_pub:i.subdomain}),className:"button","data-native":!0,children:R("Sign in")})]})]}),J&&(0,l.FD)(f.jJ,{gap:T,style:{width:"100%"},children:[(0,l.Y)(f.jJ,{style:{width:"100%",textAlign:"center"},children:(0,l.Y)("a",{role:"button",className:"button primary",style:{margin:"0 auto"},href:v.T.HALF_MAGIC_COMMENTS_URL,children:R("See the discussion")})}),(0,l.Y)(c.fz,{isFooter:!0,customization:{showShare:!0,showComments:!0,showReactions:{showReactions:x},showRestack:!1,showLabels:!0,showCommentRestack:!i.hide_post_restacks}})]}),k&&r.unsubscribed&&(0,l.FD)("div",{className:"notifications-alert",children:[R("Email notifications are disabled for this thread.")," ",(0,l.Y)("a",{href:"javascript:void(0)",onClick:()=>this.enableEmailNotifications(),children:R("Re-enable")})]}),!y&&!U&&(0,l.Y)(m.A,{onVisible:()=>this.onBottomReached()})]})})})})}}(0,i._)(N,"contextType",Y.a);let E=(0,g.wr)(N);class D extends a.Component{render(){return(0,l.FD)("div",{className:"thread-head-silhouette",children:[(0,l.Y)("div",{className:"thread-head-silhouette-head"}),(0,l.FD)("div",{className:"thread-head-silhouette-content",children:[(0,l.Y)("div",{className:"thread-head-silhouette-title"}),(0,l.Y)("div",{className:"thread-head-silhouette-meta"}),(0,l.FD)("div",{className:"thread-head-silhouette-body",children:[(0,l.Y)("div",{className:"thread-head-silhouette-body-line"}),(0,l.Y)("div",{className:"thread-head-silhouette-body-line"}),(0,l.Y)("div",{className:"thread-head-silhouette-body-line"})]})]})]})}}},73684:function(e,t,n){n.d(t,{j:()=>m});var i=n(4006),r=n(17159),l=n.n(r),a=n(79909),o=n(45947),s=n(73957),d=n(51683),c=n(39318),u=n(70189),h=n(49807),p=n(82776);function m(e){var t,n,r,l;let o,m,Y,f,{comment:b,post:y,publication:v}=e,_="Substack | Notes";v&&b.name?_="".concat(b.name," on ").concat(v.name):b.name&&b.handle?_="".concat(b.name," (@").concat(b.handle,")"):b.name?_=b.name:v&&(_="".concat(v.name));let w=y&&v?(0,s.getPageTitleAndMeta)(y,v,{isCommentPage:!0}).title:"".concat(_,': "').concat((0,p.truncateText)(b.body,280),'"'),C=(null!=(t=b.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?(o=(0,h.dJ9)(S),f=!0):(0,d.lp)(b)?(m=680,Y=680,o=(0,h.dJ9)((0,u.Hr)(b.id,{isSmall:!0,attachmentsOnly:!0}),Y,{height:m}),f=!0):b.photo_url?(o=(0,h.dJ9)(b.photo_url,40),m=40,Y=40):b.user_id&&(o=(0,h.dJ9)((0,c.Ji1)(b.user_id),40),m=40,Y=40);let A=null!=(n=b.body)?n:"";return(0,i.FD)(i.FK,{children:[(0,i.Y)(a.Metadata,{title:w,socialTitle:_,description:A,image:o,isLargeImage:f,imageHeight:m,imageWidth:Y,siteName:v?v.name:"Substack",publishedTime:b.date.toString(),meta:[{name:"twitter:label1",content:"Likes"},{name:"twitter:data1",content:String(null!=(r=b.reaction_count)?r:0)},{name:"twitter:label2",content:"Replies"},{name:"twitter:data2",content:String(null!=(l=b.children_count)?l:0)}]}),(0,i.Y)(g,{comment:b,includeBody:!0})]})}function g(e){let{comment:t,includeBody:n}=e;return t?(0,i.Y)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:l()((0,o.Q)(t,{includeViews:!1,includeBody:n}),{json:!0,isScriptContext:!0})}}):null}},79313:function(e,t,n){n.d(t,{pK:()=>f});var i=n(4006),r=n(54718),l=n(43427);n(15074);var a=n(30193),o=n(68611);n(84605);var s=n(6049),d=n(42686),c=n(89490),u=n(63136);n(49095),n(14124);var h=n(16291),p=n(56262),m=n(39318),g=n(49807),Y=n(82776);function f(e){var t,n,p,f,S,A,F,N,E;let{comment:D,utmSource:k,hideUfi:I,commentLinkUrl:x}=e;if(!D)return(0,i.Y)(u.EY.B3,{"data-component-name":"EmailCommentEmbedError",translated:!0,children:"Could not load comment"});let T=null==(t=D.attachments)?void 0:t.find(e=>"image"===e.type),R=null==(n=D.attachments)?void 0:n.find(e=>"post"===e.type),B=null==R?void 0:R.postSelection,P=null==(p=D.attachments)?void 0:p.find(e=>"image"!==e.type),L=P&&(0,d.hH)(P),O=null==(f=D.attachments)?void 0:f.find(e=>"video"===e.type);return(0,i.Y)(c.az,{as:"a",href:null!=x?x:(0,g.Zgx)(D,{urlParams:{utm_source:k}}),display:"block",padding:16,radius:"md",border:"detail",color:"primary",className:"note-flsrqQ","data-component-name":"EmailCommentEmbed",children:(0,i.FD)(s.ZB,{style:{width:"100%"},verticalAlign:"top",gap:12,growLastChild:!0,children:[(0,i.Y)(s.Kb,{src:null!=(A=D.photo_url)?A:(0,m.Ji1)(null!=(S=D.user_id)?S:0),size:48}),(0,i.FD)(s.jJ,{gap:12,style:{lineHeight:1,width:"100%"},children:[(0,i.FD)(c.az,{children:[(0,i.FD)(u.EY.B3,{children:[(0,i.Y)(u.EY,{as:"span",weight:"semibold",children:D.name})," ",(0,i.Y)(u.EY,{as:"span",color:"secondary",children:(0,h.A)(D.date).fromNowShort()})]}),(0,i.Y)(u.EY.B3,{children:(0,Y.truncateWords)(D.body,420)})]}),R&&B&&(0,i.Y)(u.EY.B3,{children:(0,i.Y)(_,{attachment:R,selection:B})}),L&&!R&&(0,i.Y)(u.EY.B4,{color:"highlight",children:L}),O&&(0,i.Y)(C,{attachment:O}),T&&(0,i.Y)(w,{attachment:T}),!I&&(0,i.Y)(s.h2,{width:"100%",style:{width:"100%"},children:(0,i.FD)("tr",{children:[(0,i.FD)("td",{width:"20%",children:[(0,i.Y)(l.A,{width:16,height:16,strokeWidth:1.5,stroke:v,style:b,fill:"none",isStatic:!0}),(0,i.Y)(y,{count:null!=(F=D.reaction_count)?F:0})]}),(0,i.FD)("td",{width:"20%",children:[(0,i.Y)(a.A,{size:16,strokeWidth:1.5,stroke:v,style:b,isStatic:!0}),(0,i.Y)(y,{count:null!=(N=D.children_count)?N:0})]}),(0,i.FD)("td",{width:"20%",children:[(0,i.Y)(o.A,{size:16,strokeWidth:1.5,stroke:v,style:b,isStatic:!0}),(0,i.Y)(y,{count:null!=(E=D.restacks)?E:0})]}),(0,i.Y)("td",{width:"20%",children:(0,i.Y)(r.A,{size:16,strokeWidth:2,stroke:v,style:b})})]})})]})]})})}let b={display:"inline-block",verticalAlign:"middle"};function y(e){let{count:t}=e;return(0,i.Y)(u.EY.B4,{size:12,as:"span",weight:"semibold",color:"secondary",style:{marginLeft:4},children:t>0?(0,Y.numberToRoughShortString)(Math.max(t,1),{plusSignifier:""}):" "})}let v="#808080";function _(e){let{attachment:t,selection:n}=e;return(0,i.Y)(c.az,{padding:12,radius:"md",bg:"secondary",children:(0,i.FD)(u.EY,{color:"secondary",font:"serif",fontStyle:"italic",lineHeight:24,children:[(0,Y.truncateWords)(n.text.replaceAll("“","‘").replaceAll("”","’"),180),"” — ",(0,p.getPostAuthor)(t.publication,t.post).name]})})}function w(e){let{attachment:t}=e;return(0,i.Y)(c.az,{as:"img",src:(0,g.dJ9)(t.imageUrl,800,{crop:"limit",height:800}),width:400,radius:"md",style:{maxHeight:600,objectFit:"cover",margin:0}})}function C(e){let{attachment:t}=e,n=t.mediaUpload;return(0,i.Y)(c.az,{as:"img",src:(0,m.Pzx)(n,{isStatic:!0}),width:400,radius:"md",style:{maxHeight:600,objectFit:"cover",margin:0}})}},27332:function(e,t,n){n.d(t,{GZ:()=>K,Iz:()=>M,LY:()=>R,M6:()=>z,X6:()=>G,j6:()=>x,jS:()=>B,l8:()=>P,qv:()=>V,wF:()=>L});var i=n(69277),r=n(70408),l=n(4006),a=n(75107),o=n(84565);n(58050);var s=n(84605),d=n(85478),c=n(46271);n(95282);var u=n(27749),h=n(51498),p=n(80520),m=n(72945),g=n(25859),Y=n(90136),f=n(58292),b=n(89490),y=n(35369),v=n(76977),_=n(45859),w=n(63136),C=n(504),S=n(83629),A=n(85050),F=n(16884),N=n(49095),E=n(16291),D=n(75914),k=n(49807),I=n(57324);let x=["post_like","post_restack","comment_like"],T=["search","note-related","profile","publication","permalink"];function R(e){let{author:t,post:n,comment:i,onClick:r,utm_content:a,publication:g,item:f,allowHide:b=!1,timestamp:y,hideSubscribeCta:_,onDismiss:w,onToggleTranslation:C,isShowingTranslation:S}=e,A=(0,u.PK)(),F=y||(null==i?void 0:i.date)||(null==n?void 0:n.post_date),N=(0,c.Jd)(),{getExperimentVariant:E,exposeExperiment:k}=(0,o.NQ)(),{language:I}=(0,s.GO)(),x=C&&i&&(0,Y.$)(i,I),R=x&&"treatment"===E("universal_feed_translator_experiment");x&&k("universal_feed_translator_experiment");let B=N&&w&&t.id!==N.id&&((null==f?void 0:f.type)==="post"||(null==f?void 0:f.type)==="comment"),P=T.includes(A),U=!!(0,d.mJ)().getConfigFor("feed_item_source_debug_mode"),J=U&&f&&"trackingParameters"in f,z=!_&&t&&f&&!P;return(0,l.FD)(G,{children:[(0,l.FD)(v.I1,{flex:"grow",children:[(0,l.FD)(V,{children:[(0,l.Y)(L,{user:t,onClick:r,utm_content:a}),F&&(0,l.Y)(M,{timestamp:F,comment:i}),U&&f&&(0,l.Y)(W,{item:f,showEntityKey:!0,showDebugDot:null!=J&&J})]}),R&&C&&(0,l.Y)(Y.P,{comment:i,onToggleTranslation:C,isShowingTranslation:null!=S&&S,item:f})]}),z&&(0,l.Y)(O,{author:t,item:f,comment:null!=i?i:void 0,post:null!=n?n:void 0,publication:null!=g?g:void 0}),f&&(0,D.tL)(f,i)&&"post"===f.type&&n&&g&&(0,l.Y)(p.N,{item:f,pub:g,post:n}),(0,l.FD)(v.pT,{maxHeight:20,gap:6,alignItems:"center",children:[(0,l.Y)(m.s,{publication:g,post:n,comment:i,item:f,allowHide:b}),B&&(0,l.Y)(h.R,{onDismiss:w,item:f})]})]})}function B(e){let{user:t,setTargetUser:n,eligibleTargetUsers:i,targetUser:r}=e;return(0,l.Y)(G,{children:(0,l.Y)(V,{children:(0,l.Y)(_.W1,{trigger:(0,l.Y)(y.$n,{priority:"quaternary",size:"sm",color:"primary",trailing:(0,l.Y)(a.A,{size:16}),children:(0,l.Y)(P,{user:null!=r?r:t})}),children:i.map(e=>(0,l.Y)(_.Dr,{onClick:()=>{e.id===t.id?n(null):n(e)},children:e.name},e.id))})})})}function P(e){let{user:t}=e;return(0,l.Y)(G,{children:(0,l.FD)(V,{children:[(0,l.Y)(w.EY,{as:"span",weight:"medium",children:t.name}),(0,l.Y)(N.UserStatusSymbols,{status:t.status,userId:t.id,size:"xs"})]})})}function L(e){let{user:t,onClick:n,utm_content:i}=e;return(0,l.Y)(l.FK,{children:(0,l.FD)(w.EY.B3,{as:"span",weight:"medium",children:[(0,l.Y)(g.yp,{user:t,onClick:n,utm_source:I.VU.substackFeedItem,utm_content:i,children:t.name})," ",(0,l.Y)(N.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:a,publication:o}=e,{finalPublication:s,isSubscribed:d,showCta:c,handleClick:u,currentUser:h}=K({targetUser:t,item:r,comment:n,post:i,publication:o});return(!h||h.id!==t.id)&&s&&c?(0,l.Y)(a?J:U,{isSubscribed:d,onClick:u}):null}function U(e){let{isSubscribed:t,onClick:n}=e,{iString:i}=(0,s.GO)();return(0,l.Y)(y.$n,{priority:t?"quaternary":"tertiary-accent",size:"xs",onClick:n,children:i(t?"Subscribed":"Subscribe")})}function J(e){let{isSubscribed:t,onClick:n}=e,{iString:i}=(0,s.GO)();return(0,l.Y)(y.$n,{priority:t?"quaternary":"primary",size:"sm",onClick:n,children:i(t?"Subscribed":"Subscribe")})}let z=new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"});function M(e){let{timestamp:t,comment:n,post:i,publication:r}=e;return(0,l.Y)(g.Yq,{href:n?(0,k.Zgx)(n,{noBase:S.Z}):i?(0,k.q$n)(r,i):void 0,color:"secondary",title:z.format((0,E.A)(t).toDate()),children:(0,l.Y)(f.iE,{timestamp:t})})}function W(e){let{item:t,showEntityKey:n,showDebugDot:i}=e;return(0,l.FD)(v.pT,{flex:"grow",gap:4,alignItems:"center",justifyContent:"end",children:[n&&(0,l.Y)(H,{item:t}),i&&(0,l.Y)(j,{item:t})]})}function H(e){let{item:t}=e;return"entity_key"in t?(0,l.Y)(w.EY.B4,{as:"span",color:"secondary",children:t.entity_key}):null}function j(e){var t;let n,i,{item:r}=e,{iString:a}=(0,s.GO)(),o=null==(t=r.trackingParameters)?void 0:t.item_source;return o?"model"===o?(n="accent-green",i="Model"):o.includes("db")?(n="accent-blue",i="DB"):o.includes("new-user")?(n="accent-purple",i="New user"):o.includes("trending")?(n="accent-red",i="Trending"):(n="tertiary",i="Other"):(n="accent-yellow",i="No source info"),(0,l.Y)("span",{children:(0,l.Y)(b.az,{height:8,width:8,radius:"full",bg:n,color:"secondary",title:a(i)})})}let G=(0,b.I4)((0,r._)((0,i._)({},w.nS),{display:"flex",minWidth:0,gap:8,alignItems:"center",justifyContent:"space-between"}));(0,b.I4)((0,r._)((0,i._)({},w.nS),{display:"flex",minWidth:0,gap:12,alignItems:"center"}));let V=(0,b.I4)({display:"flex",flex:"grow",minWidth:0,gap:8,alignItems:"center"});function K(e){var t,n;let{targetUser:i,item:r,comment:l,post:a,publication:o}=e,s=(0,c.Jd)(),d=(0,u.PK)(),h=l?"comment":a?"post":void 0,p=null!=(n=null!=(t=null==l?void 0:l.id)?t:null==a?void 0:a.id)?n:0,m=h?(0,k.Vvu)(p,h):void 0,g=null!=o?o:null==i?void 0:i.primary_publication,Y=(0,A.s)({surface:"substack-feed-item"})(g),f=(0,F.Zm)({user:i,publicationId:null==g?void 0:g.id,publicationName:null==g?void 0:g.name,subscriptionSource:"substack-feed-item",sourceNoteId:m});return{finalPublication:g,isSubscribed:f.isSubscribed,showCta:f.showCta,handleClick:e=>{r&&(0,C.Qb)(r,d,"subscribe"),!s&&g?Y(e):f.isSubscribed?f.unsubscribe(e):f.subscribe(e)},currentUser:s}}},25714:function(e,t,n){n.d(t,{P:()=>u});var i=n(4006),r=n(32485),l=n.n(r),a=n(27437),o=n(84777),s=n(46271),d=n(28700),c=n(8895);function u(e){let{id:t,label:n,type:r,url:l,unstyled:a}=e;return(0,i.Y)("span",{className:"node-substack_mention",children:"pub"===r?(0,i.Y)(p,{id:t,url:l,label:n,unstyled:a}):(0,i.Y)(h,{id:t,label:n,unstyled:a})})}function h(e){let{id:t,label:n,unstyled:r}=e,o=(0,s.Jd)(),u=o&&o.id===t;return(0,i.Y)(a.ProfileHoverCard,{subject:{id:t,name:n},trigger:(0,i.Y)("a",{className:l()(c.A.mention,u&&c.A.self,r&&c.A.unstyled),href:(0,d.rf)(t,n),children:n})})}function p(e){let{id:t,url:n,label:r,unstyled:a}=e,d=(0,s.Jd)(),u=d&&d.id===t;return(0,i.Y)(o.m,{pubId:t,trigger:(0,i.Y)("a",{className:l()(c.A.mention,u&&c.A.self,a&&c.A.unstyled),href:n,children:r})})}},1124:function(e,t,n){n.d(t,{f:()=>B});var i=n(69277),r=n(70408),l=n(4006),a=n(54718),o=n(99084),s=n(29665),d=n(82853),c=n(84934),u=n(27786),h=n(21767),p=n(68397),m=n(1839),g=n(50180),Y=n(37946),f=n(16079),b=n(15977),y=n(32641),v=n(97731);let _=e=>{var{size:t=24,color:n="var(--color-fg-primary)",className:a}=e,o=(0,y._)(e,["size","color","className"]);return(0,l.Y)(v.A,(0,r._)((0,i._)({},o),{name:"LinearIcon",svgParams:{viewBox:"0 0 20 20"},width:t,height:t,fill:n,stroke:"none",className:a,children:(0,l.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),A=n(35369),F=n(76977),N=n(45859),E=n(78526),D=n(2481),k=n(58278),I=n(39318),x=n(18947),T=n(82776),R=n(70515);function B(e){let{comment:t,pub:n,post:i,user:r,onChange:o,startEdit:s,startReport:d,openBan:c,isCollapsed:u,toggleCollapse:h}=e;return!function(e){let{menuEnabled:t}=Z(e);return t}({comment:t,user:r})?null:(0,l.Y)(F.fI,{className:"triggerContainer-eX588u",children:(0,l.Y)(N.W1,{trigger:(0,l.Y)(A.K0,{priority:"quaternary",size:"sm",className:"trigger-j08Uop",children:(0,l.Y)(a.A,{size:16})}),children:(0,l.Y)(L,{comment:t,pub:n,post:i,user:r,onChange:o,startEdit:s,startReport:d,openBan:c,isCollapsed:u,toggleCollapse:h})})})}function P(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,l.Y)(l.FK,{children:n.map((e,t)=>(0,l.Y)(N.H9,{isFirst:0===t,children:e.items},e.key))})}function L(e){var t;let{comment:n,pub:i,post:r,user:a,onChange:o,startEdit:s,startReport:d,openBan:c,isCollapsed:u,toggleCollapse:h}=e,p=Z({comment:n,user:a}),m=[{key:"editing",items:[(0,l.Y)(J,{enabled:p.editCommentEnabled,onClick:s})]},{key:"sharing",items:[(0,l.Y)(U,{enabled:!0}),(0,l.Y)(K,{enabled:p.restackCommentEnabled})]},{key:"actions",items:[(0,l.Y)(z,{enabled:p.pinCommentEnabled}),(0,l.Y)(O,{enabled:!0,isCollapsed:u,toggleCollapse:h}),(0,l.Y)(M,{enabled:p.giftSubscriptionEnabled}),(0,l.Y)(q,{enabled:null!=(t=null==a?void 0:a.is_global_admin)&&t}),(0,l.Y)(W,{enabled:p.subscriberDetailsEnabled})]},{key:"admin",items:[(0,l.Y)(H,{enabled:p.deleteCommentEnabled}),(0,l.Y)(j,{enabled:p.removeCommentEnabled}),(0,l.Y)(G,{enabled:p.reportCommentEnabled,onClick:d}),(0,l.Y)(V,{enabled:p.banUserEnabled,onClick:c})]}];return(0,l.Y)(C.g,{value:{comment:n,pub:i,post:r,onChange:o,toggleCollapse:h},children:(0,l.Y)(P,{sections:m})})}function O(e){let{enabled:t,isCollapsed:n,toggleCollapse:i}=e,{iString:r}=(0,w.GO)();return t?(0,l.Y)(N.Dr,{leading:n?(0,l.Y)(o.A,{}):(0,l.Y)(s.A,{}),onClick:i,children:r(n?"Expand":"Collapse")}):null}function U(e){let{enabled:t}=e,{iString:n}=(0,w.GO)(),{comment:i,post:r,pub:a}=(0,S.c4)(),o=(0,E.L)();return t?(0,l.Y)(N.Dr,{leading:(0,l.Y)(d.A,{}),onClick:()=>{o((0,x.XB)(r,i,a))},children:n("Copy link")}):null}function J(e){let{enabled:t,onClick:n}=e,{iString:i}=(0,w.GO)();return t?(0,l.Y)(N.Dr,{leading:(0,l.Y)(c.A,{}),onClick:n,children:i("Edit")}):null}function z(e){let{enabled:t}=e,{iString:n}=(0,w.GO)(),{comment:i,onChange:r}=(0,S.c4)(),{pinned:a,togglingPin:o,togglePinned:s}=(0,S.Mr)({comment:i,onChange:r});return t?(0,l.Y)(N.Dr,{leading:(0,l.Y)(u.A,{}),onClick:s,children:n(o?a?"Unpinning...":"Pinning...":a?"Unpin":"Pin")}):null}function M(e){let{enabled:t}=e,{iString:n}=(0,w.GO)(),{comment:i,pub:r}=(0,S.c4)();if(!t)return null;let a="".concat(r.base_url,"/subscribe?gift=true&recipient=").concat(i.user_id,"-").concat((0,k.JG)(i.name,{hashIfEmpty:!0}),"&comment_id=").concat(i.id,"}");return(0,l.Y)(N.Dr,{leading:(0,l.Y)(h.A,{}),href:a,children:n("Gift a subscription")})}function W(e){let{enabled:t}=e,{iString:n}=(0,w.GO)(),{comment:i,pub:r}=(0,S.c4)();return t?(0,l.Y)(N.Dr,{leading:(0,l.Y)(p.A,{}),onClick:()=>{if(i.email)return window.open((0,I.w8b)(r,i.email),"_blank")},children:n("Subscriber details")}):null}function H(e){let{enabled:t}=e,{iString:n}=(0,w.GO)(),{comment:i,onChange:r}=(0,S.c4)(),{isDeleting:a,deleteComment:o}=(0,S.yy)({comment:i,onChange:r});return t?(0,l.Y)(N.Dr,{leading:(0,l.Y)(m.A,{}),onClick:o,priority:"destructive",children:n(a?"Deleting...":"Delete")}):null}function j(e){let{enabled:t}=e,{iString:n}=(0,w.GO)(),{comment:i,onChange:r}=(0,S.c4)(),{isRemoving:a,removeComment:o}=(0,S.d4)({comment:i,onChange:r});return t?(0,l.Y)(N.Dr,{leading:(0,l.Y)(g.A,{}),onClick:o,priority:"destructive",children:n(a?"Removing...":"Remove")}):null}function G(e){let{enabled:t,onClick:n}=e,{iString:i}=(0,w.GO)();return t?(0,l.Y)(N.Dr,{leading:(0,l.Y)(Y.A,{}),onClick:n,priority:"destructive",children:i("Report")}):null}function V(e){let{enabled:t,onClick:n}=e,{iString:i}=(0,w.GO)();return t?(0,l.Y)(N.Dr,{leading:(0,l.Y)(f.A,{}),onClick:n,priority:"destructive",children:i("Ban or suspend user")}):null}function K(e){let{enabled:t}=e,n=(0,D.NP)(),{comment:i,pub:r,post:a}=(0,S.c4)(),{iString:o}=(0,w.GO)();return t?(0,l.Y)(N.Dr,{leading:(0,l.Y)(b.A,{}),onClick:()=>{n.open({restackUrl:(0,x.XB)(a,i,r)})},children:o("Restack")}):null}function q(e){let{enabled:t}=e,{iString:n}=(0,w.GO)(),{comment:i,post:r,pub:a}=(0,S.c4)(),{addCommentToLinear:o}=(0,S.eu)({comment:i,post:r,pub:a});return t?(0,l.Y)(N.Dr,{leading:(0,l.Y)(_,{}),onClick:o,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,R.Pp)(t)||!!(null==n?void 0:n.is_community_moderator)&&(0,R.Pp)(t),l=(0,T.canEditComment)(n,t),a=!!(null==n?void 0:n.is_contributor)&&(0,R.Pp)(t)&&""===t.ancestor_path,o=!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,R.Pp)(t)&&!(null==n?void 0:n.is_oauth),p=l||a||o||s||d||c||u||h;return{editCommentEnabled:l,pinCommentEnabled:a,giftSubscriptionEnabled:o,reportCommentEnabled:s,deleteCommentEnabled:i,removeCommentEnabled:d,banUserEnabled:c,subscriberDetailsEnabled:u,restackCommentEnabled:h,menuEnabled:p}}},66729:function(e,t,n){n.d(t,{I:()=>r,g:()=>l});var i=n(4006);let r=(0,n(17402).createContext)(null);function l(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),l=n(45773),a=n(84605),o=n(13022),s=n(35369),d=n(45859),c=n(70515);let u=e=>{let{currentSort:t,isLoading:n,pub:l,handleSort:o,disableMobileBottomSheet:u}=e,{iString:p}=(0,a.GO)();return(0,i.Y)(d.W1,{trigger:(0,i.Y)(s.$n,{size:"sm",priority:"secondary",disabled:n,leading:(0,i.Y)(r.A,{size:18}),children:(0,c.rX)(t,l.language)}),"aria-label":p("Sort comments"),disableMobileBottomSheet:u,children:(0,i.Y)(h,{currentSort:t,pub:l,handleSort:o})})},h=e=>{let{currentSort:t,pub:n,handleSort:r}=e,a=!!(0,o.Ay)("like_comments_enabled");return(0,i.Y)(i.FK,{children:(0,c.Qz)({likesEnabled:a,language:n.language}).map(e=>{let{key:n,text:a}=e;return(0,i.Y)(d.Dr,{onClick:()=>r(n),trailing:n===t?(0,i.Y)(l.A,{}):void 0,children:a},n)})})}},42774:function(e,t,n){n.d(t,{Ud:()=>v,GL:()=>A,FS:()=>F,Q0:()=>S});var i=n(69277),r=n(79785),l=n(4006),a=n(48635),o=n(70408),s=n(32641),d=n(97731);let c=e=>{var{size:t=24,fill:n="var(--color-fg-primary)"}=e,r=(0,s._)(e,["size","fill"]);return(0,l.Y)(d.A,(0,o._)((0,i._)({},r),{name:"CommentBadgeHeartIcon",svgParams:{viewBox:"0 0 20 20"},width:t,height:t,fill:n,children:(0,l.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),h=n(84605),p=n(7684),m=n(76977),g=n(75303),Y=n(81929),f=n(66511);function b(){let e=(0,r._)(["Pinned by ",""]);return b=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,l.Y)(_,{name:t.pinned_by_name}):t.metadata.is_author?(0,l.Y)(w,{}):t.reactor_names.length>0?(0,l.Y)(C,{names:t.reactor_names}):null},_=e=>{let{name:t}=e,{iString:n,iTemplate:r}=(0,h.GO)();return t?(0,l.Y)(f.m_,{text:r(b(),t),children:(0,l.Y)(Y.vw,{priority:"secondary",cursor:"pointer",fillIcon:!0,leading:(0,l.Y)(u.A,(0,i._)({},Y.Oi)),children:n("Pinned")})}):(0,l.Y)(Y.vw,{priority:"secondary-outline",fillIcon:!0,leading:(0,l.Y)(u.A,(0,i._)({},Y.Oi)),children:n("Pinned")})},w=()=>{let{iString:e}=(0,h.GO)();return(0,l.Y)(Y.vw,{priority:"secondary-outline",theme:"accent",children:e("Author")})},C=e=>{let{names:t}=e,{iTemplate:n}=(0,h.GO)();return(0,l.Y)(Y.vw,{theme:"accent",priority:"secondary-outline",fillIcon:!0,leading:(0,l.Y)(c,(0,i._)({},Y.Oi)),children:n(y(),t.join(", "))})},S=e=>{let{comment:t,userBanned:n}=e,{banText:i,shouldShowBanText:r}=(0,p.d3)(t);return!r||n?null:(0,l.Y)(Y.vw,{priority:"secondary",children:i})},A=e=>{let{comment:t,userPendingApproval:n}=e,{iString:r}=(0,h.GO)();return n?(0,l.Y)(g.AE,{href:"/publish/moderation/new-commenters?user=".concat(t.user_id),target:"_blank",rel:"noopener",children:(0,l.Y)(Y.vw,{priority:"secondary",cursor:"pointer",trailing:(0,l.Y)(a.A,(0,i._)({},Y.Oi)),children:r("Awaiting approval")})}):null},F=e=>{let{children:t}=e;return(0,l.Y)(m.fI,{gap:4,children:t})}},17096:function(e,t,n){n.d(t,{Wh:()=>eA,ko:()=>ef,WR:()=>ey,cQ:()=>eY,yQ:()=>eb,Gs:()=>ev});var i=n(99851),r=n(69277),l=n(70408),a=n(79785),o=n(4006),s=n(32485),d=n.n(s),c=n(78659),u=n.n(c),h=n(69843),p=n.n(h),m=n(6498),g=n.n(m),Y=n(17402),f=n(15734),b=n.n(f),y=n(94090),v=n(58398),_=n(52820),w=n(84605),C=n(70145),S=n(45611),A=n(86500),F=n(55376),N=n(54687),E=n(72170),D=n(68611),k=n(55136),I=n(25859),x=n(13022),T=n(76977),R=n(45859),B=n(63136),P=n(28916);let L="link-_X6et2";function O(e){let{pub:t,post:n,comment:i,onChange:r}=e,{iString:l}=(0,w.GO)(),{canRestack:a,isRestacked:s,restacks:c,menuItems:u,nuxModal:h}=(0,P.I)({pub:t,post:n,comment:i,onRestack:e=>{r({restacked:e,restacks:c+(e?1:-1)})}});return a?(0,o.FD)("span",{children:[h,(0,o.Y)(R.W1,{trigger:(0,o.FD)("a",{className:d()("restack-button",s&&"restacked"),href:"javascript:void(0)",children:[(0,o.Y)(D.A,{}),l("Restack"),c>0&&" (".concat(c,")")]}),children:u})]}):null}let U=e=>{var t;let{comment:n,pub:i,user:r,post:l,reaction_token:a,commentsEnabledForPost:s,noRestack:c,onChange:u,startReply:h,shareComment:p,updateCommentReacted:m,hideShare:g,commentActionsOverride:Y}=e,{iString:f}=(0,w.GO)(),b=(0,x.Ay)("like_comments_enabled");return(0,o.Y)(T.pT,{gap:16,alignItems:"center",justifyContent:"start",paddingTop:8,className:d()("comment-actions",{"withShareButton-hQzuEn":!!p}),children:!n.deleted&&[b&&(0,o.Y)(k.cy,{user:r,pub:i,post:l,comment:n,height:16,countInParenthesesStyle:!0,token:a,onChange:e=>{let{comment:t}=e;return u(t)},onReactedChange:e=>{m&&m(n.id,e)},noSelfUpdate:!!m,commentActionsOverride:Y}),s&&(0,o.Y)(I.Yq,{onClick:Y||(()=>h()),className:L,children:(0,o.FD)(T.pT,{gap:6,alignItems:"center",children:[(0,o.Y)(N.A,{stroke:"var(--color-fg-secondary-themed)",size:16}),(0,o.FD)(B.EY.Meta,{color:"pub-secondary-text",children:[f("Reply"),(null==(t=n.children)?void 0:t.length)>0&&" (".concat(n.children.length,")")]})]})}),!g&&!!p&&(0,o.Y)(I.Yq,{onClick:Y||(()=>p(n.id)),className:L,children:(0,o.FD)(T.pT,{gap:6,alignItems:"center",children:[(0,o.Y)(E.A,{stroke:"var(--color-fg-secondary-themed)",size:16}),(0,o.Y)(B.EY.Meta,{color:"pub-secondary-text",children:f("Share")})]})}),!c&&(0,o.Y)(O,{pub:i,post:l,comment:n,onChange:u})]})};var J=n(43262),z=n(87087),M=n(35369),W=n(16291),H=n(83873),j=n(39318),G=n(82776),V=n(57324),K=n(70515);let q=e=>{var t;let{comment:n,showHiddenComment:i,setShowHiddenComment:r}=e,{iString:l}=(0,w.GO)(),a=null==(t=n.bans)?void 0:t.find(e=>e.publication_id===n.publication_id),s=a&&(0,W.A)(a.expiry).diff((0,W.A)(),"years")>=1,d=(0,K.Pp)(n)&&(n.user_banned_for_comment||n.reported_by_user),c=l(s?"User was indefinitely suspended for this comment. ":"User was temporarily suspended for this comment. "),u=n.user_banned_for_comment?c:l("You reported this comment. ");return d&&(0,o.Y)("div",{className:"comment_notice",children:(0,o.FD)("i",{children:[u,(0,o.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:l,bylines:a,like_count:s,comment_count:d,url:c}=t.reply;return(0,o.FD)("a",{className:"reply-comment",href:(0,j.yRP)(c,{utm_source:V.VU.substack,utm_campaign:V._9.postReplyComment,utm_medium:V.Jn.web}),"data-native":!0,children:[(0,o.Y)("div",{className:"reply-comment-title",children:i}),r&&(0,o.Y)("div",{className:"reply-comment-body",children:(0,G.formatEllipsis)(r)}),(0,o.Y)(B.EY.B4,{weight:"semibold",as:"div",className:"reply-comment-read-more",role:"button",children:n("Read more")}),(0,o.Y)("div",{className:"reply-comment-meta",children:(0,G.getPostEmbedMeta)({date:l,bylines:a,like_count:s,comment_count:d})})]})},X=e=>{let{comment:t,bodyRef:n,expandToggleClicked:i,isLong:r,isExpanded:l}=e;l=l||!r;let[a,s]=(0,Y.useState)(!1),c=(t.user_banned_for_comment||t.reported_by_user)&&!a,{iString:u}=(0,w.GO)(),h=t.age_verification&&t.age_verification.status!==H.Y.CompletedAdult;return(0,o.FD)(o.FK,{children:[(0,o.FD)("div",{className:d()("comment-body",{long:r,expanded:l}),ref:n,children:[(0,o.Y)(q,{comment:t,showHiddenComment:a,setShowHiddenComment:s}),h?(0,o.Y)(J.T,{content:t,description:t.body,source:"comment"}):t.hidden?(0,o.Y)("i",{children:u("Comment hidden")}):t.deleted?(0,o.Y)("i",{children:u("Comment deleted")}):c?(0,o.Y)("i",{}):t.suppressed&&!a?(0,o.Y)("i",{children:u("Comment removed")}):"reply"===t.type?(0,o.Y)(Z,{comment:t}):(0,z.yY)(t.body)]}),r&&!l&&(0,o.Y)(M.$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,l=(0,z.DH)(t),a=(0,ei.gYq)(l,{utm_source:"comment",utm_content:i}),s=null!=n?n:()=>{};return t.user_banned?(0,o.Y)(en.AE,{href:a,onClick:s,children:(0,o.Y)(et.V0,{size:32,icon:(0,o.Y)(ee.A,{stroke:"var(--color-fg-tertiary)"})})}):el(l,r,a,s)}let el=(e,t,n,i)=>t?(0,o.Y)(et.dm,{user:e,size:32,linkProps:{href:n,onClick:i}}):(0,o.Y)(et.tp,{user:e,size:32,linkProps:{href:n,onClick:i}});var ea=n(89490);function eo(e){let{onCollapse:t}=e;return(0,o.Y)(T.VP,{className:"collapser-Xs0O6C",onClick:t,children:(0,o.Y)(ea.az,{className:"threadLine-BvF1wF",animate:!0})})}var es=n(8149),ed=n(50129),ec=n(18947);function eu(){let e=(0,a._)(["Comment by ",""]);return eu=function(){return e},e}let eh=Math.min(Math.ceil((u()(document.body.clientWidth,400,728)-140)/50),10);class ep extends Y.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,a;let{user:s,comment:c,freeSignup:u,freeSignupEmail:h,pub:m,post:g,reaction_token:Y,depth:f,collapseAtDepth:b,onChange:y,scrollRef:v,retainUserCollapseState:_,onStartReply:w,noHoverProfile:C,onProfileClick:S,onShareComment:A,hideContextMenu:F,noRestack:N,updateCommentReacted:E,iString:D,iTemplate:k,hideShare:I,commentActionsOverride:x}=this.props,{isSelected:R,replying:B,editing:P,hideAnchors:L,isCollapsed:O}=null!=(i=this.state)?i:{},J=m.community_enabled&&g&&"none"!==g.write_comment_permissions,{user_banned:W}=c;if(P&&s)return(0,o.Y)($.g,{autoFocus:!0,user:s,freeSignup:u,freeSignupEmail:h,pub:m,post:g,commentBeingEdited:c,saveEdit:this.saveEdit,token:Y,onCancel:()=>this.setState({editing:!1}),onSuccess:y?this.onSaveEditSuccess:null});let H=null==(e=(0,z.DH)(c))?void 0:e.name,j=H?k(eu(),H):D("Comment"),G=this.state.isLong&&!this.state.isExpanded;return(0,o.FD)("div",{className:d()("comment",{selected:R,"post-reply":"reply"===c.type,collapsed:O}),children:[!L&&[(0,o.Y)("div",{id:"comment-".concat(c.id),className:"comment-anchor"}),(0,o.Y)("div",{id:"comment-".concat(c.id,"-reply"),className:"comment-anchor"})],(0,o.FD)(T.fI,{gap:12,paddingBottom:12,className:"comment-content",role:"article","aria-label":j,children:[(0,o.Y)(T.VP,{ref:this.headContainerRef,children:(0,o.Y)(er,{comment:c,noHover:C,onClick:S?()=>S(c):void 0})}),(0,o.FD)(T.VP,{flex:"grow",children:[(0,o.Y)(Q.P,{post:g,pub:m,comment:c,isCollapsed:O,toggleCollapse:()=>this.setCollapsed(!this.state.isCollapsed),onProfileClick:S,userBanned:null!=W&&W,userPendingApproval:c.status===ed.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:F}),(0,o.Y)(X,{comment:c,bodyRef:this.bodyRef,expandToggleClicked:this.expandToggleClicked,isLong:G,isExpanded:this.state.isExpanded}),(0,o.Y)(U,{comment:c,pub:m,user:s,post:g,reaction_token:Y,commentsEnabledForPost:J,noRestack:N,onChange:this.onChange,startReply:()=>this.startReply(),updateCommentReacted:E,shareComment:A,hideShare:I,commentActionsOverride:x}),(0,o.Y)(es.N,{open:B&&J,children:(0,o.Y)(em,{children:(0,o.Y)($.g,{autoFocus:!0,user:s,freeSignup:u,freeSignupEmail:h,pub:m,post:g,parent:c,token:Y,onCancel:()=>this.setState({replying:!1}),onSuccess:y?e=>{this.setState({replying:!1}),y((0,l._)((0,r._)({},c),{children:[e].concat(c.children)}))}:null,alwaysShowButtons:!0})})})]})]}),c.childrenSummary&&(0,o.Y)("div",{className:"more-replies-container",children:(0,o.Y)("a",{className:"more-replies",href:(0,ec.XB)(g,c,m),children:c.childrenSummary})}),!c.childrenSummary&&!p()(f)&&f>=eh&&!!(null==(t=c.children)?void 0:t.length)&&(0,o.Y)(T.fI,{className:"more-replies-container",children:(0,o.Y)(M.vx,{size:"sm",priority:"secondary-outline",href:(0,ec.XB)(g,c,m),children:D("Continue thread →")})}),!c.childrenSummary&&!p()(f)&&f0&&(0,o.Y)(eo,{onCollapse:()=>this.setCollapsed(!0)})]},c.id)}constructor(e,t){super(e,t),(0,i._)(this,"bodyRef",(0,Y.createRef)()),(0,i._)(this,"headContainerRef",(0,Y.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,z.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,a;let{reportCategory:o,reportedToSubstack:s,details:d}=e;await b().post("/api/v1/comment/".concat(n.id,"/report")).send({publication_id:null==t?void 0:t.id,details:d,reportCategory:o,reportedToSubstack:s}),null==(i=(a=this.props).onChange)||i.call(a,(0,l._)((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,A.u4)(A.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,z.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,z.Pm)(this.props.comment.id,e)}),this.state={editing:!1,replying:!1,hideAnchors:!1,isSelected:!1,isCollapsed:this.props.retainUserCollapseState&&(0,z.pz)(this.props.comment.id),isExpanded:!1,isLong:!1}}}(0,i._)(ep,"contextType",_.qL);let em=(0,ea.I4)({display:"flex",flex:"grow",paddingTop:16}),eg=(0,Y.memo)((0,w.wr)(function(e){let t=(0,Y.useContext)(eF),n=(0,y.uc)(),i=(0,C.jN)();return(0,o.Y)(ep,(0,l._)((0,r._)({},e),{commentActions:t,onReport:n,maybeOAuthRequest:i}))}));ep.displayName="Comment_Internal";let eY=5,ef=1,eb=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:l,comments:a,reaction_token:s,depth:c,collapseAtDepth:u,onChange:h,pageSize:p,retainUserCollapseState:m,updateCommentReacted:f,parent:b,scrollRef:y,className:_,onStartReply:C,noHoverProfile:A,onProfileClick:F,hideContextMenu:N,noRestack:E,hideShare:D,commentActionsOverride:k}=e,I=p||eb,[x,T]=(0,Y.useState)(!1),[R,B]=(0,Y.useState)(!1),[P,L]=(0,Y.useState)(I),[O,U]=(0,Y.useState)(-1),[J,z]=(0,Y.useState)(new Set(a.map(e=>{let{id:t}=e;return t}))),[W,H]=(0,Y.useState)(!1),[j,G]=(0,Y.useState)(void 0),{iString:K,iPlural:q}=(0,w.GO)();(0,Y.useEffect)(()=>{O>=0&&window.scrollTo(window.scrollX,O)},[O]);let Z=(0,S._)(e=>{G(e),H(!0)});if(0===(a||[]).length)return null;let[X,$]=g()(null!=a?a:[],e=>{let{id:n,user_id:i}=e;return J.has(n)||i===(null==t?void 0:t.id)}),Q=X.slice(0,P);return(0,o.FD)(o.FK,{children:[(0,o.FD)("div",{className:d()("comment-list",_,{"has-new-comments":$.length>0}),children:[$.length>0&&(0,o.Y)(M.$n,{size:"sm",priority:"secondary-outline",onClick:()=>{setTimeout(()=>{z(new Set(a.map(e=>{let{id:t}=e;return t}))),B(!1)},0),B(!0)},children:R?q("loading 1 new reply","loading %1 new replies",e_($)):q("1 new reply","%1 new replies",e_($))}),(0,o.Y)("div",{className:"comment-list-items",children:Q.map(e=>(0,o.Y)(eg,{user:t,freeSignup:n,freeSignupEmail:i,pub:r,post:l,comment:e,parent:b,reaction_token:s,collapseAtDepth:u,depth:c||0,onChange:h,scrollRef:y,retainUserCollapseState:m,onStartReply:C,noHoverProfile:A,onShareComment:Z,onProfileClick:F,hideContextMenu:N,noRestack:E,updateCommentReacted:f,hideShare:D,commentActionsOverride:k},e.id))}),X.length>Q.length&&(0,o.Y)(M.$n,{size:"sm",priority:"secondary-outline",loading:x,onClick:()=>{U(window.scrollY),setTimeout(()=>{L(P+I),T(!1)},0),T(!0)},children:K("Load More")})]}),(0,o.Y)(v.Z,{isOpen:W,onClose:()=>H(!1),pub:r,post:l,commentId:j,comments:a,user:null!=t?t:void 0,utm_campaign:V._9.commentListShareCta,medium:"web"})]})};ew.displayName="CommentList";let eC=(0,Y.memo)(ew);eC.displayName="CommentList";let eS=eC;function eA(e){let[t,n]=(0,Y.useState)(null),i=(0,Y.useMemo)(()=>({openBanDialog:n}),[]);return(0,o.FD)(eF.Provider,{value:i,children:[(0,o.Y)(eS,(0,r._)({},e)),(0,o.Y)(F.wI,(0,l._)((0,r._)({},t),{onClose:()=>n(null),onBan:(t,n)=>{let{onChange:i}=e;i?i((0,l._)((0,r._)({},t),{user_banned:!0,bans:n.concat(t.bans)})):document.location.href=(0,z.PG)(e.post,e.pub)}}))]})}let eF=(0,Y.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:()=>b,c4:()=>Y,d3:()=>f,d4:()=>y,eu:()=>_,yy:()=>v});var i=n(79785),r=n(17402),l=n(15734),a=n.n(l),o=n(84605),s=n(70145),d=n(68349),c=n(66729),u=n(16291),h=n(50129),p=n(18947);function m(){let e=(0,i._)(["Are you sure you want to unpin this comment?"]);return m=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 Y(){let e=(0,r.useContext)(c.I);if(!e)throw Error("useCommentMenu must be used within a CommentMenuProvider");return e}let f=e=>{var t;let{iString:n}=(0,o.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,l=["moderator_removed","deleted"].includes(e.status),a=e.user_banned_for_comment;return{banText:r?n("Banned"):l?"":n("Suspended"),shouldShowBanText:a}};function b(e){let{comment:t,onChange:n}=e,{iTemplate:i}=(0,o.GO)(),[l,s]=(0,r.useState)(!1),c=!!t.pinned_by_user_id,u=async()=>{if(!l&&window.confirm(c?i(m()):i(g()))&&!l){s(!0);try{await a().patch("/api/v1/comment/".concat(t.id,"/pin")).send({pinned:!c}),n({pinned:!c}),document.location.reload()}catch(e){alert((0,d.uX)(e)),s(!1)}}};return{pinned:c,togglingPin:l,togglePinned:u}}function y(e){let{comment:t,onChange:n}=e,[i,l]=(0,r.useState)(!1),o=w("remove"),s=async()=>{if(!i&&o()){l(!0);try{await a().patch("/api/v1/comment/".concat(t.id,"/status")).send({status:h.nJ.moderator_removed}),n({suppressed:!0,status:h.nJ.moderator_removed,body:null})}catch(e){alert((0,d.uX)(e))}l(!1)}};return{isRemoving:i,removeComment:s}}function v(e){let{comment:t,onChange:n}=e,[i,l]=(0,r.useState)(!1),a=w("delete"),o=(0,s.jN)(),c=async()=>{if(!i&&a()){l(!0);try{await o.delete("/api/v1/comment/".concat(t.id)).send(),n({status:h.nJ.deleted,deleted:!0,user_id:null,name:null,body:null})}catch(e){alert((0,d.uX)(e))}l(!1)}};return{isDeleting:i,deleteComment:c}}function _(e){let{comment:t,post:n,pub:i}=e;return{addCommentToLinear:()=>{let e,r;window.open((e=(0,p.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,o.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 l=[],a=!1,o=new Map(t.map(e=>[e.id,e]));for(let t of n){let n=o.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.bN)(null!=(s=n.reactions)?s:{},null!=(d=t.reactions)?d:{})?(l.push(t),a=!0):l.push(n)}else l.push(t),a=!0}return a?l:t}});var i=n(38123);let r=["edited_at","deleted","status"]},36757:function(e,t,n){n.d(t,{f:()=>l});var i=n(69277),r=n(70408);function l(e,t){var n,l;return function e(t,n,l){let a=n[0];if(!a){let e=t.findIndex(e=>e.id===l.id);return e>=0?t.with(e,l):[...t,l]}let o=t.findIndex(e=>e.id===a);if(o>=0){let a=t[o];if(a.id===l.id)return t.with(o,l);if(a.children)return t.with(o,(0,r._)((0,i._)({},a),{children:e(a.children,n.slice(1),l)}))}return t}(e,null!=(l=null==(n=t.ancestor_path)?void 0:n.split(".").map(Number))?l:[],t)}},87087:function(e,t,n){n.d(t,{DH:()=>b,EQ:()=>Y,PG:()=>g,Pm:()=>y,Wn:()=>m,cx:()=>function e(t,n){for(let[l,a]of t.entries())if(a.id===n.id)return t.with(l,n);else if(a.children){let o=e(a.children,n);if(o!==a.children)return t.with(l,(0,r._)((0,i._)({},a),{children:o}))}return t},jv:()=>p,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:()=>f});var i=n(69277),r=n(70408),l=n(4006),a=n(95201),o=n.n(a),s=n(17186),d=n(39318),c=n(82776);let u="comment-collapse-state",h=function(){try{return(0,s.xm)(u,[])}catch(e){return console.error("Failed to load comment collapse state:",e),[]}}(),p=()=>{if("undefined"!=typeof window&&window.location.hash){let e=/^#comment-(\d+)/.exec(window.location.hash);if(e)return Number(e[1])}return null},m=()=>"undefined"!=typeof window&&"#input"===window.location.hash;function g(e,t,n){return(0,d.yRP)((0,d.wu9)(t,e,{comments:!(0,c.shouldUseInlineComments)(t,e)}),n)}function Y(e,t,n){return(0,d.yRP)("".concat((0,d.$_T)(t),"/embed/comments/").concat(e.id),{access_token:n})}function f(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"p";return(e||"").split("\n").filter(e=>e.trim()).map(e=>(0,l.Y)(t,{children:(0,l.Y)(o(),{options:{validate:{url:e=>!!e&&!e.startsWith("/")},attributes:{rel:"nofollow ugc noopener"}},children:e})}))}let b=e=>{var t,n,i,r,l,a;return{id:e.user_id,slug:"user_slug"in e?e.user_slug:void 0,photo_url:e.photo_url,name:null!=(l=e.name)?l:null,bestseller_tier:e.user_bestseller_tier,status:e.userStatus,primary_publication:e.user_primary_publication,is_free_subscribed:["free_signup, subscribed"].includes(null!=(a=null==(t=e.metadata)?void 0:t.membership_state)?a:""),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)!h.includes(e)&&(n=!0,h.push(e),h.length>250&&h.splice(0,h.length-250));else{let t=h.indexOf(e);t>=0&&(n=!0,h.splice(t,1))}if(n)try{(0,s.X3)(u,h)}catch(e){console.error("Failed to store comment collapse state:",e)}}function v(e){return h.includes(e)}},51131:function(e,t,n){n.d(t,{D:()=>h,l:()=>p});var i=n(4006),r=n(84605),l=n(6049),a=n(68349),o=n(24078),s=n(35369),d=n(76977),c=n(63136),u=n(2890);let h=e=>{let{avatarUrl:t,name:n,url:a}=e,{iString:o}=(0,r.GO)();return(0,i.FD)(l.jJ,{gap:12,style:{padding:"16px",border:"1px solid #E0E0E0",borderRadius:"8px",margin:"0 auto 20px"},children:[(0,i.FD)(l.ZB,{gap:12,children:[(0,i.Y)(l.Kb,{src:t,size:40}),(0,i.FD)(l.jJ,{children:[(0,i.FD)(c.EY.H4,{translated:!0,size:14,paddingBottom:4,color:"pub-primary-text",children:["Book a meeting with ",I18N.p(n)]}),(0,i.Y)(c.EY.B4,{translated:!0,color:"pub-secondary-text",children:"Schedule a meeting"})]})]}),(0,i.Y)(l.M_,{tableClassName:u.A.emailButton,href:a,children:o("Book meeting")})]})},p=e=>{let{avatarUrl:t,name:n,url:l}=e,{iString:h}=(0,r.GO)();return(0,i.FD)(d.pT,{direction:{mobile:"column",desktop:"row"},radius:"md",padding:24,alignItems:"center",className:u.A.container,justifyContent:"space-between","data-component-name":"MeetingEmbed",children:[(0,i.FD)(d.Ye,{className:u.A.header,gap:16,paddingBottom:{mobile:20,desktop:0},children:[(0,i.Y)(o.eu,{photoUrl:t,size:40}),(0,i.FD)("div",{children:[(0,i.FD)(c.EY.H4,{translated:!0,paddingBottom:4,color:"pub-primary-text",children:["Book a meeting with ",I18N.p(n)]}),(0,i.Y)(c.EY.B4,{translated:!0,color:"pub-secondary-text",children:"Schedule a meeting"})]})]}),(0,i.Y)(s.$n,{className:u.A.cta,priority:"primary",onClick:()=>{(0,a.V2)(l,{newTab:!0})},children:h("Book meeting")})]})}},82286:function(e,t,n){n.d(t,{Xn:()=>a});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 l=n(75303);function a(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,l.I4)({display:"flex",direction:"column",gap:16}),(0,l.I4)({display:"flex",direction:{desktop:"row",mobile:"column"},gap:12,alignItems:{desktop:"center",mobile:"stretch"},justifyContent:{desktop:"space-between",mobile:void 0}}),(0,l.I4)({display:"flex",direction:"column",minHeight:280}),(0,l.I4)({display:"flex",direction:"column",gap:32}),(0,l.I4)({display:"flex",direction:"row",gap:12,alignItems:"center",justifyContent:"space-between",wrap:"wrap"}),(0,l.I4)({display:"flex",wrap:"wrap",direction:"row",gap:12,alignItems:"center"})},19256:function(e,t,n){n.d(t,{_:()=>m});var i=n(4006),r=n(67078),l=n(17402),a=n(84605),o=n(86500),s=n(89490),d=n(35369),c=n(76977),u=n(16993),h=n(63136),p=n(49807);let m=e=>{let{isOpen:t,onClose:n,profile:m,dmUpgradeOptions:g,isEditor:Y=!1}=e,{iString:f}=(0,a.GO)();(0,l.useEffect)(()=>{(0,o.u4)(o.qY.DIRECT_MESSAGE_WRITER_UPSELL_MODAL_SEEN,{subscribeButtonShown:_})},[]);let b=null==m?void 0:m.primaryPublication,y=g?g.includes("free_subscribers")?"free_subscribers":g.includes("paid_subscribers")?"paid_subscribers":g.includes("founding_subscribers")?"founding_subscribers":null:null,v=y?(e=>{switch(e){case"free_subscribers":return"Subscribers";case"paid_subscribers":return"Paid subscribers";case"founding_subscribers":return"Founding members"}})(y):null,_=v&&(Y||!Y&&b),w="founding_subscribers"===y?{plan:"founding",utm_source:"direct-message-writer"}:void 0,C=!Y&&b?(0,p.eV6)(b,{addBase:!Y,params:w}):(0,p.eV6)({},{addBase:!1,params:w}),S=(0,s.iF)({width:200});return(0,i.Y)(u.aF,{isOpen:t,onClose:n,children:(0,i.Y)(u.cw,{children:(0,i.FD)(c.I1,{gap:16,alignItems:"center",children:[(0,i.Y)(s.az,{bg:"secondary",radius:"full",padding:16,children:(0,i.Y)(r.A,{size:32})}),(0,i.FD)(c.I1,{gap:8,alignItems:"center",padding:8,children:[!!v&&(0,i.FD)(h.EY.B1,{children:[v," only"]}),!!v&&(0,i.Y)(h.EY.B3,{color:"secondary",align:"center",children:f("".concat(null==m?void 0:m.name," only accepts messages from ").concat(null==v?void 0:v.toLowerCase()))}),!v&&(0,i.Y)(h.EY.B3,{color:"secondary",align:"center",children:f("".concat(null==m?void 0:m.name," is not currently accepting message invites"))})]}),(0,i.FD)(c.I1,{gap:8,alignItems:"center",padding:8,children:[_&&(0,i.FD)(i.FK,{children:[(0,i.Y)(d.$n,{className:S,priority:"primary",href:C,newTab:!0,children:f((null==m?void 0:m.isSubscribed)?"Upgrade":"Subscribe")}),(0,i.Y)(d.$n,{className:S,onClick:()=>{(0,o.u4)(o.qY.DIRECT_MESSAGE_WRITER_UPSELL_MODAL_MAYBE_LATER_CLICKED),n()},priority:"secondary",children:f("Maybe later")})]}),!_&&(0,i.Y)(d.$n,{className:S,onClick:()=>{(0,o.u4)(o.qY.DIRECT_MESSAGE_WRITER_UPSELL_MODAL_OKAY_CLICKED),n()},priority:"secondary",children:f("Okay")})]})]})})})}},3046:function(e,t,n){n.d(t,{Ac:()=>D,Nf:()=>S,T_:()=>T,XK:()=>L,Xx:()=>F,YX:()=>P,ZT:()=>E,Zh:()=>N,b5:()=>k,dU:()=>A});var i=n(69277),r=n(70408),l=n(32641),a=n(4006),o=n(32485),s=n.n(o),d=n(14792),c=n.n(d);n(83673);var u=n(82853);n(18993);var h=n(8853),p=n(38685);n(66443),n(94090);var m=n(33764);n(82936),n(84605);var g=n(46275);n(10398),n(94729),n(24078),n(15040);var Y=n(17028),f=n(97515);n(45859);var b=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,a.Y)(Y.az,{paddingX:12,children:(0,a.Y)(Y.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 A=(0,Y.I4)({className:C.A.messageBubbleGroup,position:"relative",gap:2},v.VP);function F(e){let{direction:t,isLink:n,backgroundColor:i,isAuthorContributor:r}=e,l="incoming"===t&&r,o="".concat(i,"1A");return(0,a.FD)("svg",{viewBox:"0 0 16 13",className:s()(C.A.bubbs,C.A[t],n&&C.A.isLink,r&&C.A.author),style:l?{fill:o}:{},children:[(0,a.Y)("circle",{cx:"5",cy:"5",r:"5",className:C.A.bubb}),(0,a.Y)("circle",{cx:"13.5",cy:"10.5",r:"2.5",className:C.A.bubb}),l&&(0,a.FD)(a.FK,{children:[(0,a.Y)("circle",{cx:"5",cy:"5",r:"5",fill:o}),(0,a.Y)("circle",{cx:"13.5",cy:"10.5",r:"2.5",fill:o})]})]})}function N(e){var{messageDirection:t,isFirst:n=!1,isLast:o=!1,forceTheme:d,pubThemeAccentColor:u,isAuthorContributor:h,className:p}=e,m=(0,l._)(e,["messageDirection","isFirst","isLast","forceTheme","pubThemeAccentColor","isAuthorContributor","className"]);let g="incoming"===t&&h,f=g&&u;return(0,a.Y)(Y.fI,(0,r._)((0,i._)({},m),{className:s()(C.A.bubble,C.A[t],n&&C.A.isFirst,o&&C.A.isLast,d&&C.A["force".concat(c()(d),"Theme")],g&&C.A.author,p),style:{"--color-chat-author-bg-overlay":f?"".concat(u,"1A"):"oklch(from var(--color-bg-accent-themed) l c h / 0.1)"}}))}function E(e){let{metadata:t,publication:n,direction:i,isFirst:r,isLast:l}=e,o=D(t.url);return o?(0,a.Y)(N,{messageDirection:i,isFirst:r,isLast:l,maxWidth:400,forceTheme:"incoming",outline:"detail",children:(0,a.Y)(I,{videoId:o})}):(0,a.Y)(N,{as:"a",href:t.url,target:"_blank",rel:"nofollow noopener ugc",messageDirection:i,isFirst:r,isLast:l,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,a.Y)(R,{publication:n,metadata:t}):(0,a.Y)(T,{metadata:t})})}function D(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 k(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(tp,x:()=>h});var i=n(69277),r=n(70408),l=n(4006),a=n(84605),o=n(16074),s=n(76977),d=n(63136),c=n(67140),u=n(5955);function h(e){return(0,l.Y)(s.VP,{gap:8,children:(0,l.Y)(p,(0,r._)((0,i._)({},e),{separator:(0,l.Y)(o.c,{})}))})}function p(e){let{date:t,replyCount:n,retweetCount:i,likeCount:r,impressionCount:o,separator:s}=e,{iCombo:h}=(0,a.GO)(),p=n>0||i>0||r>0,Y=n>0&&i>0,f=(n>0||i>0)&&r>0;return(0,l.FD)(l.FK,{children:[(0,l.FD)(d.EY.B4,{color:"secondary",children:[(0,l.Y)(m,{children:(0,u.hV)(t)}),o>0&&(0,l.FD)(l.FK,{children:[(0,l.Y)(g,{}),(0,l.FD)(m,{children:[(0,c.V)(o,"number-truncated")," ",h("tweetStats","View","Views",o)]})]})]}),p&&s,p&&(0,l.FD)(d.EY.B4,{color:"secondary",children:[n>0&&(0,l.FD)(m,{children:[(0,c.V)(n,"number-truncated")," ",h("tweetStats","Reply","Replies",n)]}),Y&&(0,l.Y)(g,{}),i>0&&(0,l.FD)(m,{children:[(0,c.V)(i,"number-truncated")," ",h("tweetStats","Repost","Reposts",i)]}),f&&(0,l.Y)(g,{}),r>0&&(0,l.FD)(m,{children:[(0,c.V)(r,"number-truncated")," ",h("tweetStats","Like","Likes",r)]})]})]})}function m(e){let{children:t}=e;return(0,l.Y)(d.EY,{as:"span",children:t})}function g(){return(0,l.Y)(m,{children:" \xb7 "})}},5955:function(e,t,n){n.d(t,{Wk:()=>a,hV:()=>l,sK:()=>o});var i=n(16291),r=n(49807);function l(e){return(0,i.A)(e).format("h:mm A \xb7 MMM D, YYYY")}function a(e,t){return"".concat(r.w4p,"/image/twitter_name/w_").concat(2*t,"/").concat(e,".jpg")}function o(e){return e?"X avatar for @".concat(e):"X avatar"}},56689:function(e,t,n){n.d(t,{c:()=>i});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