(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["3473"],{31190:function(e,t,i){"use strict";i.d(t,{Z:()=>n});let n={closeWelcomeModal:"closeWelcomeModal-KVUfKQ",maybeLater:"maybeLater-PlK9NK",publicationCoverPhotoLeft:"publicationCoverPhotoLeft-txdH2G",publicationCoverPhotoRight:"publicationCoverPhotoRight-RHPl8T",largePublicationCoverPhotoRight:"largePublicationCoverPhotoRight-A77S35",column:"column-_rp_8U",largeColumn:"largeColumn-bqn6Me",centeredColumn:"centeredColumn-M8Fujf",largeCenteredColumn:"largeCenteredColumn-AfeswM",hideColumnSmallScreens:"hideColumnSmallScreens-rlLOgZ",hideLargeColumnSmallScreens:"hideLargeColumnSmallScreens-LQBTX8",publicationCoverPhotoCenter:"publicationCoverPhotoCenter-rMU5R1",publicationLogo:"publicationLogo-EWjoMq",coverPrimary:"coverPrimary-cGRhhL",coverSecondary:"coverSecondary-pfbfwO",blurbImage:"blurbImage-bS0Pkx",containerClassName:"containerClassName-iHFmrN",promptClassName:"promptClassName-fM9VHe",inputClassName:"inputClassName-v5NZvy",subscribeButtonClassName:"subscribeButtonClassName-wpxkEl",largeHeading:"largeHeading-ZEJJF0",largeSubHeading:"largeSubHeading-lGmUwg",largePromptClassName:"largePromptClassName-Uexj1F",largeInputWrapperClassName:"largeInputWrapperClassName-VqAUAb",largeInputClassName:"largeInputClassName-zCK22A",largeSubscribeButtonClassName:"largeSubscribeButtonClassName-gTO6Dt",postContainer:"postContainer-iqizM2",postTitle:"postTitle-uVmG1_",postSubtitle:"postSubtitle-sIac6Y",postImage:"postImage-nsvz_r",faces:"faces-igzFCe",face:"face-G_PpVO",first:"first-bCHdQ8",last:"last-GRcjMY",bigSubtitle:"bigSubtitle-o28Z4u",balancedText:"balancedText-oQ__Kv",tosLink:"tosLink-n6HoHl",blurbText:"blurbText-isJ4mY",tosText:"tosText-yAQHNw"}},56029:function(e,t,i){var n=i(33448);e.exports=function(e,t,i){for(var r=-1,l=e.length;++rt}},84753:function(e,t,i){var n=i(56029),r=i(53325),l=i(67206);e.exports=function(e,t){return e&&e.length?n(e,l(t,2),r):void 0}},43174:function(e,t,i){var n=i(55189)(function(e,t,i){e[+!i].push(t)},function(){return[[],[]]});e.exports=n},91925:function(e,t,i){"use strict";i.d(t,{s:()=>l});var n=i(16584),r=i(4615);function l(e){let{children:t}=e;return(0,n.tZ)(r.f6,{theme:"coverTheme-PJLqY5",children:t})}},35047:function(e,t,i){"use strict";i.d(t,{ED:()=>K,Eh:()=>j,ZP:()=>q,sv:()=>V});var n=i(7409),r=i(99282),l=i(58865),a=i(16584),o=i(98661),s=i(30396),c=i(94184),d=i.n(c),u=i(36808),h=i(2564),p=i(71375),m=i(91925),b=i(12620),g=i(64343),f=i(21312),v=i(20888),_=i(75744),Z=i(57391),y=i(95441),w=i(56629),N=i(40647),S=i(35702),P=i(68833),k=i(98914),x=i(71068),C=i(15771),B=i(19081),E=i(38841),T=i(58175),I=i(64528),L=i(55722),X=i(74312),R=i(34590),A=i(31377),F=i(60308),z=i(26111),D=i(6911),W=i(70408),H=i(84864),O=i(47929),U=i(31190);function M(){let e=(0,l._)(["By ",""]);return M=function(){return e},e}let J="intro_popup_last_hidden_at";function V(e){let{includePrice:t=!0,includeRankingDetail:n=!0,includeByline:r=!0,includeBadge:l=!1,rankingDetailOverrideText:o=null,language:s="en"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=s||e.language,{iTemplate:d}=I18N.i(s||e.language),u=(0,H.getByLine)(e),h=null;return n&&(h=o||(e.rankingDetailByLanguage&&"en"!==c&&e.rankingDetailByLanguage[c]?e.rankingDetailByLanguage[c].rankingDetail:e.rankingDetail)),(0,a.BX)(I.N,{separator:" \xb7 ",children:[r&&u?(0,a.BX)(B.hs,{inline:!0,gap:4,children:[d(M(),u),l&&(0,a.tZ)(X.cr,{module:"../pencraft/unstable/UserBadge",resolve:e=>e.UserBadge,onRequest:()=>Promise.all([i.e("565"),i.e("6384")]).then(i.bind(i,87989)),size:"sm",tier:e.author_bestseller_tier,userId:e.author_id,whileLoading:e.author_bestseller_tier?(0,a.tZ)(B.hs,{alignItems:"center",children:(0,a.tZ)(L.o,{size:"sm",tier:e.author_bestseller_tier})}):(0,a.tZ)(a.HY,{})})]}):null,h,t&&function(e,t){let{language:i}=t,n=!e.disable_monthly_subscriptions&&e.plans&&e.plans.filter(e=>"month"===e.interval).sort((e,t)=>e.amount-t.amount)[0],r=!e.disable_annual_subscriptions&&e.plans&&e.plans.filter(e=>"year"===e.interval).sort((e,t)=>e.amount-t.amount)[0],l=n||r;if(l)return(0,R.bP)(l,{language:i})}(e,{language:s})]})}let q=(0,o.memo)(e=>{var t,i,l;let{publication:o,user:c,post:d,onHide:h,freeSignup:p,hidden:b,alwaysShow:g,showOnMount:f,freeSignupEmail:v,email:_,referralCode:y,blurbs:x,launchWelcomePage:C,topThreePosts:B,topThreeSubscribers:E}=e,{getConfigFor:T}=(0,N.xR)(),I=T("welcome_page_query_params"),[L,X]=(0,s.eJ)(!1),[R,D]=(0,s.eJ)(!!(C||g)),W=(e,t)=>{var i;return I&&null!==(i=(0,z.x)(e))&&void 0!==i?i:t},[U]=(0,s.eJ)(W("no_skip",void 0)),[M]=(0,s.eJ)(W("no_blurbs",!1)),[V]=(0,s.eJ)(()=>{let e=W("hero_text",void 0);return e?decodeURIComponent(e):void 0}),{getExperimentVariant:q,exposeExperiment:j}=(0,Z.jc)(),{getSettingFor:Q}=(0,w.So)(),$=null!==(t=(0,z.x)("force"))&&void 0!==t?t:void 0;(0,s.d4)(()=>{let e=e=>{"Escape"===e.key&&en(!0)};if(R)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[R]),(0,s.d4)(()=>{if(C&&!er()||et()){if("undefined"!=typeof window&&(0,k.cn)(document.documentElement,"has-intro-popup"),(0,z.x)("r")){let e=(0,z.x)("r");c&&(0,H.userReferralKey)(c)===e||(0,P.j)(P.FP.COVER_PAGE_REFERRAL_VISIT,{referral_key:e,referring_user:(0,H.userFromReferralKey)(e)})}ee()}else h&&h(),(0,S.a)({hide_intro_popup:!0}),"undefined"!=typeof window&&(0,k.IV)(document.documentElement,"has-intro-popup"),!g&&"undefined"!=typeof window&&(0,k.pv)(document.documentElement,"show-intro-popup")&&(0,k.IV)(document.documentElement,"show-intro-popup");return["no_skip","no_blurbs","hero_text","hide_intro_popup"].forEach(e=>(0,k.iO)(e)),()=>{"undefined"!=typeof window&&(0,k.IV)(document.documentElement,"has-intro-popup"),en(!0)}},[]);let ee=()=>{"undefined"==typeof window||((0,k.cn)(document.documentElement,"show-intro-popup"),(0,P.j)(P.FP.COVER_PAGE_SHOWN,{has_cover_photo:!!o.cover_photo_url,has_free_signup_email:!!v,has_free_signup:!!p,functional_version:!0,launch_welcome_page:C,always_show:g,hidden:b,screen_height:"undefined"!=typeof window?window.innerHeight:null,screen_width:"undefined"!=typeof window?window.innerWidth:null,test_experiment_variant_v5:q("test_experiment_v5")}),j("test_experiment_v5"),g||(0,P.XY)("pageview",{dl:"".concat(document.location.origin,"/welcome").concat(document.location.search)})),D(!0)},et=(0,s.I4)(()=>!!g||!b&&(!!f||!!L||!er()&&!!(null==d||d&&!(0,A.isPaidAudience)(d.audience))&&!p&&(!c||!c.is_free_subscribed&&!c.is_subscribed)),[g,p,b,d,f,L,c]),ei=Q("display_welcome_page_details")&&o.freeSubscriberCount&&!(0,k.K1)()&&!$&&!o.invite_only&&!y&&!o.custom_domain&&(null==B?void 0:B.length)&&(null==E?void 0:E.length)&&!U&&!V;(0,s.d4)(()=>{R&&et()&&ei&&j("welcome_page_update_desktop_visuals_limited")},[j,Q,ei,et,R]);let en=e=>{e||(el(),setTimeout(()=>{(0,S.a)({hide_intro_popup:!0})},500)),h&&h(),!g&&"undefined"!=typeof window&&(0,k.pv)(document.documentElement,"show-intro-popup")&&(0,k.IV)(document.documentElement,"show-intro-popup")},er=()=>{let e=u.get(J);return!!(e&&new Date(e)>new Date(Date.now()-864e5))},el=()=>{u.set(J,new Date().toJSON(),{expires:3650})},ea=async e=>{(0,P.j)(P.FP.COVER_PAGE_EMAIL_SUBMITTED,{is_paying_sub:!!e.body.prompt_to_login,has_plans:!!o.plans,functional_version:!0,homepage_type:o.homepage_type}),el(),X(!0),(0,S.a)({freeSignup:!0,freeSignupEmail:e.body.email});let t=g?"/":document.location.href;e.body.prompt_to_login?setTimeout(()=>{document.location.href=(0,F.n1t)("/account/login",{redirect:t,email:e.body.email})},30):document.location.href=(0,F.n1t)("/subscribe",(0,r._)((0,n._)({next:t,later:!0,just_signed_up:!0},e.body.subscription_id&&{subscription_id:e.body.subscription_id},e.body.referral_token&&{referral_token:e.body.referral_token}),{requires_confirmation:e.body.requires_confirmation?"true":"",utm_source:O.b3.coverPage,email:e.body.email,skip_redirect_check:!0}))},eo=()=>{(0,P.j)(P.FP.COVER_PAGE_MAYBE_LATER_CLICKED,{functional_version:!0}),en()};if(!R||!et())return null;let es=(0,a.tZ)(K,{source:"cover_page",email:_,pub:o,user:null!=c?c:null,freeSignup:p,freeSignupEmail:v,referralCode:y,forceSignup:null!==(l=null!==(i=(0,z.x)("force"))&&void 0!==i?i:U)&&void 0!==l?l:void 0,onMaybeLater:U?void 0:eo,onFreeSignup:ea,blurbs:x,hideBlurbs:M,overrideSubtitle:V});if(ei)switch(q("welcome_page_update_desktop_visuals_limited")){case"treatment_social_proof":es=(0,a.tZ)(G,{email:_,pub:o,user:null!=c?c:null,freeSignup:p,freeSignupEmail:v,onMaybeLater:eo,onFreeSignup:ea,blurbs:x,topThreeSubscribers:E});break;case"treatment_large_fonts":es=(0,a.tZ)(Y,{email:_,pub:o,user:null!=c?c:null,freeSignup:p,freeSignupEmail:v,onMaybeLater:eo,onFreeSignup:ea,blurbs:x})}return(0,a.tZ)(m.s,{children:(0,a.tZ)("div",{className:"intro-popup",children:(0,a.tZ)("div",{className:"intro-popup-page",children:es})})})}),j=e=>(0,a.tZ)("div",{className:"intro-inline",children:(0,a.tZ)(K,(0,n._)({},e))}),G=e=>{var t,r,l,o,c;let{pub:u,user:h,email:p,freeSignup:m,freeSignupEmail:Z,onMaybeLater:N,onFreeSignup:S,blurbs:k,topThreeSubscribers:C}=e,I="cover_page",L=(0,s.qp)(w.vz),{iString:R,language:A}=(0,y.M1)(),{title:z,subtitle:D,logoUrl:H,coverPhotoUrl:O,hideTitle:M,hideSubtitle:J}=Q(u),q=O&&(0,F.zJH)(O),j=q&&q.width/q.height,G=!!(j&&j<2),Y=!M||O&&G,K=!J||O&&G;(0,s.d4)(()=>{(0,P.j)(P.FP.FULL_EMAIL_FORM_SHOWN,{source:I,functional_version:!0,version:"social-proof"})},[I]);let $=k?k.filter(e=>""!=e.description):[],et=V(u,{includePrice:!1,includeBadge:!0,includeRankingDetail:!1,language:A});return(0,a.BX)("div",{className:"full-email-form",children:[(0,a.BX)("div",{className:"vertically-centered",children:[(0,a.tZ)(ee,{onClick:N}),O?G?null:(0,a.tZ)(x.xu,{paddingBottom:48,children:(0,a.tZ)(v.e,{className:U.Z.publicationCoverPhotoCenter,src:O,imageProps:{quality:"auto:best"},maxWidth:840,loading:"eager",style:(0,n._)({},q&&q.width&&{height:"min(168px, ".concat(840*q.height/q.width,"px)")}),imageIsFixedWidth:!0})}):H&&(0,a.tZ)(x.xu,{paddingBottom:32,children:(0,a.tZ)(E.wk,{logoUrl:H,size:88})}),(0,a.BX)(B.hs,{gap:48,children:[(0,a.BX)(B.tu,{className:G?U.Z.column:U.Z.centeredColumn,gap:32,children:[(0,a.BX)(B.tu,{gap:16,children:[Y?(0,a.tZ)(T.xv.H1,{textAlign:G?"left":"center",font:"pub-headings",className:U.Z.coverPrimary,textWrap:"balance",children:z}):null,K?(0,a.tZ)(T.xv.B3,{textAlign:G?"left":"center",font:"display",size:15,lineHeight:20,className:U.Z.coverSecondary,textWrap:"balance",children:D}):null,et&&(null===(o=et.props)||void 0===o?void 0:null===(l=o.children)||void 0===l?void 0:null===(r=l.filter)||void 0===r?void 0:null===(t=r.call(l,Boolean))||void 0===t?void 0:t.length)?(0,a.tZ)(T.xv.B2,{textAlign:G?"left":"center",weight:"semibold",font:"display",size:17,lineHeight:24,className:U.Z.coverSecondary,children:et}):null]}),(0,a.BX)(B.tu,{gap:16,children:[(0,a.BX)(B.hs,{alignItems:"center",alignSelf:G?"start":"center",gap:8,children:[(0,a.tZ)(B.hs,{alignItems:"center",className:d()(U.Z.faces),children:C.map((e,t)=>{let{id:n,photo_url:r}=e,l=(0,a.tZ)(v.e,{className:d()(U.Z.face,0===t&&U.Z.first,t===C.length-1&&U.Z.last),style:{zIndex:C.length-t},maxWidth:80,src:(0,F.zF4)(r||(0,W.I4)(n),64),imageIsFixedWidth:!0});return(0,a.tZ)(X.cr,{module:"@/frontend/components/ProfileHoverCard",resolve:e=>e.ProfileHoverCard,onRequest:()=>Promise.all([i.e("8173"),i.e("135"),i.e("6566"),i.e("7390"),i.e("565"),i.e("7493"),i.e("5924"),i.e("7337"),i.e("640"),i.e("1262"),i.e("8523"),i.e("9918")]).then(i.bind(i,85685)),whileLoading:l,subject:e,dontStopPropagation:!1,disabled:!1,placement:"top-start",children:l})})}),u.freeSubscriberCount?(0,a.BX)(T.xv.H3,{font:"display",weight:"semibold",size:20,lineHeight:24,className:U.Z.coverPrimary,translated:!0,children:["Join over ",I18N.p(u.freeSubscriberCount)," subscribers"]}):null]}),(0,a.tZ)(b.Z,{email:p,isWelcomePageColor:!0,freeSignup:m,freeSignupEmail:Z,pub:u,source:I,user:h,onConfirmationRequired:"enabled"===u.payments_state?()=>null:void 0,onSuccess:S||(()=>document.location.href="/"),autoFocus:!0,className:U.Z.containerClassName,promptClassName:U.Z.promptClassName,inputClassName:U.Z.inputClassName,subscribeButtonClassName:U.Z.subscribeButtonClassName}),(0,a.BX)(B.hs,{gap:4,cursor:"pointer",alignItems:"center",alignSelf:G?"start":"center",inline:!0,onClick:N,children:[(0,a.tZ)(T.xv.B3,{style:{color:"var(--cover_print_secondary)"},children:"No thanks"===L.getSettingFor("welcome_page_opt_out_text")?R("No thanks"):null!==(c=L.getSettingFor("welcome_page_opt_out_text"))&&void 0!==c?c:R("No thanks")}),(0,a.tZ)(g.Z,{height:18,stroke:"var(--cover_print_secondary)",strokeWidth:2})]})]})]}),O&&G?(0,a.tZ)(B.tu,{className:d()(U.Z.column,U.Z.hideColumnSmallScreens),gap:32,children:(0,a.tZ)(v.e,{className:U.Z.publicationCoverPhotoRight,src:O,imageProps:{quality:"auto:best"},maxWidth:476,loading:"eager",imageIsFixedWidth:!0})}):null]}),!!(null==$?void 0:$.length)&&(0,a.tZ)("div",{className:"blurb-buffer"}),!!(null==$?void 0:$.length)&&(0,a.tZ)(B.gq,{className:"blurbs",gap:20,children:$.map(e=>(0,a.BX)(B.tu,{gap:8,className:"blurb",children:[(0,a.tZ)(T.xv.B4,{className:"blurb-text",children:(0,a.tZ)(f.Z,{maxLines:4,ellipsesText:"...”",text:"“".concat(e.description,"”")})}),(0,a.BX)(T.xv.B4,{weight:"semibold",className:"blurb-text",children:[e.author_name||e.recommendingPublication.email_from_name||e.recommendingPublication.copyright,", ",(0,a.tZ)("a",{href:(0,F.SVA)(e.recommendingPublication),children:e.recommendingPublication.name})]})]}))})]}),(0,a.tZ)(_.fJ,{publication:u})]})},Y=e=>{var t;let{pub:i,user:r,email:l,freeSignup:o,freeSignupEmail:c,onMaybeLater:u,onFreeSignup:h,blurbs:p}=e,m="cover_page",Z=(0,s.qp)(w.vz),{getSettingFor:N}=(0,w.So)(),{iString:S,language:k}=(0,y.M1)(),{title:C,subtitle:I,logoUrl:L,coverPhotoUrl:X,hideTitle:R,hideSubtitle:A}=Q(i),z=X&&(0,F.zJH)(X),D=z&&z.width/z.height,W=!!(D&&D<2),H=!R||X&&W,O=!A||X&&W;(0,s.d4)(()=>{(0,P.j)(P.FP.FULL_EMAIL_FORM_SHOWN,{source:m,functional_version:!0,version:"large-fonts"})},[m]);let M=p?p.filter(e=>""!=e.description):[],J=N("display_welcome_page_details");return(0,a.BX)("div",{className:"full-email-form",children:[(0,a.BX)("div",{className:"vertically-centered",children:[(0,a.tZ)(ee,{onClick:u}),X?W?null:(0,a.tZ)(x.xu,{paddingBottom:48,children:(0,a.tZ)(v.e,{className:U.Z.publicationCoverPhotoCenter,src:X,imageProps:{quality:"auto:best"},maxWidth:840,loading:"eager",style:(0,n._)({},z&&z.width&&{height:"min(168px, ".concat(840*z.height/z.width,"px)")}),imageIsFixedWidth:!0})}):L&&(0,a.tZ)(x.xu,{paddingBottom:32,children:(0,a.tZ)(E.wk,{logoUrl:L,size:88})}),(0,a.BX)(B.hs,{gap:48,children:[(0,a.BX)(B.tu,{className:W?U.Z.largeColumn:U.Z.largeCenteredColumn,gap:32,children:[(0,a.BX)(B.tu,{gap:16,children:[H?(0,a.tZ)(T.xv.H1,{textAlign:W?"left":"center",font:"pub-headings",className:d()(U.Z.coverPrimary,U.Z.largeHeading),textWrap:"balance",children:C}):null,O?(0,a.tZ)(T.xv.B3,{textAlign:W?"left":"center",font:"display",size:15,lineHeight:20,className:d()(U.Z.coverSecondary,U.Z.largeSubHeading),textWrap:"balance",children:I}):null,(0,a.tZ)(T.xv.B2,{textAlign:"left",weight:"semibold",font:"display",size:17,lineHeight:24,className:U.Z.coverSecondary,alignSelf:W?"start":"center",children:V(i,{includePrice:!1,includeBadge:!0,rankingDetailOverrideText:i.rankingDetailFreeSubscriberCount,includeRankingDetail:!!J,language:k})})]}),(0,a.BX)(B.tu,{gap:16,children:[(0,a.tZ)(b.Z,{email:l,isWelcomePageColor:!0,freeSignup:o,freeSignupEmail:c,pub:i,source:m,user:r,onConfirmationRequired:"enabled"===i.payments_state?()=>null:void 0,onSuccess:h||(()=>document.location.href="/"),autoFocus:!0,className:U.Z.containerClassName,promptClassName:U.Z.largePromptClassName,inputClassName:U.Z.largeInputClassName,inputWrapperClassName:U.Z.largeInputWrapperClassName,subscribeButtonClassName:U.Z.largeSubscribeButtonClassName}),(0,a.BX)(B.hs,{gap:4,cursor:"pointer",alignItems:"center",alignSelf:"center",inline:!0,onClick:u,children:[(0,a.tZ)(T.xv.B1,{size:20,lineHeight:30,weight:"semibold",style:{color:"var(--cover_print_secondary)"},children:"No thanks"===Z.getSettingFor("welcome_page_opt_out_text")?S("No thanks"):null!==(t=Z.getSettingFor("welcome_page_opt_out_text"))&&void 0!==t?t:S("No thanks")}),(0,a.tZ)(g.Z,{height:18,stroke:"var(--cover_print_secondary)",strokeWidth:2})]})]})]}),X&&W?(0,a.tZ)(B.tu,{className:d()(U.Z.largeColumn,U.Z.hideLargeColumnSmallScreens),gap:32,children:(0,a.tZ)(v.e,{className:U.Z.largePublicationCoverPhotoRight,src:X,imageProps:{quality:"auto:best"},maxWidth:568,loading:"eager",imageIsFixedWidth:!0})}):null]}),!!(null==M?void 0:M.length)&&(0,a.tZ)("div",{className:"blurb-buffer"}),!!(null==M?void 0:M.length)&&(0,a.tZ)(B.gq,{className:"blurbs",gap:20,children:M.map(e=>(0,a.BX)(B.tu,{gap:8,className:"blurb",children:[(0,a.tZ)(T.xv.B4,{className:"blurb-text",children:(0,a.tZ)(f.Z,{maxLines:4,ellipsesText:"...”",text:"“".concat(e.description,"”")})}),(0,a.BX)(T.xv.B4,{weight:"semibold",className:"blurb-text",children:[e.author_name||e.recommendingPublication.email_from_name||e.recommendingPublication.copyright,", ",(0,a.tZ)("a",{href:(0,F.SVA)(e.recommendingPublication),children:e.recommendingPublication.name})]})]}))})]}),(0,a.tZ)(_.fJ,{publication:i})]})},K=e=>{var t;let{autoFocus:r=!0,pub:l,user:o,email:c,freeSignup:u,freeSignupEmail:p,referralCode:m,source:g,forceSignup:v,submitButtonText:_,onMaybeLater:Z,onFreeSignup:N,blurbs:S,hideBlurbs:k,overrideSubtitle:x}=e,E=(0,s.qp)(w.vz),{iString:I}=(0,y.M1)(),L=(0,z.x)("referralCode"),R=(0,z.x)("refSource"),A=I("Learn More"),W=(0,F.d6h)(l,{params:(0,n._)({utm_source:O.b3.subscribeEmail,utm_content:O.fZ.learnMore},L&&{referralCode:L},R&&{refSource:R})});(0,s.d4)(()=>{"subscribe_page"===g&&(0,P.j)(P.FP.SUBSCRIBE_EMAIL_FULL_SCREEN_SHOWN,{functional_version:!0}),(0,P.j)(P.FP.FULL_EMAIL_FORM_SHOWN,{source:g,functional_version:!0})},[g]);let H=S&&!k?S.filter(e=>""!=e.description):[];return(0,a.tZ)("div",{className:"full-email-form",children:(0,a.BX)("div",{className:"vertically-centered",children:[Z&&!l.invite_only&&(0,a.tZ)(ee,{onClick:Z}),(0,a.tZ)($,{pub:l,overrideSubtitle:x}),!l.invite_only||o&&o.is_free_subscribed?(0,a.BX)(a.HY,{children:[(0,a.tZ)(B.gq,{justifyContent:"center",style:{width:"100%"},children:(0,a.BX)(B.tu,{gap:4,style:{width:"100%",maxWidth:"380px"},children:[(0,a.tZ)(b.Z,{email:c,isWelcomePageColor:!0,freeSignup:u,freeSignupEmail:p,pub:l,referralCode:m,source:g,submitButtonText:_,user:o,onConfirmationRequired:"enabled"===l.payments_state?()=>null:void 0,onSuccess:N||(()=>document.location.href="/"),autoFocus:r}),(0,a.BX)(T.xv.B4,{paddingX:{mobile:16,desktop:0},paddingTop:16,className:U.Z.tosText,translated:!0,children:["By subscribing, I agree to Substack’s"," ",(0,a.tZ)("a",{className:U.Z.tosLink,href:(0,D._Q)(),target:"_blank",rel:"noopener noreferrer",children:"Terms of Use"})," ","and acknowledge its"," ",(0,a.tZ)("a",{className:U.Z.tosLink,href:(0,D.WF)(),target:"_blank",rel:"noopener noreferrer",children:"Information Collection Notice"})," ","and"," ",(0,a.tZ)("a",{className:U.Z.tosLink,href:(0,D.Zz)(),target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"})]})]})}),!v&&(Z?(0,a.tZ)("a",{onClick:e=>e.preventDefault(),className:"no-styles",children:(0,a.BX)(C.zx,{priority:"quaternary",className:U.Z.maybeLater,onClick:Z,"data-testid":"maybeLater",children:["No thanks"===E.getSettingFor("welcome_page_opt_out_text")?I("No thanks"):null!==(t=E.getSettingFor("welcome_page_opt_out_text"))&&void 0!==t?t:I("No thanks"),(0,a.tZ)(h.Z,{size:20})]})}):(0,a.BX)(C.zx,{priority:"quaternary",className:U.Z.maybeLater,href:W,localNavigation:!1,children:[A,(0,a.tZ)(h.Z,{size:20})]}))]}):(0,a.tZ)(X.cr,{onRequest:()=>i.e("2457").then(i.bind(i,51323)),resolve:e=>e.InviteActions,module:"./InviteActions",pub:l,user:o,freeSignupEmail:p}),!!(null==H?void 0:H.length)&&(0,a.tZ)("div",{className:"blurb-buffer"}),!!(null==H?void 0:H.length)&&(0,a.tZ)(B.gq,{className:"blurbs",gap:20,children:H.map(e=>(0,a.BX)(B.tu,{gap:8,className:"blurb",children:[(0,a.tZ)(T.xv.B4,{className:d()("blurb-text",U.Z.blurbText),children:(0,a.tZ)(f.Z,{maxLines:4,ellipsesText:"...”",text:"“".concat(e.description,"”")})}),(0,a.BX)(T.xv.B4,{weight:"semibold",className:d()("blurb-text",U.Z.blurbText),children:[e.author_name||e.recommendingPublication.email_from_name||e.recommendingPublication.copyright,", ",(0,a.tZ)("a",{href:(0,F.SVA)(e.recommendingPublication),children:e.recommendingPublication.name})]})]}))})]})})},Q=(e,t)=>{let i,n,r,l,a,o;let{getConfigFor:s}=(0,N.xR)();if(s("section_specific_welcome_pages")&&e.section){var c;i=e.section.name,n=e.section.description,r=null!==(c=e.section.logo_url)&&void 0!==c?c:e.logo_url,a=!!((l=e.section.cover_photo_url)&&e.section.hide_intro_title),o=!!(l&&e.section.hide_intro_subtitle)}else i=e.name,n=e.hero_text,r=e.logo_url,a=!!((l=e.cover_photo_url)&&e.hide_intro_title),o=!!(l&&e.hide_intro_subtitle);return t&&(n=t),{title:i,subtitle:n,logoUrl:r,coverPhotoUrl:l,hideTitle:a,hideSubtitle:o}},$=e=>{let{pub:t,overrideSubtitle:i}=e,{getSettingFor:r}=(0,w.So)(),{language:l}=(0,y.M1)(),{title:o,subtitle:s,logoUrl:c,coverPhotoUrl:u,hideTitle:h,hideSubtitle:p}=Q(t,i),m=r("display_welcome_page_details"),b=u&&(0,F.zJH)(u);return(0,a.BX)(a.HY,{children:[u?(0,a.tZ)(v.e,{className:"publication-cover-photo",src:u,imageProps:{quality:"auto:best"},maxWidth:1360,loading:"eager",style:(0,n._)({},b&&b.width&&{height:"min(35vh, ".concat(680*b.height/b.width,"px)")})}):c&&(0,a.tZ)(x.xu,{paddingBottom:32,children:(0,a.tZ)(E.wk,{logoUrl:c,size:88})}),!h&&(0,a.tZ)("h1",{className:d()("publication-name",{"no-logo":!c,"with-cover":u},U.Z.balancedText),children:o}),!p&&s&&(0,a.tZ)("p",{className:d()("publication-tagline with-cover",{verbose:!0,"with-cover":u},U.Z.balancedText),children:s}),(0,a.tZ)("div",{className:"publication-meta",children:V(t,{includePrice:!1,includeBadge:!0,rankingDetailOverrideText:t.rankingDetailFreeSubscriberCount,includeRankingDetail:!!m,language:l})})]})},ee=e=>{let{onClick:t}=e;return(0,a.tZ)(C.hU,{onClick:t,"aria-label":"Close","data-testid":"close-welcome-modal",priority:"tertiary",className:U.Z.closeWelcomeModal,children:(0,a.tZ)(p.Z,{size:20})})}},27836:function(e,t,i){"use strict";i.d(t,{b:()=>s,j:()=>o});var n=i(16584),r=i(95441),l=i(80026),a=i(6911);function o(e){let{publisherTerms:t,utm_source:i}=e,{iString:o}=(0,r.M1)();return(0,n.BX)(n.HY,{children:[o("By registering you agree to")," ",t&&(0,n.BX)(n.HY,{children:[t,", "]}),(0,n.BX)(l.xv,{as:"span",translated:!0,children:["Substack's ",(0,n.tZ)(s,{href:(0,a._Q)({utm_source:i}),children:"Terms of Service"})]}),(0,n.BX)(l.xv,{as:"span",translated:!0,children:[", our ",(0,n.tZ)(s,{href:(0,a.Zz)({utm_source:i}),children:"Privacy Policy"})]}),(0,n.BX)(l.xv,{as:"span",translated:!0,children:[", and our ",(0,n.tZ)(s,{href:(0,a.WF)({utm_source:i}),children:"Information Collection Notice"})]}),"."]})}function s(e){let{href:t,children:i}=e;return(0,n.tZ)("a",{className:(0,l.oB)({decoration:"underline"}),href:t,target:"_blank",rel:"noopener",children:i})}},75744:function(e,t,i){"use strict";i.d(t,{Ug:()=>m,fJ:()=>c,nO:()=>d});var n=i(16584),r=i(27836),l=i(95441),a=i(58175),o=i(6911);function s(e,t){return[...Array(2*e.length-1)].map((i,n)=>n%2?t:e[n/2])}let c=e=>{let{publication:t,className:i,themed:r=!1,utm_source:l}=e,a=r?"pub-tertiary-text":"tertiary";switch(null==t?void 0:t.subdomain){case"activisionblizzard":return(0,n.tZ)(h,{className:i,color:a,utm_source:l});case"demographyunplugged":return(0,n.tZ)(p,{className:i,color:a,utm_source:l});default:return(0,n.tZ)(u,{pub:t,className:i,color:a,utm_source:l})}},d=e=>{let{publication:t}=e,{iString:i}=(0,l.M1)();if((null==t?void 0:t.subdomain)==="demographyunplugged")return(0,n.BX)(n.HY,{children:[(0,n.BX)(a.xv,{translated:!0,size:14,className:"tos",children:["Substack's ",(0,n.tZ)(r.b,{href:(0,o.Zz)(),children:"Privacy"}),","," ",(0,n.tZ)(r.b,{href:(0,o._Q)(),children:"Terms"})," and"," ",(0,n.tZ)(r.b,{href:(0,o.WF)(),children:"Information Collection Notice"})]}),(0,n.BX)(a.xv,{translated:!0,size:14,className:"tos",children:["Demography Unplugged's"," ",(0,n.tZ)(r.b,{href:"https://www.demographyunplugged.com/p/privacy-policy",children:"Privacy"})," and"," ",(0,n.tZ)(r.b,{href:"https://www.demographyunplugged.com/p/terms-of-service",children:"Terms"})]})]});let c=[(0,n.tZ)(r.b,{href:(0,o.Zz)(),children:i("Privacy")}),(0,n.tZ)(r.b,{href:(0,o._Q)(),children:i("Terms")}),(0,n.tZ)(r.b,{href:(0,o.WF)(),children:i("Collection notice")})];return(null==t?void 0:t.subdomain)==="activisionblizzard"&&c.push((0,n.BX)(n.HY,{children:["Activision's"," ",(0,n.tZ)(r.b,{href:"https://www.activisionblizzard.com/legal/privacy-policy",children:"Privacy Policy"})]})),(null==t?void 0:t.subdomain)==="demographyunplugged"&&(c.push((0,n.BX)(n.HY,{children:["Demography Unplugged's"," ",(0,n.tZ)(r.b,{href:"https://www.demographyunplugged.com/p/privacy-policy",children:"Privacy Policy"})]})),c.push((0,n.BX)(n.HY,{children:["Demography Unplugged's"," ",(0,n.tZ)(r.b,{href:"https://www.demographyunplugged.com/p/terms-of-service",children:"Terms"})]}))),(0,n.tZ)(n.HY,{children:s(c,(0,n.tZ)("span",{children:" ∙ "}))})},u=e=>{let{pub:t,className:i,color:l,utm_source:s}=e,c=null;return t.has_custom_tos&&t.has_custom_privacy?c=(0,n.BX)(a.xv,{as:"span",translated:!0,children:["the publisher's ",(0,n.tZ)(r.b,{href:(0,o.P8)({pub:t,utm_source:s}),children:"Terms of Service"})," and"," ",(0,n.tZ)(r.b,{href:(0,o.RF)({pub:t,utm_source:s}),children:"Privacy Policy"})]}):t.has_custom_tos?c=(0,n.BX)(a.xv,{as:"span",translated:!0,children:["the publisher's ",(0,n.tZ)(r.b,{href:(0,o.P8)({pub:t,utm_source:s}),children:"Terms of Service"})]}):t.has_custom_privacy&&(c=(0,n.BX)(a.xv,{as:"span",translated:!0,children:["the publisher's ",(0,n.tZ)(r.b,{href:(0,o.RF)({pub:t,utm_source:s}),children:"Privacy Policy"})]})),(0,n.tZ)(a.xv.B3,{size:14,color:l,className:null!=i?i:"tos",children:(0,n.tZ)(r.j,{publisherTerms:c,utm_source:s})})},h=e=>{let{className:t,color:i,utm_source:l}=e;return(0,n.BX)(a.xv.B3,{translated:!0,size:14,color:i,className:null!=t?t:"tos",children:["By registering you agree to Substack's"," ",(0,n.tZ)(r.b,{href:(0,o._Q)({utm_source:l}),children:"Terms of Service"}),", our"," ",(0,n.tZ)(r.b,{href:(0,o.Zz)({utm_source:l}),children:"Privacy Policy"}),", our"," ",(0,n.tZ)(r.b,{href:(0,o.WF)({utm_source:l}),children:"Information Collection Notice"}),", and Activision's"," ",(0,n.tZ)(r.b,{href:"https://www.activisionblizzard.com/legal/privacy-policy",children:"Privacy Policy"})]})},p=e=>{let{className:t,color:i,utm_source:l}=e;return(0,n.BX)("div",{className:null!=t?t:"tos",children:[(0,n.BX)(a.xv.B3,{translated:!0,size:14,color:i,children:["By registering you agree to Substack's"," ",(0,n.tZ)(r.b,{href:(0,o._Q)({utm_source:l}),children:"Terms of Service"}),", our"," ",(0,n.tZ)(r.b,{href:(0,o.Zz)({utm_source:l}),children:"Privacy Policy"}),", our"," ",(0,n.tZ)(r.b,{href:(0,o.WF)({utm_source:l}),children:"Information Collection Notice"}),"."]}),(0,n.BX)(a.xv.B3,{translated:!0,size:14,color:i,children:["You also agree to receive marketing emails from Hedgeye Risk Management, LLC pursuant to its"," ",(0,n.tZ)(r.b,{href:"https://www.demographyunplugged.com/p/privacy-policy",children:"Privacy Policy"})," and"," ",(0,n.tZ)(r.b,{href:"https://www.demographyunplugged.com/p/terms-of-service",children:"Terms of Service"}),"."]}),(0,n.tZ)(a.xv.B3,{translated:!0,size:14,color:i,children:"You may unsubscribe at any time by clicking the unsubscribe link in one of the emails."})]})},m=e=>{let{pub:t}=e,i=[];return t.has_custom_privacy&&i.push((0,n.tZ)(r.b,{href:(0,o.RF)({pub:t}),children:"Publisher Privacy"})),t.has_custom_tos&&i.push((0,n.tZ)(r.b,{href:(0,o.P8)({pub:t}),children:"Publisher Terms"})),(0,n.tZ)("div",{children:(0,n.tZ)(a.xv.B3,{size:14,color:"tertiary",children:s(i,(0,n.tZ)("span",{children:" ∙ "}))})})}},50486:function(e,t,i){"use strict";i.d(t,{p:()=>o});var n=i(16584),r=i(94184),l=i.n(r),a=i(24189);let o=e=>{let{name:t,label:i,info:r,checked:o,disabled:s,onChange:c,isRow:d=!0,className:u}=e,h=(0,n.tZ)(n.HY,{children:(0,n.tZ)("span",{className:l()("big-checkbox",{checked:o,disabled:s}),onClick:()=>!s&&(null==c?void 0:c(!o)),onKeyDown:e=>{" "===e.key&&(null==c||c(!o))},role:"checkbox","aria-checked":o,"aria-label":i||t,tabIndex:0,children:o&&(0,n.tZ)(a.Z,{fill:"#ffffff"})})});return(0,n.BX)("label",{className:l()("big-checkbox-input",u,{"big-checkbox-input-row":d}),children:[!d&&h,(0,n.BX)("div",{onClick:()=>{(i||r)&&(s||null==c||c(!o))},children:[i,r&&(0,n.tZ)("div",{className:"info",children:r})]}),d&&h,(0,n.tZ)("input",{type:"hidden",name:t,"data-testid":t,value:String(o)})]})}},16104:function(e,t,i){"use strict";if(i.d(t,{Z:()=>s}),3270==i.j)var n=i(7409);if(3270==i.j)var r=i(99282);if(3270==i.j)var l=i(98848);var a=i(16584),o=i(64515);let s=3270==i.j?e=>{var t,{color:i,stroke:s,strokeWidth:c=1}=e,d=(0,l._)(e,["color","stroke","strokeWidth"]);return(0,a.tZ)(o.l,(0,r._)((0,n._)({},d),{stroke:null!=i?i:s,strokeWidth:c,name:"CaretRightIcon",svgParams:{height:14,width:8,viewBox:"0 0 8 14"},children:(0,a.tZ)("path",{d:"M1 13L7 7L1 1",stroke:null!==(t=null!=i?i:s)&&void 0!==t?t:"#1C110B",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:null!=c?c:1})}))}:null},24189:function(e,t,i){"use strict";i.d(t,{Z:()=>s});var n=i(7409),r=i(99282),l=i(98848),a=i(16584),o=i(64515);let s=e=>{var{fill:t}=e,i=(0,l._)(e,["fill"]);return(0,a.tZ)(o.l,(0,r._)((0,n._)({},i),{name:"CheckboxCheckmarkIcon",svgParams:{viewBox:"0 0 16 13",height:16,width:13,fill:t||"white"},children:(0,a.tZ)("path",{d:"M5.71444 12.6276L0 6.9132L1.61147 5.30173L5.71444 9.39327L14.389 0.71875L16.0004 2.34165L5.71444 12.6276Z",stroke:t||"white"})}))}},55438:function(e,t,i){"use strict";i.d(t,{Z:()=>c});var n=i(7409),r=i(99282),l=i(98848),a=i(16584),o=i(64515),s=i(90406);let c=e=>{var{svgParams:t}=e,i=(0,l._)(e,["svgParams"]);return(0,a.BX)(o.l,(0,r._)((0,n._)({},i),{name:"SubstackIcon",svgParams:(0,n._)({height:1e3,width:1e3,fill:s.Hu,stroke:"none"},t),children:[(0,a.tZ)("path",{d:"M764.166 348.371H236.319V419.402H764.166V348.371Z"}),(0,a.tZ)("path",{d:"M236.319 483.752V813.999L500.231 666.512L764.19 813.999V483.752H236.319Z"}),(0,a.tZ)("path",{d:"M764.166 213H236.319V284.019H764.166V213Z"})]}))}},21312:function(e,t,i){"use strict";i.d(t,{Z:()=>l});var n=i(16584),r=i(30396);function l(e){let{text:t,maxLines:i,ellipsesText:l="..."}=e,a=(0,r.sO)(null),[o,s]=(0,r.eJ)(t);return(0,r.d4)(()=>{(()=>{if(!a.current)return;a.current.innerText="-";let e=(a.current.clientHeight+1)*i+1,n=0,r=0,o=t.length;for(;n<=o;){if(r=Math.floor((n+o)/2),a.current.innerText=t.slice(0,r),r===t.length&&a.current.clientHeight<=e){a.current.innerText="",s(t);return}a.current.clientHeight<=e?n=r+1:o=r-1}let c=t.slice(0,r-l.length-2);a.current.innerText="",s(c+l)})()},[a,t,i,l]),(0,n.BX)("div",{style:{position:"relative"},children:[(0,n.tZ)("div",{children:o}),(0,n.tZ)("div",{ref:a,style:{visibility:"hidden",position:"absolute",width:"100%"}})]})}},30363:function(e,t,i){"use strict";i.d(t,{ZP:()=>d});var n=i(16584),r=i(94184),l=i.n(r),a=i(55438),o=i(90406),s=i(38841);let c=e=>{let{publication:t,logo_size:i=60,className:r="",children:c}=e;return(0,n.tZ)("table",{role:"presentation",className:l()("publication","card",r,t.logo_url?"has-logo":"no-logo"),width:"auto",cellpadding:0,cellspacing:0,border:"0",children:(0,n.BX)("tr",{cellpadding:"0",height:"100%",children:[i&&(0,n.tZ)("td",{rowspan:3,className:"logo",children:(0,n.tZ)("figure",{className:"logo",children:t.logo_url?(0,n.tZ)(s.CN,{pub:t,size:i}):(0,n.tZ)(a.Z,{isStatic:!0,fill:t.theme_var_background_pop||o.Hu,width:i,height:i})})}),(0,n.tZ)("td",{children:(0,n.BX)("table",{cellpadding:"0",cellspacing:"0",children:[(0,n.tZ)("tr",{children:(0,n.tZ)("td",{className:"title",children:t.name})}),(0,n.tZ)("tr",{cellpadding:"0",height:"80%",children:(0,n.tZ)("td",{className:"description",children:t.hero_text})}),c]})})]})})},d=e=>{let{publication:t,logo_size:i=60,isStatic:r=!1,children:l}=e;return r?(0,n.tZ)(c,{publication:t,logo_size:i,children:l}):(0,n.BX)("div",{className:"publication card",children:[i&&(0,n.tZ)("figure",{className:"logo",children:(0,n.tZ)(s.wk,{pub:t,size:i})}),(0,n.BX)("div",{className:"title",children:[(0,n.tZ)("div",{className:"name",children:t.name}),(0,n.tZ)("div",{className:"description",children:t.hero_text}),l]})]})}},32582:function(e,t,i){"use strict";i.d(t,{G6:()=>H,PH:()=>R,gQ:()=>W});var n=i(7409),r=i(99282),l=i(16584),a=i(6400),o=i(30396),s=i(85564),c=i.n(s),d=i(84753),u=i.n(d),h=i(43174),p=i.n(h),m=i(89734),b=i.n(m),g=i(45578),f=i.n(g),v=i(20042),_=i(80569),Z=i.n(_),y=i(20253),w=i(39535),N=i(94499),S=i(30363),P=i(32261),k=i(98914),x=i(15771),C=i(43570),B=i(98012),E=i(60308),T=i(26111),I=i(47929);let L=e=>{let{onClick:t,checked:i}=e;return(0,l.BX)("div",{className:"select-all",children:[(0,l.tZ)("input",{name:"all",type:"checkbox",onInput:t,checked:i}),(0,l.BX)("label",{for:"all",onClick:t,children:["Select ",i?"none":"all"]})]})},X=e=>{let{disabled:t,onClick:i,children:n}=e;return(0,l.tZ)(x.zx,{type:"submit",priority:"primary",size:"lg",disabled:t,onClick:i,children:n})},R=e=>{let{extraProps:t={},linkType:i=null,discoverable:a=null,text:o,icon:s=!0,onClick:c=null}=e,d={};null!==i&&(d.type=i),null!==a&&(d.discoverable=a);let u=(0,E.nRe)(d);return(0,l.tZ)("div",(0,r._)((0,n._)({className:"twitter-discover"},t),{children:(0,l.tZ)("a",(0,r._)((0,n._)({className:"twitter-link",href:u},c&&{onClick:c}),{native:!0,children:(0,l.BX)("div",{className:"inner",children:[s&&(0,l.tZ)(w.Z,{fill:"white"}),(0,l.tZ)("span",{className:"twitter-link-text",children:o||"Find writers and creators I follow"})]})}))}))},A=e=>{let{pub:t,checked:i,onToggle:n,isSubscribed:r,author:a,screenName:o}=e;return(0,l.tZ)("li",{className:"linked-pub",children:(0,l.BX)("div",{className:"linked-pub",children:[(0,l.BX)("div",{className:"photo",children:[(0,l.tZ)("div",{className:"subscribed-status",children:(0,l.tZ)("input",{type:"checkbox",checked:i||r,disabled:r,onInput:()=>n(t.id)})}),(0,l.tZ)(P.fi,{size:60,photo_url:a.photo_url}),(0,l.BX)("div",{className:"twitter-handle",children:[(0,l.tZ)("span",{className:"author",children:null==a?void 0:a.name}),(0,l.BX)("span",{className:"handle",children:[" @",o]})]})]}),(0,l.tZ)("div",{className:"info",children:(0,l.tZ)("div",{className:"publication-row",children:(0,l.tZ)("a",{className:"publication",href:(0,E.rhs)("".concat((0,E.SVA)(t),"/"),{utm_source:I.b3.substack,utm_medium:I.lP.web,utm_content:I.fZ.discoverTwitter}),target:"_blank",native:!0,children:(0,l.tZ)(S.ZP,{publication:t,logo_size:30,children:r?(0,l.tZ)("div",{className:"subscribed",children:(0,l.tZ)(C.Vp,{children:"Subscribed"})}):null})})})})]})})},F=e=>{var t;let{result:i,selectedPubs:n,onToggle:r}=e,{publicationAuthor:a,screen_name:o,publication_id:s}=i,{name:c,ownedPublications:d}=a,u=f()(d,e=>e.id),h=b()(u,e=>{var t;return(null===(t=e.latestPost)||void 0===t?void 0:t[0])?(0,B.Z)(e.latestPost[0].post_date).toDate():B.Z.unix(1).toDate()}).reverse(),p=a.photo_url||(null===(t=d.find(e=>e.id===s))||void 0===t?void 0:t.logo_url);return h.map(e=>{var t;let i=!!(null===(t=e.subscriptions)||void 0===t?void 0:t.length);return(0,l.tZ)(A,{author:a,screenName:o,authorName:c,showLogo:p!==a.photo_url,pub:e,checked:n.has(e.id),onToggle:r,isSubscribed:i})})},z=e=>{let{user:t,freeSignupEmail:i,twitterEmail:n,twitterToken:r,onConfirmed:a,onSubscribed:s,formAction:c,pubIds:d,subscribeToken:u,redirect:h,showDiscover:p,editable:m,showLogout:b}=e,g=(null==t?void 0:t.email)||i||n,[f,v]=(0,o.eJ)(!1),[_,Z]=(0,o.eJ)(!0),[w,N]=(0,o.eJ)(g);h=d?(0,E.rhs)(h,{pubIds:d,t:r}):(0,E.rhs)(h,{t:r,d:_});let S=e=>{let{userExists:t,subscribed:i}=e.body;i?null==s||s(i):t?t&&(0,k.uX)((0,E.n1t)("".concat((0,E.ZJn)(),"/sign-in"),{with_password:!1,email:w,redirect:h})):null==a||a()};return(0,l.tZ)("div",{className:"twitter-publications container",children:(0,l.tZ)("section",{children:(0,l.tZ)("div",{className:"terms-check",children:(0,l.BX)(y.ZP,{onSuccess:e=>S(e),method:"post",action:c,loading:!1,autoLock:!0,children:[(0,l.tZ)("input",{name:"t",type:"hidden",value:r}),d&&(0,l.tZ)("input",{name:"pubIds",type:"hidden",value:d}),u&&(0,l.tZ)("input",{name:"subscribeToken",type:"hidden",value:u}),(0,l.tZ)("input",{name:"email",type:"text",disabled:!m&&!!g,value:w,onInput:e=>{N(e.target.value)}}),(0,l.BX)("label",{children:[(0,l.tZ)("input",{type:"checkbox",checked:f,onInput:()=>v(!f)}),"I accept the"," ",(0,l.tZ)("a",{href:"/tos",target:"_blank",native:!0,children:"Terms of Use"})]}),p&&(0,l.BX)("label",{children:[(0,l.tZ)("input",{name:"allow_discover",type:"checkbox",checked:_,onInput:()=>Z(!f)}),"Allow people to find my publications via Twitter"]}),b&&(0,l.tZ)("label",{children:(0,l.tZ)("a",{className:"login-button",href:(0,E.ZPN)(),native:!0,children:"Not you?"})}),(0,l.tZ)(X,{disabled:!f,children:"Next →"})]})})})})},D=()=>(0,l.BX)("div",{className:"twitter-publications container landing",children:[(0,l.tZ)("h2",{children:"Your favorite writers and creators and their communities are already on Substack."}),(0,l.BX)("section",{children:[(0,l.BX)("p",{children:["Find writers and creators I follow and subscribe to their publications."," ",(0,l.tZ)("span",{className:"light",children:"(We'll never post to your Twitter without permission or abuse your data.)"})]}),(0,l.tZ)("div",{className:"banner",children:(0,l.tZ)(R,{})})]})]}),W=e=>{let{user:t,stage:i,twitterEmail:n,freeSignupEmail:r,twitterToken:a}=e;return(a||t)&&"connect"!=i?(0,l.tZ)(H,{user:t,stage:i,twitterEmail:n,freeSignupEmail:r,twitterToken:a}):(0,l.tZ)(D,{})},H=e=>{let t,{user:i,stage:n,twitterEmail:r,freeSignupEmail:s,twitterToken:d,buttonText:u=null,onSignup:h=null,requireSignup:p=!0,needsEmailConfirm:m=!0,renderIfNoneFound:b=null,useProfilePrefix:g=!1}=e,[f,_]=(0,o.eJ)(null),[y,w]=(0,o.eJ)(null),[N,S]=(0,o.eJ)(null),[P,k]=(0,o.eJ)(null),[x,C]=(0,o.eJ)(!m),[B,E]=(0,o.eJ)(null),[I,L]=(0,o.eJ)(!1),[X,A]=(0,o.eJ)(new Set),[F,D]=(0,o.eJ)(null),W=(0,T.x)("subscribed"),H=g?"/profile":"";W?h?h():(S(W.split(",")),(0,v.route)("/discover-twitter/success")):!n||"connect"===n||f||N||(0,v.route)("/discover-twitter");let O=e=>c()(e.map(e=>{var t;return(null===(t=e.publicationAuthor)||void 0===t?void 0:t.ownedPublications)||[]}));(0,o.d4)(()=>{(async()=>{if(!I){L(!0);try{let e=(await Z().get("/api/v1/twitter/publications")).body;if("needsConnect"in e&&e.needsConnect)(0,v.route)("/discover-twitter/connect");else{let t;let{results:i,subscribeToken:n,needsTwitterConfirm:r}=e,l=O(i),a=new Set(l.filter(e=>{var t;return(null===(t=e.subscriptions)||void 0===t?void 0:t.length)===0}).map(e=>e.id));t=a.size<=30?new Set(a):new Set,_(i),E(!1),D(n),w(a),A(t),k(!r)}}catch(e){E(e)}L(!1)}})()},[]),f&&(f.length>0?t=P?"We found ".concat(f.length," account").concat(f.length>1?"s":""," you follow on Twitter"):"Confirm your email to see ".concat(f.length," account").concat(f.length>1?"s":""," you follow on Twitter"):P||(t="Confirm your email to continue")),"confirm"===n&&(t="Confirm your email"),N&&(t="Success!");let M=f?O(f):null,V=async()=>{L(!0);try{let e=await Z().post("/api/v1/twitter/subscribe").send({pubIds:[...X].join(","),t:d,subscribeToken:F});if(h)h();else{let{subscribed:t}=e.body;S(t),(0,v.route)("/discover-twitter/success")}}catch(e){console.error("error subscribing",e)}L(!1)};return(0,l.BX)("div",{className:"twitter-publications pub-list",children:[(0,l.tZ)("h2",{className:n,children:t}),I&&(0,l.tZ)("p",{className:"loading",children:"Loading..."}),B&&(0,l.BX)(a.Fragment,{children:[(0,l.tZ)("p",{className:"error",children:"Sorry, there was an error getting your results!"}),(0,l.tZ)("div",{className:"banner",children:(0,l.tZ)(R,{})})]}),(0,l.BX)(v.default,{children:[f&&!N&&P&&!I&&(0,l.tZ)(J,{path:"".concat(H,"/discover-twitter"),results:f,selectedPubs:X,subscribablePubs:null!=y?y:new Set([]),onToggleChecked:e=>{let t=new Set(X);X.has(e)?t.delete(e):t.add(e),A(t)},onToggleAll:e=>{let t;A(e?new Set(y):new Set)},onNext:()=>{!m||x?V():(0,v.route)("/discover-twitter/confirm")},loading:I,buttonText:u,requireSignup:p,renderIfNoneFound:b}),!1==P&&(0,l.tZ)(z,{path:"".concat(H,"/discover-twitter"),formAction:"/api/v1/twitter/confirm",redirect:"/api/v1/twitter/continue-confirm",user:i,onConfirmed:()=>{C(!0),k(!0)},twitterEmail:r,twitterToken:d,freeSignupEmail:s,pubIds:[...X],showDiscover:!0}),!x&&(0,l.tZ)(z,{path:"".concat(H,"/discover-twitter/confirm"),redirect:"/api/v1/twitter/continue-subscribe",formAction:"/api/v1/twitter/subscribe",user:i,onSubscribed:e=>{S(e),(0,v.route)("/discover-twitter/success")},twitterEmail:r,twitterToken:d,freeSignupEmail:s,pubIds:[...X],subscribeToken:F,editable:!1,showLogout:!0}),f&&N&&(0,l.tZ)(U,{path:"".concat(H,"/discover-twitter/success"),user:i,subscribed:N,pubs:null!=M?M:[],results:f})]})]})},O=e=>{let{pub:t,result:i}=e,{hero_text:n,stripeAccount:r,logo_url:a}=t,{screen_name:o,publicationAuthor:{name:s,photo_url:c}}=i,d=null==r?void 0:r.plans;return(0,l.tZ)("li",{className:"linked-pub subscribed",children:(0,l.BX)("div",{className:"linked-pub",children:[(0,l.tZ)("div",{className:"photo",children:(0,l.tZ)(P.fi,{size:60,photo_url:a||c})}),(0,l.tZ)("div",{className:"info",children:(0,l.BX)("div",{className:"publication-row",children:[(0,l.BX)("div",{className:"publication",children:[(0,l.BX)("div",{className:"name",children:["@",o," - ",s]}),(0,l.tZ)("div",{className:"description",children:n})]}),(0,l.tZ)("div",{children:d&&(0,l.tZ)(N.Z,{className:"outline small button",href:"".concat((0,E.SVA)(t),"/subscribe"),target:"_blank",children:"Upgrade"})})]})})]})})},U=e=>{let{subscribed:t,pubs:i,results:n}=e,r=f()(i.filter(e=>t.find(t=>t===e.subdomain)),e=>e.id),[o,s]=p()(r,e=>{var t;return null===(t=e.stripeAccount)||void 0===t?void 0:t.plans}),c=[...o,...s].length>1,d=o.length>1;return(0,l.BX)("ul",{children:[(0,l.tZ)("div",{className:"sign-up",children:o.length>0?(0,l.BX)(a.Fragment,{children:[d?"".concat(o.length," of the newsletters"):c?"One of the newsletters":"The newsletter"," ","you subscribed to ",d?"have":"has"," a paid version. You can upgrade"," ",d?"those subscriptions":"that subscription"," now or later."]}):"You're subscribed to the free version of ".concat(c?"these newsletters":"this newsletter",". Happy reading!")}),[...o,...s].map(e=>{let t=n.find(t=>{var i;return t.screen_name===(null===(i=e.twitterAccount)||void 0===i?void 0:i.screen_name)});return t?(0,l.tZ)(O,{pub:e,result:t}):null})]})},M=e=>{let{onNext:t}=e;return(0,l.tZ)("div",{children:(0,l.BX)("ul",{children:[(0,l.tZ)("p",{children:"It doesn't appear anyone you follow on Twitter has a Substack yet. We'll let you know if that changes."}),(0,l.tZ)(N.Z,{className:"primary button",onClick:()=>{t()},children:"Continue"})]})})},J=e=>{let{results:t,selectedPubs:i,onNext:n,onToggleChecked:r,onToggleAll:o,subscribablePubs:s,loading:c,buttonText:d,requireSignup:h,renderIfNoneFound:m}=e;if(0===t.length)return m||(0,l.tZ)(M,{onNext:n});let g=b()(t,e=>{var t,i,n;let r;return(null==(r=(null===(t=e.publicationAuthor)||void 0===t?void 0:t.ownedPublications)?u()(e.publicationAuthor.ownedPublications,e=>{var t;return(null===(t=e.latestPost)||void 0===t?void 0:t[0])?(0,B.Z)(e.latestPost[0].post_date).toDate():null}):null)?void 0:null===(i=r.latestPost)||void 0===i?void 0:i[0])?(0,B.Z)(null===(n=r.latestPost[0])||void 0===n?void 0:n.post_date).toDate():B.Z.unix(1).toDate()}).reverse(),[f,v]=p()(g,e=>(e.publicationAuthor.ownedPublications||[]).some(e=>{var t;return(null===(t=e.subscriptions)||void 0===t?void 0:t.length)===0})),_=s.size===i.size,Z=(!h||i.size>0)&&!c,y=!h||s.size>0?(0,l.tZ)(X,{onClick:n,disabled:!Z,children:d?(i.size>0?"Subscribe and ":"")+d:"Sign up →"}):null;return(0,l.BX)("div",{children:[(0,l.tZ)("section",{className:"sign-up",children:"Subscribe to free newsletters from the people you already follow on Twitter"}),(0,l.BX)("ul",{children:[(!h||s.size>0)&&(0,l.BX)(a.Fragment,{children:[(s.size>3||!h)&&y,(0,l.tZ)("li",{children:s.size<30&&(0,l.tZ)(L,{checked:_,onClick:()=>{_?o(!1):o(!0)}})})]}),[...f,...v].map(e=>(0,l.tZ)(F,{result:e,selectedPubs:i,onToggle:r})),y]})]})}},32261:function(e,t,i){"use strict";i.d(t,{FI:()=>f,fi:()=>_});var n=i(27412),r=i(7409),l=i(98848),a=i(16584),o=i(6400),s=i(94184),c=i.n(s),d=i(70149),u=i(93666),h=i(48980),p=i(98012),m=i(60308),b=i(84864);class g extends o.Component{componentDidMount(){this.props.manualLoad||this.loadProfileUser()}componentDidUpdate(e){this.props.manualLoad||e.profileUser.id===this.props.profileUser.id||(this.setState({profileUser:null}),this.loadProfileUser())}async loadProfileUser(){if(!this.state.loadingProfile){this.setState({loadingProfile:!0});try{let e=await (0,h.rd)("/api/v1/user/".concat(this.props.profileUser.id,"/profile"));this.setState({profileUser:e})}catch(e){console.error("Failed to load profile:",e)}this.setState({loadingProfile:!1})}}getProfileUser(){return this.state.profileUser||this.props.profileUser}render(e){var t,i;let{pub:n}=e,r=this.getProfileUser(),l="publications"in r&&n&&(null===(t=r.publications)||void 0===t?void 0:t.filter(e=>e.id!==n.id))||[];return(0,a.BX)("div",{className:"user-profile ".concat(this.props.isBanned?"banned":""),children:[(0,a.tZ)(_,{photo_url:(0,m.SMH)(r),banned:this.props.isBanned,email:"email"in r?r.email:void 0,pub:n}),(0,a.tZ)("div",{className:"user-profile-name",children:"name"in r?r.name:""}),(0,a.tZ)("div",{className:"user-profile-status",children:n&&r.id===n.author_id?(0,a.BX)("b",{children:["Author of ",n.name]}):n&&"subscribed_at"in r&&r.subscribed_at?"Subscriber to ".concat(n.name," since ").concat((0,p.Z)(r.subscribed_at).standardDate()):"\xa0"}),l.length>0&&(0,a.BX)("div",{className:"user-profile-publication",children:["Author of"," ",(0,b.oxfordComma)(l.map(e=>(0,a.tZ)("a",{href:e.base_url,native:!0,children:e.name})))]}),this.props.isBanned&&(0,a.BX)("div",{className:"user-profile-banned",children:["Banned from commenting on ",null!==(i=null==n?void 0:n.name)&&void 0!==i?i:""]})]})}}class f extends u.p{onBeforeOpen(){var e;null===(e=this.profile)||void 0===e||e.loadProfileUser()}renderChildren(){let e=this.props,{ref:t}=e,i=(0,l._)(e,["ref"]);return(0,a.tZ)("div",{className:"user-profile-modal",children:(0,a.tZ)(g,(0,r._)({ref:this.assignProfile,manualLoad:!0},i))})}constructor(...e){super(...e),(0,n._)(this,"profile",void 0),(0,n._)(this,"assignProfile",e=>{this.profile=e})}}let v=e=>{let{children:t,email:i,pub:n}=e;return(0,a.tZ)("a",{target:"_blank",href:(0,m.pN7)(n,i),children:t})},_=e=>{let{photo_url:t,size:i=92,banned:n=!1,email:r="",className:l="",pub:o=null,children:s}=e,u=(0,a.tZ)("img",{className:"user-profile-head",height:i,width:i,src:(0,m.zF4)(null!=t?t:"",2*i,{height:2*i,crop:"fill"})});return(0,a.BX)("div",{className:c()(l,"profile-image-wrapper"),children:[r&&o?(0,a.tZ)(v,{email:r,pub:o,children:u}):u,n&&(0,a.tZ)(d.Z,{height:i}),s]})}},58319:function(e,t,i){"use strict";i.d(t,{Z:()=>c});var n=i(27412),r=i(16584),l=i(6400),a=i(94184),o=i.n(a),s=i(98914);class c extends l.Component{async componentDidMount(){"undefined"!=typeof window&&(this.ref||await new Promise(e=>setTimeout(e,0)),this.checkVisibility(),(this.props.parent||window).addEventListener("scroll",this.checkVisibility))}componentWillUnmount(){"undefined"!=typeof window&&(this.props.parent||window).removeEventListener("scroll",this.checkVisibility)}render(e){let{className:t,children:i}=e;return(0,r.tZ)("div",{ref:this.assignRef,className:o()("visibility-check",t),children:i})}constructor(...e){super(...e),(0,n._)(this,"ref",void 0),(0,n._)(this,"assignRef",e=>{this.ref=e}),(0,n._)(this,"checkVisibility",()=>{if(!this.ref)return;let e=this.ref.getBoundingClientRect(),t=this.props.threshold||0,i=this.props.parent?this.props.parent.clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight),n=!(e.bottom<0-t||e.top>=i+t);(0,s.nn)(this,async(e,t)=>{if(e.isVisible!==n)this.setState({isVisible:n});else if(!t.noDedupe)return;let i=n?"hadFirstVisible":"hadFirstInvisible",r=!e[i];r&&this.setState({[i]:!0}),(await Promise.all([n&&t.onVisible&&t.onVisible(),n&&t.onFirstVisible&&r&&t.onFirstVisible(),!n&&t.onInvisible&&t.onInvisible(),!n&&t.onFirstInvisible&&r&&t.onFirstInvisible()])).reduce((e,t)=>!0===t||e)&&this.checkVisibility()})})}}},39341:function(e,t,i){"use strict";if(i.d(t,{AY:()=>o,DJ:()=>s,_p:()=>c}),3270==i.j)var n=i(7409);var r=i(16584),l=i(6400),a=i(30396);let o=(0,l.createContext)({});o.displayName="WWWContext";let s=e=>{let t=t=>{let i=(0,a.qp)(o);return(0,r.tZ)(e,(0,n._)({},i,t))};return t.displayName="withWWWContext(".concat(e.name||e.displayName||"Anonymous",")"),t},c=()=>(0,a.qp)(o)},62514:function(e,t,i){"use strict";if(i.d(t,{z:()=>d}),3270==i.j)var n=i(7409);var r=i(30396),l=i(20042),a=i(39341),o=i(68833),s=i(48980);if(3270==i.j)var c=i(22419);function d(e){let t=(0,a._p)(),{categories:i,publications:s=[],categoryId:d,featuredPublications:b=[],user:g,categorySlug:f="featured",rankingSlug:v,hasMore:_,updateUrl:Z=!1,maxPublications:y=5,showTwitterBanner:w,homepageFeaturedPublications:N=[],isHomepage:S}=(0,n._)({},t,e),P=S?8:y,[k,x]=(0,r.eJ)(null!=i?i:[]),[C,B]=(0,r.eJ)(u(s,y)),[E,T]=(0,r.eJ)(null!=d?d:"featured"),[I,L]=(0,r.eJ)(S&&N.length?u(N,P):u(b,y)),[X,R]=(0,r.eJ)(null),[A,F]=(0,r.eJ)("paid"),[z,D]=(0,r.eJ)(null),[W,H]=(0,r.eJ)(0),[O,U]=(0,r.eJ)(!!_);(0,r.d4)(()=>{let e=v||"paid";F(e),k||h().then(t=>{let{categories:i,publications:n,featuredPublications:r}=t;x(i);let l=(0,c.Wq)(f,i);return(T(l),L(u(r,y)),"featured"===l)?n:p(l,e,0).then(e=>{let{publications:t,more:i}=e;return H(0),y||U(i),t})}).then(e=>{B(u(e,y))})},[k,f,v,y]);let M=(0,r.I4)(()=>{let e=W+1;(0,o.j)(o.FP.VIEWED_MORE_CATEGORY,{categoryId:E,ranking:A,page:e}),p(E,A,e).then(t=>{let{publications:i,more:n}=t,r=new Set(C.map(e=>e.id));H(e),B(C.concat(i.filter(e=>!r.has(e.id)))),U(n)})},[E,A,W,C,H,B,U]),J=(0,r.I4)(async e=>{let{categoryId:t,ranking:i}=e;if(T(t),H(0),"featured"===t||"twitter"===t){R(null),D(null),U(!1),"featured"===t&&B(u(I,y));return}R(t),D(i),B([]),U(!1);let{publications:n,more:r}=await p(t,i,0);T(t),R(null),D(null),F(i),H(0),y||U(r),B(u(n,y))},[R,D,T,H,U,B,I,y]);return{categories:k,publications:"featured"===E?I:C,categoryId:E,ranking:null!=A?A:void 0,loadingCategoryId:X,loadingRanking:z,featuredPublications:I,user:g,categorySlug:f,rankingSlug:v,hasMore:O,viewMore:M,loadPublications:J,onCategoryClicked:e=>{let{categoryId:t,ranking:i,categories:n}=e;(0,o.j)(o.FP.CLICKED_CATEGORY,{categoryId:t,ranking:i}),Z&&(0,l.route)(m({categoryId:t,categories:n,ranking:i}),!0),J({categoryId:t,ranking:i})},getCategoryIdFromSlug:c.Wq,setCategoryId:T,setRanking:F,onRankingChange:e=>{F(e),Z&&(0,l.route)(m({categoryId:E,categories:k,ranking:e}),!0),J({categoryId:E,ranking:e})},maxPublications:y,showTwitterBanner:!!w}}let u=(e,t)=>t?e.slice(0,t):e,h=()=>(0,s.rd)("/api/v1/homepage/initial-category-data"),p=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return(0,s.rd)("/api/v1/category/public/".concat(e,"/").concat(t,"?page=").concat(i))},m=e=>{let{categoryId:t,ranking:i,categories:n}=e,r="";"string"==typeof t&&["twitter"].includes(t)&&(r=t);let l=n.find(e=>e.id===t);return((null==l?void 0:l.slug)&&(r="".concat(l.slug,"/").concat(i)),r)?"/discover/category/".concat(r):"/discover"}},78118:function(e,t,i){"use strict";i.r(t),i.d(t,{ReaderOnboardingModal:()=>R,ReaderOnboardingModalWithUserContext:()=>A,TwitterStage:()=>I});var n=i(27412),r=i(7409),l=i(99282),a=i(98848),o=i(16584),s=i(98661),c=i(30396),d=i(97742),u=i(93666),h=i(32582),p=i(57391),m=i(60807),b=i(68833),g=i(98914),f=i(341),v=i(57601),_=i(64799),Z=i(14861),y=i(4564),w=i(45930),N=i(76971),S=i(48146),P=i(48450),k=i(7759),x=i(29191),C=i(76560),B=i(60308),E=i(63651),T=i(81821);let I=e=>{let{user:t,useProfilePrefix:i}=e;return(null==t?void 0:t.has_linked_twitter)?(0,o.tZ)(X,{user:t,useProfilePrefix:i}):(0,o.tZ)(L,{})},L=()=>{let[e,t]=(0,c.eJ)(!0);return(0,o.BX)("div",{className:"inbox-access-form link-twitter",children:[(0,o.tZ)(d.Z,{className:"onboarding-main-icon",width:38,height:43}),(0,o.tZ)("h2",{children:"Find writers you follow"}),(0,o.tZ)("section",{className:"twitter-description",children:"Find writers you know on Substack, and let your Twitter followers find you. We’ll never post without your permission."}),(0,o.tZ)("p",{children:(0,o.BX)("label",{className:"let-others-find-me",children:[(0,o.tZ)("input",{type:"checkbox",checked:e,onChange:()=>t(!e)}),"Let others find me via Twitter"]})}),(0,o.tZ)(h.PH,{linkType:"reader",discoverable:e,icon:!1,text:"Connect Twitter"}),(0,o.tZ)("a",{className:"skip",href:"".concat((0,B.ZJn)(),"/profile/fill"),native:!0,children:"Skip for now"})]})},X=e=>{let{user:t,useProfilePrefix:i}=e;return(0,o.tZ)(h.G6,{user:t,onSignup:()=>{let e=(null==t?void 0:t.profile_set_up_at)?(0,B.HMK)():"".concat((0,B.ZJn)(),"/profile/fill");(0,g.uX)(e)},buttonText:"Continue",requireSignup:!1,needsEmailConfirm:!1,useProfilePrefix:i})};class R extends u.p{componentDidMount(){super.componentDidMount(),(0,T.tq)()&&(this.context.exposeExperiment("reader_onboarding_app_first"),this.inAppExperimentTreatment())}componentWillReceiveProps(e){this.setState({skipRedirectOnExit:e.skipRedirectOnExit,zIndex:e.zIndex,entry:e.entry,onBeforeClose:e.onBeforeClose})}getDefaultStep(){return this.state.appOnboardingTreatment?C.c.APP_UPSELL:C.c.CATEGORIES}inAppExperimentTreatment(){if(this.state.appOnboardingTreatment)return this.state.appOnboardingTreatment;let e=(0,T.tq)()&&["treatment","treatment_no_skip"].includes(this.context.getExperimentVariant("reader_onboarding_app_first"));return e&&this.setState({step:C.c.APP_UPSELL,appOnboardingTreatment:!0}),e}openForPub(e,t){this.setState({pub:e,profile:t,step:t?this.props.user?C.c.CATEGORIES:C.c.PUB_SIGNUP:C.c.PUB_LANDING}),this.open()}openToPubSignup(e){this.setState({pub:e,step:C.c.PUB_SIGNUP,profile:null}),this.open()}setStep(e){if(e===C.c.APP_UPSELL&&this.state.appOnboardingTreatment&&this.state.previousStepData[C.c.APP_UPSELL]&&(e=C.c.WELCOME),(0,b.j)(b.FP.READER_ONBOARDING_STEP_CHANGED,{from_step:this.state.step,to_step:e,modal:!0}),e===C.c.EXIT){if(this.state.skipRedirectOnExit)this.close();else{var t;let e=null!==(t=this.redirect)&&void 0!==t?t:this.state.pub&&"reader2"===this.state.entry?(0,B.SVA)(this.state.pub):(0,E.E2n)();document.location.href=e}}else setTimeout(()=>this.setState({step:e}),0)}setPreviousStepData(e,t){this.setState({previousStepData:(0,l._)((0,r._)({},this.state.previousStepData),{[e]:t})})}getClassName(){return"reader-onboarding-modal wide"}onClose(){(0,b.j)(b.FP.READER_ONBOARDING_MODAL_CLOSED,{entry:this.props.entry,step:this.state.step}),this.setStep(this.getDefaultStep())}onOpen(){var e;(0,b.j)(b.FP.READER_ONBOARDING_MODAL_OPENED,{entry:this.props.entry,step:this.state.step,for_pub_id:null===(e=this.state.pub)||void 0===e?void 0:e.id})}handleError(e){let{ignore:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{step:i}=this.state;console.error("Error in reader onboarding ".concat(i," step: ").concat(e)),(0,b.j)(b.FP.READER_ONBOARDING_ERROR,{step:i,entry:this.props.entry,ignore:t}),t||this.setStep(C.c.ERROR)}renderStep(){let e=this.props,{ref:t}=e,i=(0,a._)(e,["ref"]),{step:n,open:s,pub:c,profile:d,previousStepData:u,appOnboardingTreatment:h}=this.state,p={setStep:this.setStep,handleError:this.handleError,close:this.close,setPreviousStepData:this.setPreviousStepData,appOnboardingTreatment:h};if(!s)return null;switch(n){case C.c.SIGNUP:return(0,o.tZ)(P.Z,(0,l._)((0,r._)({},i,p),{previousStepData:u}));case C.c.PUB_LANDING:return(0,o.tZ)(N.Z,(0,l._)((0,r._)({},i,p),{pub:c}));case C.c.PUB_SIGNUP:return(0,o.tZ)(S.Z,(0,l._)((0,r._)({},i,p),{pub:c,profile:null!=d?d:null}));case C.c.CATEGORIES:return(0,o.tZ)(y.r,(0,l._)((0,r._)({},i,p),{pub:c}));case C.c.PROFILE:return(0,o.tZ)(w.Z,(0,r._)({},i,p));case C.c.START_WRITING:return(0,o.tZ)(k.Z,(0,r._)({},i,p));case C.c.CREATE_PUBLICATION:return(0,o.tZ)(v.Z,(0,r._)({},i,p));case C.c.CREATE_PUBLICATION_SUCCESS:return(0,o.tZ)(_.Z,(0,l._)((0,r._)({},i,p),{previousStepData:u}));case C.c.ERROR:return(0,o.tZ)(Z.Z,(0,r._)({},i,p));case C.c.APP_UPSELL:return(0,o.tZ)(f.Z,{onComplete:()=>{this.setPreviousStepData(C.c.APP_UPSELL,!0),h?this.setStep(C.c.CATEGORIES):this.setStep(C.c.WELCOME)}});case C.c.WELCOME:default:return(0,o.tZ)(x.Z,(0,l._)((0,r._)({},i,p),{pub:c,profile:null!=d?d:null}))}}renderChildren(){return(0,o.tZ)("div",{className:"reader-onboarding-modal-container",children:this.renderStep()})}constructor(e,t){var i;super(e,t),(0,n._)(this,"redirect",void 0),this.setStep=this.setStep.bind(this),this.state.pub=e.pub||null,this.handleError=this.handleError.bind(this),this.state.previousStepData={},this.setPreviousStepData=this.setPreviousStepData.bind(this),this.state.skipRedirectOnExit=null!==(i=e.skipRedirectOnExit)&&void 0!==i&&i,this.redirect=e.redirect&&"/"!==e.redirect?e.redirect:null,this.state.appOnboardingTreatment=!1,this.state.step=e.step||this.getDefaultStep()}}(0,n._)(R,"contextType",p.kx);let A=(0,s.forwardRef)((e,t)=>{let i=(0,m.SE)(),n=e.onBeforeClose,a=n?()=>n(i.user):void 0,s=(0,l._)((0,r._)({},e),{onBeforeClose:a,user:i.user});return(0,o.tZ)(R,(0,l._)((0,r._)({},s),{ref:t}))})},22419:function(e,t,i){"use strict";i.d(t,{Wq:()=>l,lq:()=>n,u8:()=>r});let n=25,r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en",{iString:t}=I18N.i(e);return{482856:{blurb:t("Since retiring from the NBA, Kareem Abdul-Jabbar has authored 17 books and written award-winning columns. Now, the basketball legend makes Substack his home for thoughts on sports, politics, and pop culture, and how they define America."),rank:1},260347:{blurb:t("A new media company founded by journalist Bari Weiss, The Free Press employs more than 25 full-time staff. From podcasts, events, and investigative stories to their signature commentary, The Free Press produces work that drives the news and shifts the culture."),rank:2},567420:{blurb:t("New York Times bestseller, Booker Prize winner, and creative writing professor at Syracuse University, George Saunders offers a masterclass in storytelling and the craft of short fiction with a unique, educational Substack. Since 2021, his community has grown to more than 125,000 subscribers."),rank:3},220361:{blurb:t("Recipe developer and cookbook author Caroline Chambers’ number one food newsletter offers family-friendly meals and no-nonsense cooking. She also hosts [So Into That](https://whattocook.substack.com/podcast), a new Substack show featuring acclaimed guests diving into recommendations and lifestyle hacks."),rank:4},1662278:{blurb:t("Painter, fashion director, and illustrator Jenny Walton offers glimpses into her fabulous life in Milan. From vintage shopping and flea market finds to a guide to personal style, Jenny calls her Substack “a nice little place to chat that isn’t Instagram.”"),rank:5},445285:{blurb:t("Fashion and culture writer Viv Chen delivers thoughtful reflections and recommendations for secondhand and designer fashion enthusiasts. If you identify as an eBay gremlin, The Molehill is for you."),rank:6},2325511:{blurb:t("Founded by award-winning journalist Mehdi Hasan, Zeteo is a new media organization with more than 150,000 subscribers. Zeteo publishes a weekly streaming show, [Mehdi Unfiltered](https://zeteo.com/s/mehdi-unfiltered), alongside podcasts and essays from contributors including Greta Thunberg, John Harwood, Viet Thanh Nguyen, and Naomi Klein."),rank:7},61371:{blurb:t("Pioneering blogger and journalist Andrew Sullivan publishes essays on politics and the culture wars on his Substack The Weekly Dish, which is also home to his podcast, [The Dishcast](https://andrewsullivan.substack.com). With more than 160,000 subscribers, Sullivan is among the most influential writers in U.S. politics."),rank:8}}},l=(e,t)=>{if(!e)return"featured";if("featured"===e||"twitter"===e||"podcast"===e)return e;let i=t.find(t=>t.slug===e);return i?i.id:"featured"}}}]);