티스토리 수익 글 보기

티스토리 수익 글 보기

“use strict”;(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([[“1373″],{92962:function(e,t,n){n.d(t,{A:()=>i});let i={table:”table-BAJTHQ”,tr:”tr-jyGCha”,tbody:”tbody-EyZ57l”,”border-left-detail”:”border-left-detail-eIBFIK”,borderLeftDetail:”border-left-detail-eIBFIK”,td:”td-ucFIGn”,th:”th-Z3IRfp”,”border-right-detail”:”border-right-detail-n56elr”,borderRightDetail:”border-right-detail-n56elr”,”border-bottom-detail”:”border-bottom-detail-JKtjOR”,borderBottomDetail:”border-bottom-detail-JKtjOR”,”position-relative”:”position-relative-wVH5ml”,positionRelative:”position-relative-wVH5ml”,”position-sticky”:”position-sticky-erqDrM”,positionSticky:”position-sticky-erqDrM”,thead:”thead-yvbVgS”,tfoot:”tfoot-nBK5Jw”,caption:”caption-ljUjSd”,handle:”handle-TqIPca”}},24311:function(e,t,n){n.d(t,{A:()=>i});let i={input:”input-y4v6N4″,textarea:”textarea-GbEjRX”,autogrowing:”autogrowing-_ipn9Y”,inputText:”inputText-pV_yWb”,inputWithButtonWrapper:”inputWithButtonWrapper-qFTACT”,primary:”primary-MUgbK6″,”secondary-outline”:”secondary-outline-JXafwf”,secondaryOutline:”secondary-outline-JXafwf”,inputWithButtonInput:”inputWithButtonInput-KDznfS”,start:”start-p226EZ”,end:”end-LEvC6s”,segmentedInputContainer:”segmentedInputContainer-BnsX3X”,inputWithButtonButton:”inputWithButtonButton-SsgPne”,focus:”focus-nqjos7″,leading:”leading-hoxUwz”,trailing:”trailing-cHz8Pv”,error:”error-QSGsmD”,disabled:”disabled-bZ2Wej”,readOnly:”readOnly-yVYuPy”,wrapper:”wrapper-JJvHsG”,position_leading:”position_leading-_w7oUS”,positionLeading:”position_leading-_w7oUS”,size_sm:”size_sm-nn6jzC”,sizeSm:”size_sm-nn6jzC”,size_md:”size_md-UKpzt4″,sizeMd:”size_md-UKpzt4″,position_trailing:”position_trailing-kaOmCa”,positionTrailing:”position_trailing-kaOmCa”,unstyled:”unstyled-IJLUJU”}},13649:function(e,t,n){n.d(t,{A:()=>i});let i={tab:”tab-ntEFBb”}},84759:function(e,t,n){n.d(t,{A:()=>i});let i={imageContainer:”imageContainer-ZCdWLc”,imageContainerFullHeight:”imageContainerFullHeight-hF_KGu”,overlay:”overlay-SefqcL”,image:”image-MSZo7W”,downloadButton:”downloadButton-lyp4Aa”,loading:”loading-BBOJtl”,link:”link-D8bzcd”}},18993:function(e,t,n){n.d(t,{Cc:()=>e1,Dx:()=>e2,I3:()=>ey,I8:()=>ex,SN:()=>te,Wy:()=>eO,ZT:()=>e9,gJ:()=>eP,gL:()=>eg,lS:()=>em,lg:()=>e_,lk:()=>eb,mj:()=>e5,p8:()=>eT});var i=n(69277),a=n(70408),r=n(32641),o=n(79785),l=n(4006);n(50172);var c=n(45994),s=n(32485),d=n.n(s),u=n(95201),p=n.n(u),h=n(99609),m=n(40972),g=n(54718),y=n(35404),f=n(82853),b=n(48587),Y=n(54687),v=n(98188),_=n(37946),w=n(48686),k=n(16079),A=n(32708),C=n(65892),S=n(87677),N=n(67078),I=n(26683),x=n(73040),D=n(91461),T=n(86404),F=n(66443),E=n(72880);n(15688);var R=n(82936),P=n(84605),U=n(46275),B=n(46271),O=n(88325),z=n(25714),L=n(86500),W=n(27069),j=n(94729),H=n(72569),M=n(68349),K=n(24078),G=n(15040),V=n(35369),J=n(17028),q=n(88774),Q=n(75303),X=n(81929),Z=n(36372),$=n(3046),ee=n(46647),et=n(69089),en=n(70486),ei=n(42831),ea=n(53457),er=n(32848),eo=n(20437),el=n(49807),ec=n(82776),es=n(11993),ed=n(45464),eu=n(3898),ep=n(36083);function eh(){let e=(0,o._)([“You are not allowed to post or react to this chat. “,””]);return eh=function(){return e},e}function em(e){var t,n,i;let{communityPost:a,author:r,pubRole:o,userStatus:s,extras:d,withAttribution:u,flex:p,hideReply:m,isReadOnly:g,onReply:y,onDelete:f,pub:b,truncate:Y=!0,surface:v,useClientSideRouting:_,utmSource:w,isPaid:k,isFounding:A}=e,{iString:C}=(0,P.GO)(),S=(0,c.li)(null),N=_?(0,el.e$6)({pubId:a.publication_id,postId:a.id,noBase:!0}):(0,el.sWz)({postId:a.id,utm_source:w}),I=(0,ei.d)({entityType:”communityPost”,publication:b}),x=(0,R._N)(a.user_id);return(0,l.FD)(eR,{pubThemeAccentColor:null!=(i=null==b||null==(t=b.theme)?void 0:t.background_pop_color)?i:null==b?void 0:b.theme_var_background_pop,pubThemePrintOnPopColor:null==b||null==(n=b.theme)?void 0:n.print_on_pop,user:r,pubRole:o,userStatus:s,flex:p,containerRef:S,extras:d,children:[u&&(0,l.Y)(e5,{text:”From “.concat(r.name,”’s subscriber chat”)}),!x&&(0,l.Y)($.Nf,{user:r}),(0,l.Y)(ef,{actionMenuProps:{communityEntity:a,publicationId:a.publication_id,replyAction:y&&!m&&(0,l.Y)(q.Dr,{leading:(0,l.Y)(h.A,{}),disabled:a.is_locked,onClick:y,children:C(“Reply”)}),onReply:g||m||a.is_locked?void 0:y,onDelete:f,onReport:I,isReadOnly:g,isFlagged:a.reported_by_user},flex:p,children:(0,l.Y)(eg,{communityPost:a,hideReply:m,userBlockStatus:x,isFounding:A,isPaid:k,isReadOnly:g,useClientSideRouting:_,utmSource:w,pub:b,truncate:Y,surface:v,author:r})}),!m&&(0,l.Y)(Q.AE,{href:N,children:(0,l.Y)(e2,{onClick:y,direction:”incoming”,commenters:a.recent_commenters,count:a.comment_count,hasUnread:!!(a.most_recent_comment_created_at&&a.user_last_viewed_timestamp&&a.user_last_viewed_timestamp0||C),N=null!=b?b:{type:”posts”,id:t.id},{audience:I}=t,{canReply:x,shouldShowToken:D}=e3({audience:I,isFounding:c,isPaid:s,chatPaywallStatus:null==u?void 0:u.paywall_chat}),T=(0,en.wA)(),E=m?(0,el.e$6)({pubId:t.publication_id,postId:t.id,noBase:!0,params:{backAction:w}}):(0,el.sWz)({postId:t.id,utm_source:g}),R=function(e,t){if(!e||!(null==t?void 0:t.url))return e;let n=t.url,i=e.trim();return i.startsWith(n)?i.slice(n.length).trim():i.endsWith(n)?i.slice(0,-n.length).trim():e}(t.body,t.link_metadata),P=e=>{“feed-recommended”!==N.type&&(Y?Y({id:t.id,reaction:e}):eb(t.id,”posts”,T,t.reaction)(e))},U=null!=v?v:t.reaction,B=null!=_?_:t.reactions,z=p&&(p.startsWith(“chat_inbox”)?”chat_inbox”:(0,O.u)(p));return(0,l.FD)(eq,{hasFooter:!n,children:[!r&&”media”===t.type&&(A.length>0||C)&&(0,l.FD)(et.e,{context:N,reactions:B,currentReaction:U,onReactionClick:P,isReadOnly:o,children:[C&&(0,l.Y)(eo.R8,{mediaUpload:C.mediaUpload,composing:!1,maxWidth:400,videoPlayerProps:{surface:z,entityType:”community_post”,entityKey:t.id,contentType:”communityPost”,primaryEntityKey:h,primaryEntityType:h?”post”:void 0}},C.mediaUpload.id),A&&(0,l.FD)(J.az,{children:[(0,l.Y)(F.K,{assets:A.filter(e=>e.url).map(e=>({src:e.url,explicit:e.explicit,width:e.width,height:e.height})),className:d()(ed.A.imageGroup,n&&!t.body&&ed.A.isLast),maxWidth:400,maxHeight:420,readOnly:o,isContained:!0,outline:k}),D&&!t.body&&(0,l.Y)(eZ,{className:ed.A.right,canReply:!!x,audience:t.audience,style:”media”})]})]}),!r&&t.link_metadata&&(0,l.Y)(et.e,{context:N,reactions:B,currentReaction:null!=v?v:t.reaction,onReactionClick:P,setReactions:!!(S&&t.link_metadata),isReadOnly:o,alignSelf:”stretch”,children:(0,l.Y)($.ZT,{metadata:t.link_metadata,isFirst:S,direction:”incoming”})}),(t.body||S&&!t.link_metadata)&&(0,l.Y)(et.e,{context:N,reactions:B,currentReaction:null!=v?v:t.reaction,onReactionClick:P,setReactions:S&&!t.link_metadata,isReadOnly:o,alignSelf:”stretch”,children:R&&(0,l.Y)(Q.AE,{href:E,style:{display:”flex”},children:(0,l.Y)(eX,{publication:u,communityEntity:(0,a._)((0,i._)({},t),{body:R}),onClick:e=>{!e.defaultPrevented&&f&&f(e)},truncate:y,isPaid:s,isFounding:c,outline:k})})})]})}let ey=e=>{let t=[],n=null;for(let i of e)”image”===i.type?t.push(i):n||(n=i);return{images:t,video:n}};function ef(e){let{children:t,actionMenuProps:n,flex:a=”grow”}=e;return(0,l.FD)(J.Ye,{alignItems:”start”,gap:12,flex:a,children:[(0,l.Y)($.dU,{children:t}),(0,l.Y)(eB,(0,i._)({},n))]})}let eb=(e,t,n,i)=>async a=>{i===a?n(ev(a,e,t)):n(eY(a,e,t,i))},eY=(e,t,n,i)=>async(a,r)=>{let{iString:o,iTemplate:l}=I18N.i(“en”);a({type:””.concat(n,”-new_reaction”),payload:{id:t,reaction:e}});let c=await (0,I.YD)(e,t,n);if(c instanceof j.fk){var s,d;(null==(s=c.body)?void 0:s.status)===”PUBLICATION_BAN”?alert(l(eh(),null==(d=c.body)?void 0:d.error)):alert(o(“We failed post your reaction. Please try again later.”))}else(0,W.v)(c,{message:”Failed to add reaction”});c instanceof Error&&a(i?{type:””.concat(n,”-new_reaction”),payload:{id:t,reaction:i}}:{type:””.concat(n,”-remove_reaction”),payload:{id:t,reaction:e}})},ev=(e,t,n)=>async(i,a)=>{i({type:””.concat(n,”-remove_reaction”),payload:{id:t,reaction:e}}),await (0,I.jx)(e,t,n) instanceof Error&&i({type:””.concat(n,”-new_reaction”),payload:{id:t,reaction:e}})},e_=(e,t)=>{let{id:n,body:r,parent_id:o,quote_id:l,mentions:c}=t;return async(t,s)=>{let[d,u]=o?[“replies”,{parentCommentId:o}]:[“comments”,{postId:e}];try{let s=await (0,j.x6)(“/api/v1/community/posts/”.concat(e,”/comments”),{method:”POST”,json:{id:n,body:null!=r?r:””,parent_id:o,quote_id:l,mentions:c}});t({type:””.concat(d,”-commit”),payload:(0,a._)((0,i._)({},u),{id:n,reply:s})})}catch(e){if(e instanceof j.fk){if(“verify_phone”==(0,j.fR)(e))throw e;”PUBLICATION_BAN”===e.body.status?alert(“You are not allowed to post to this chat. “.concat(e.body.error)):alert(“We failed to post your comment. Please try again later.”)}else throw(0,W.v)(e,{message:”Failed to post comment”}),e}}};async function ew(e,t){try{return await fetch(“/api/v1/community/posts/”.concat(e),{method:”PATCH”,headers:{“Content-Type”:”application/json”},body:JSON.stringify({is_locked:t})})}catch(e){return e}}async function ek(e,t){try{return await fetch(“/api/v1/community/comments/”.concat(e),{method:”PATCH”,headers:{“Content-Type”:”application/json”},body:JSON.stringify({is_locked:t})})}catch(e){return e}}async function eA(e,t){try{return await fetch(“/api/v1/community/comments/”.concat(e,”/publication_bans?ban=”).concat(t.toString()),{method:”POST”})}catch(e){return e}}async function eC(e){try{return await (0,j.x6)(“/api/v1/community/comments/”.concat(e),{method:”DELETE”,json:{commentId:e}})}catch(e){return e}}async function eS(e){try{return await (0,j.x6)(“/api/v1/community/comments/”.concat(e),{method:”GET”})}catch(e){return console.warn(e),e}}async function eN(e){try{return await (0,j.x6)(“/api/v1/community/posts/”.concat(e),{method:”GET”})}catch(e){return console.warn(e),e}}async function eI(e){try{return await (0,j.x6)(“/api/v1/community/posts/”.concat(e),{method:”DELETE”,json:{postId:e}})}catch(e){return e}}function ex(e){let{author:t,extras:n,showReply:r=!0,analyticsParams:o,commenters:s,count:d,audience:u,paywallInfo:p,onClick:h}=e;return(0,c.vJ)(()=>{var e;o&&(0,L.u4)(L.qY.THREAD_PAYWALL_SCREEN_VIEWED,(0,a._)((0,i._)({},o),{audience:u&&(“only_founding”===(e=u)?”founding”:”only_paid”===e?”paid”:”free”)}))},[]),(0,l.FD)(eR,{user:t,extras:n,children:[t&&(0,l.Y)($.Nf,{user:t}),(0,l.FD)(eq,{children:[p?(0,l.Y)(e7,{audience:u,paywallInfo:p,onClick:h}):(0,l.Y)(e6,{audience:u,onClick:h}),r&&(0,l.Y)(e2,{isLocked:!0,direction:”incoming”,commenters:s,count:d,onClick:h})]})]})}function eD(e){return”string”==typeof e.message}function eT(e){let{text:t,rawText:n,specialText:i,mentionMap:a,direction:r=”incoming”,limit:o=600,linkify:s=!0}=e,{iString:u}=(0,P.GO)(),[p,h]=(0,c.J0)(!1);if(i)return(0,l.Y)(“em”,{children:i});if(!t)return(0,l.Y)(l.FK,{});let m=[{characters:t.length,message:t}];n&&a&&(m=function(e,t,n){let i=/\$\{(\d+)\}/g,a=i.exec(e),r=[],o=0;for(;a;){var c,s,d;let u=t[Number(a[1])],p=u.text.slice(1);u?(a.index>o&&r.push({characters:a.index-o,message:e.slice(o,a.index)}),r.push({characters:u.text.length,message:(c=u.user_id,s=p,d=n,(0,l.Y)(z.P,{id:c,label:s,type:”user”,unstyled:”outgoing”===d}))})):r.push({characters:i.lastIndex-o,message:e.slice(o,i.lastIndex)}),o=i.lastIndex,a=i.exec(e)}return ot&&eD(e)){let i=t-n,r={characters:i,message:e.message.slice(0,i)},o={characters:e.characters-i,message:e.message.slice(i)};e=r,a.push(o)}n+=e.characters,i.push(e)}else a.push(e)}return{alwaysShow:i,afterExpansion:a}}(m,o),f=y.length>0;return(0,l.FD)(l.FK,{children:[g.map(e=>s&&eD(e)?(0,l.Y)(eF,{children:e.message}):e.message),f&&!p&&(0,l.FD)(l.FK,{children:[(0,l.Y)(“span”,{children:” “}),(0,l.Y)(V.Nm,{resetCss:!0,className:d()(ed.A.readMore,ed.A[r]),onClick:e=>{e.preventDefault(),h(!0)},children:u(“See more”)})]}),f&&p&&(0,l.Y)(l.FK,{children:y.map(e=>s&&eD(e)?(0,l.Y)(eF,{children:e.message}):e.message)})]})}function eF(e){let{children:t}=e;return(0,l.Y)(p(),{options:{attributes:{rel:”nofollow ugc”,onClick:e=>e.stopPropagation()},className:ed.A.textLink,format:(e,t)=>”url”===t?(0,es.H)(e,64):e},children:t})}function eE(e){return void 0===e.post_id}function eR(e){var t;let{user:n,children:i,extras:a,flex:r=”grow”,containerRef:o,id:c,pubRole:s,userStatus:u,pubThemeAccentColor:p,pubThemePrintOnPopColor:h}=e,m=(0,R._N)(null!=(t=null==n?void 0:n.id)?t:0);return(0,l.FD)(J.I1,{id:c,flex:r,gap:2,ref:o,className:d()(eu.A.reactionsHoverZone,ed.A.avatarContainer),children:[(0,l.FD)(J.pT,{alignItems:”end”,gap:12,children:[(0,l.Y)(J.pT,{paddingTop:4,children:m?(0,l.Y)(eP,{user:n}):n?(0,l.Y)(te,{pubThemeAccentColor:p,pubThemePrintOnPopColor:h,user:n,pubRole:s,userStatus:u,size:32}):(0,l.Y)(eU,{})}),(0,l.Y)(J.I1,{flex:”grow”,gap:2,position:”relative”,alignItems:”start”,children:i})]}),a&&(0,l.FD)(J.pT,{gap:12,children:[(0,l.Y)(J.az,{width:32}),(0,l.Y)(J.I1,{flex:”grow”,gap:4,children:a})]})]})}function eP(e){let{user:t}=e,n=(0,U.BR)().isOnDestination;return(0,l.Y)(Q.AE,{href:t?(0,el.gYq)(t,{noBase:n}):void 0,children:(0,l.Y)(eU,{children:(0,l.Y)(m.A,{size:20,stroke:”var(–color-fg-tertiary)”})})})}let eU=(0,Q.I4)({radius:”full”,width:32,height:32,bg:”secondary”},Q.ov);function eB(e){var{isNew:t}=e,n=(0,r._)(e,[“isNew”]);if(t)return null;let{onNewQuote:a,onReply:o,communityEntity:c}=n;return(0,l.FD)(J.pT,{alignItems:”center”,gap:4,className:ed.A.actions,children:[a&&c&&(0,l.Y)(ez,{onNewQuote:a,communityComment:c}),o&&c&&(0,l.Y)(eL,{onReply:o}),(0,l.Y)(q.W1,{trigger:(0,l.Y)(V.K0,{“aria-label”:”Options”,size:”sm”,priority:”tertiary”,children:(0,l.Y)(g.A,{size:20})}),children:(0,l.Y)(eO,(0,i._)({},n))})]})}function eO(e){let{communityEntity:t,replyAction:n,onDelete:i,onReport:a,isReadOnly:r,publicationId:o,isBanned:c,isFlagged:s,onNewQuote:d}=e,u=(0,B.Jd)(),{isAuthor:p,publicationUser:h}=(0,er.NL)(null!=o?o:0),m=(null==h?void 0:h.role)===”community_moderator”,g=o&&p,y=t&&u&&t.user_id===u.id,f=t&&!eE(t),b=f&&”parent_id”in t&&null!==t.parent_id,Y=y||g||m,v=y||g||m,_=!y&&!s,w=(g||m)&&f&&!y,k=!f&&u&&(null==t?void 0:t.user_id)===u.id;return t?(0,l.FD)(l.FK,{children:[(0,l.Y)(eH,{communityEntity:t}),t.body&&(0,l.Y)(ej,{communityEntity:t}),!r&&d&&f&&(0,l.Y)(eW,{onNewQuote:d,communityComment:t}),!r&&n,k&&(0,l.Y)(eK,{communityEntity:t}),(0,l.FD)(q.H9,{children:[!r&&!b&&v&&(0,l.Y)(eM,{communityEntity:t}),!r&&Y&&(0,l.Y)(eJ,{communityEntity:t,onDelete:i}),!r&&void 0!==c&&w&&(0,l.Y)(eV,{communityEntity:t,isBanned:c}),!r&&_&&(0,l.Y)(eG,{onReport:a,communityEntity:t})]}),(0,l.Y)(q.NW,{children:(0,l.Y)(J.pT,{paddingY:4,children:(0,l.Y)(ee.D,{conjunction:!0,timestamp:t.created_at})})})]}):null}function ez(e){let{onNewQuote:t,communityComment:n}=e;return(0,l.Y)(V.K0,{size:”sm”,priority:”tertiary”,”aria-label”:”Reply”,onClick:()=>{t(n)},children:(0,l.Y)(h.A,{size:20})})}function eL(e){let{onReply:t}=e;return(0,l.Y)(V.K0,{size:”sm”,priority:”tertiary”,”aria-label”:”Reply”,onClick:t,children:(0,l.Y)(h.A,{size:20})})}function eW(e){let{onNewQuote:t,communityComment:n}=e,{iString:i}=(0,P.GO)();return(0,l.Y)(q.Dr,{leading:(0,l.Y)(h.A,{}),onClick:()=>{t(n)},children:i(“Reply”)})}function ej(e){let{communityEntity:t}=e,{iString:n}=(0,P.GO)(),i=(0,Z.d)();return(0,l.Y)(q.Dr,{leading:(0,l.Y)(y.A,{}),onClick:()=>{if(t){let{body:e}=t;(0,M.lW)(e),i.popToast(()=>(0,l.Y)(Z.y,{text:n(“Text copied to clipboard”),Icon:y.A}))}},children:n(“Copy text”)})}function eH(e){let{communityEntity:t}=e,{iString:n}=(0,P.GO)(),i=(0,H.c)(),{id:a}=t,r=eE(t);return(0,l.Y)(q.Dr,{leading:(0,l.Y)(f.A,{}),onClick:()=>{let e;if(r)e=(0,el.sWz)({postId:a});else if(t.parent_id){var n;e=(0,el.j5y)({commentId:null!=(n=t.parent_id)?n:a,targetReplyId:t.parent_id?a:void 0,showTarget:!0})}else e=(0,el.sWz)({postId:t.post_id,targetReplyId:t.id,showTarget:!0});i(e)},children:n(“Copy link”)})}function eM(e){let{communityEntity:t}=e,{iString:n}=(0,P.GO)(),i=(0,en.wA)(),a=(0,Z.d)(),{id:r,is_locked:o}=t,c=eE(t),s=async()=>{if(c){let e;i((e=!o,async(t,n)=>{t({type:”posts-lock_replies”,payload:{id:r,isLocked:e}});let i=await ew(r,e);i instanceof Error&&(console.warn(“error locking post”,i),alert(“There was an error “.concat(e?”locking”:”unlocking”,” replies to this post. Please try again later.”)),t({type:”posts-lock_replies”,payload:{id:r,isLocked:!e}}))}))}else{let e;i((e=!o,async(t,n)=>{t({type:”comments-lock_replies”,payload:{id:r,isLocked:e}});let i=await ek(r,e);i instanceof Error&&(console.warn(“error locking comment”,i),alert(“There was an error “.concat(e?”locking”:”unlocking”,” replies to this comment. Please try again later.”)),t({type:”comments-lock_replies”,payload:{id:r,isLocked:!e}}))}))}o?a.popToast(()=>(0,l.Y)(Z.y,{text:n(“Enabled replies”),Icon:Y.A})):a.popToast(()=>(0,l.Y)(Z.y,{text:n(“Disabled replies”),Icon:b.A}))};return(0,l.Y)(q.Dr,{leading:(0,l.Y)(b.A,{}),onClick:s,priority:”destructive”,children:o?n(“Re-enable replies”):n(“Disable replies”)})}function eK(e){let{communityEntity:t}=e,n=(0,en.wA)(),i=eE(t),a=async()=>{i&&n({type:”posts-edit_post”,payload:{post:t}})};return(0,l.Y)(q.Dr,{leading:(0,l.Y)(v.A,{}),onClick:a,priority:”primary”,children:”Edit”})}function eG(e){let{onReport:t,communityEntity:n}=e,{iString:i}=(0,P.GO)();return(0,l.Y)(l.FK,{children:(0,l.Y)(q.Dr,{leading:(0,l.Y)(_.A,{}),onClick:()=>{t(n.id,”admin”!==n.user_pub_role)},priority:”destructive”,children:i(“Report”)})})}function eV(e){let{communityEntity:t,isBanned:n}=e,{iString:i}=(0,P.GO)(),a=(0,en.wA)(),r=async()=>{if(confirm(“Are you sure you want to ban this user?”)){let e,{id:i}=t;a((e=!n,async(t,n)=>{t({type:”comments-ban_author”,payload:{id:i,ban:e}});let a=await eA(i,e);a instanceof Error&&(console.warn(“error toggling ban for comment author”,a),alert(“There was an error “.concat(e?”banning”:”unbanning”,” this user. Please try again later.”)),t({type:”comments-ban_author”,payload:{id:i,ban:!e}}))}))}};return(0,l.Y)(q.Dr,{leading:n?(0,l.Y)(w.A,{}):(0,l.Y)(k.A,{}),onClick:r,priority:”destructive”,children:i(n?”Unban”:”Ban”)})}function eJ(e){let{communityEntity:t,onDelete:n}=e,{iString:i}=(0,P.GO)(),a=(0,en.wA)(),r=eE(t),o=async()=>{if(confirm(“Are you sure you want to delete this “.concat(r?”thread”:”comment”,”?”))){let{id:e}=t;if(r){let{publication_id:n}=t;a(async(t,i)=>{t({type:”posts-delete_post”,payload:{id:e,publication_id:n}});let a=await eI(e);a instanceof Error&&console.warn(“error deleting thread”,a)})}else{let{post_id:n,parent_id:i}=t;a(async(t,a)=>{t({type:”comments-delete_comment”,payload:{id:e,postId:n}});let r=await eC(e);if(r instanceof Error&&console.warn(“error deleting comment”,r),i){let e=await eS(i);e instanceof Error||t({type:”comments-update_comment”,payload:{id:i,comment:e.comment}})}let o=await eN(n);o instanceof Error||t({type:”posts-update_post”,payload:{id:n,post:o.communityPost}})})}n&&setTimeout(n,500)}};return(0,l.Y)(q.Dr,{leading:(0,l.Y)(A.A,{}),onClick:o,priority:”destructive”,children:i(“Delete”)})}function eq(e){var{hasFooter:t}=e,n=(0,r._)(e,[“hasFooter”]);return(0,l.Y)(J.I1,(0,i._)({className:d()(ed.A.bubbleStack,t&&ed.A.hasFooter),gap:2,alignItems:”start”},n))}function eQ(e){var{isTargeted:t,className:n}=e,a=(0,r._)(e,[“isTargeted”,”className”]);return(0,l.Y)(J.I1,(0,i._)({className:d()(ed.A.bubble,t&&ed.A.highlight,n),sizing:”border-box”,paddingY:8,paddingX:12,bg:”secondary”,minWidth:0,gap:8},a))}function eX(e){let{communityEntity:t,publication:n,isTargeted:i,onClick:a,truncate:r=!0,isPaid:o,isFounding:c,outline:s}=e,{audience:d}=t,{canReply:u,shouldShowToken:p}=e3({audience:d,isFounding:c,isPaid:o,chatPaywallStatus:null==n?void 0:n.paywall_chat}),h=p||t.is_edited,m=t.reactions?Object.keys(t.reactions).length:0;return(0,l.FD)(eQ,{isTargeted:i,onClick:a,className:ep.A[m>0?”reactions-“.concat(m):””],outline:s,children:[(0,l.Y)(e4,{communityEntity:t,truncate:r}),h&&(0,l.FD)(J.Ye,{justifyContent:”end”,gap:2,children:[p&&(0,l.Y)(eZ,{canReply:!!u,audience:d}),t.is_edited&&(0,l.Y)(e0,{})]})]})}function eZ(e){let{canReply:t,audience:n,style:i=”default”,showLabel:a=!0,className:r}=e,o=a?”media”===i?”var(–vibrance-primary)”:”var(–color-chat-incoming-fg-primary)”:”var(–color-fg-primary)”;return(0,l.FD)(X.vw,{className:d()(ed.A.paywallReplyTag,”media”===i&&ed.A.media,!a&&ed.A.iconOnly,r),priority:”secondary”,children:[t?(0,l.Y)(T.A,{size:12,color:o}):(0,l.Y)(D.A,{size:12,color:o}),a&&(0,l.Y)(J.EY.B5,{weight:”medium”,children:e$.get(n)})]})}let e$=new Map([[“only_paid”,”Paid subscribers only”],[“only_paid_replies”,”Paid subscriber replies”],[“only_founding”,”Founding members only”],[“only_founding_replies”,”Founding member replies”]]);function e0(){return(0,l.FD)(X.vw,{className:ed.A.paywallReplyTag,priority:”secondary”,children:[(0,l.Y)(C.A,{size:12}),(0,l.Y)(J.EY.B5,{weight:”medium”,children:”Edited”})]})}function e1(e){let{author:t,body:n,direction:i,onClick:a,children:r,isFirst:o=!0,pubThemeBackgroundColor:c,isAuthorContributor:s}=e,u=”incoming”===i&&s,p=u&&c;return(0,l.Y)(J.pT,{pullX:4,children:(0,l.FD)(J.pT,{gap:12,className:d()(ed.A.quote,ed.A[i],!o&&ed.A.notFirst,u&&ed.A.author),onClick:a,radius:”md”,overflow:”hidden”,padding:8,flex:”grow”,style:{“–color-chat-author-bg-overlay”:p?””.concat(c,”33″):”oklch(from var(–color-bg-accent-themed) l c h / 0.2)”},children:[(0,l.FD)(J.I1,{children:[(0,l.Y)(J.EY.B4,{weight:”bold”,children:null!=t?t:””}),(0,l.Y)(J.EY.B3,{clamp:2,isParagraph:!0,children:n})]}),r]})})}function e4(e){var t,n,i,a,r;let{communityEntity:o,truncate:c=!0}=e,s=null,d=eE(o)?”thread”:”reply”;o.reported_by_user&&(s=”You reported this “.concat(d)),”deleted”!==o.status&&o.body||(s=”This “.concat(d,” is not available”));let u=(0,R._N)(o.user_id);s||”blocking”!==u?s||”blocked”!==u||(s=”This person is blocked”):s=”This person blocked you”;let p=null!=(t=o.raw_body)?t:o.body;return p?eE(o)&&o.link_url&&!o.link_metadata&&(p=””.concat(p,”\n\n”).concat(o.link_url).trim()):eE(o)?(null==(i=o.media_assets)?void 0:i.length)?s=””.concat(o.media_assets.length,” “).concat(o.media_assets.length>1?”photos”:”photo”,”.”):o.link_url&&(o.link_metadata?s=’Link: “‘.concat(o.link_metadata.title,'”‘):(p=o.link_url,s=null)):(null==(n=o.media_uploads)?void 0:n.length)&&(s=””.concat(o.media_uploads.length,” “).concat(o.media_uploads.length>1?”photos”:”photo”,”.”)),(0,l.Y)(J.EY.B3,{className:ed.A.body,isParagraph:!0,children:(p||s)&&(0,l.Y)(eT,{text:p,rawText:null!=(a=o.raw_body)?a:””,mentionMap:Array.isArray(o.mentions)?void 0:null!=(r=o.mentions)?r:void 0,specialText:s,limit:c?void 0:9999999})})}function e2(e){let{isLocked:t,count:n=0,commenters:i,hasUnread:a,onClick:r,direction:o,outline:c}=e,{iString:s,iPlural:u}=(0,P.GO)();return(0,l.Y)($.Zh,{isLast:!0,messageDirection:o,onClick:r,cursor:r?”pointer”:void 0,height:36,paddingY:4,paddingRight:12,paddingLeft:12,outline:c,children:(0,l.FD)(J.pT,{justifyContent:”space-between”,alignItems:”center”,gap:32,children:[(0,l.FD)(J.pT,{alignItems:”center”,gap:8,children:[i&&n>0&&(0,l.Y)(J.pT,{className:ed.A.facepile,alignItems:”center”,children:i.map(e=>(0,l.Y)(K.eu,{className:d()(ed.A.facepileAvatar,”outgoing”===o&&ed.A.outgoing),user:e,size:22}))}),(0,l.Y)(J.pT,{gap:8,alignItems:”center”,children:(0,l.Y)(J.EY.B3,{as:”span”,className:a?ed.A.hasUnread:ed.A.noUnread,children:0===n?s(“Leave a reply”):u(“%1 reply”,”%1 replies”,n)})})]}),t?(0,l.Y)(D.A,{size:14,color:”var(–color-chat-fg-secondary)”}):(0,l.Y)(S.A,{size:20,stroke:a?”var(–color-chat-reply-active)”:”var(–color-chat-fg-secondary)”})]})})}function e6(e){let{audience:t,href:n,onClick:i}=e;return(0,l.Y)(J.I1,{className:ed.A.paywallBubble,as:n?”a”:”div”,onClick:i,cursor:i?”pointer”:void 0,alignSelf:”stretch”,alignItems:”center”,justifyContent:”center”,bg:”secondary”,href:n,target:n?”_blank”:void 0,children:(0,l.FD)(J.pT,{alignItems:”center”,gap:4,children:[(0,l.Y)(N.A,{size:12,stroke:”var(–color-fg-secondary)”}),(0,l.Y)(J.EY.Meta,{weight:”semibold”,children:”only_founding”===t?”FOUNDING MEMBERS ONLY”:”only_paid”===t?”PAID SUBSCRIBERS ONLY”:”SUBSCRIBERS ONLY”})]})})}function e3(e){let{audience:t,isFounding:n,isPaid:i,chatPaywallStatus:a}=e,r=[“only_founding”,”only_founding_replies”].includes(t);return{canReply:n||”all_subscribers”===t||i&&[“only_paid”,”only_paid_replies”].includes(t),shouldShowToken:a&&(“free”===a&&”all_subscribers”!==t||”paid”===a&&r)}}function e7(e){let{paywallInfo:t,audience:n,onClick:i}=e,{mediaAttachments:a}=t,{body:r}=t,o=a[0];return r||o||(r=[,,,,].fill(“Blah blah blah blahhhhh blah.”).join(” “)),(0,l.FD)(l.FK,{children:[o&&(0,l.Y)(J.I1,{position:”relative”,children:(0,l.Y)(F.K,{className:ed.A.ImageGrid,assets:[{src:o.thumb_url,width:o.width,height:o.height,explicit:!1}],maxWidth:400,maxHeight:420,readOnly:!0,isContained:!0,children:(0,l.Y)(e8,{className:ed.A.paywallFade,children:(0,l.Y)(eZ,{canReply:!1,audience:null!=n?n:”only_paid”,style:”media”,showLabel:!r,className:r?ed.A.right:ed.A.center})})})}),r&&(0,l.FD)(eQ,{className:ed.A.bubble,onClick:i,children:[(0,l.Y)(J.EY.B3,{className:ed.A.paywallText,isParagraph:!0,children:r}),(0,l.Y)(e8,{className:d()(ed.A.paywallFade,ed.A.paywallBlur),children:(0,l.Y)(J.az,{className:ed.A.paywallReplyTagAbsolute,children:(0,l.Y)(eZ,{canReply:!1,audience:null!=n?n:”only_paid”,style:”media”})})})]})]})}let e8=(0,Q.I4)({position:”absolute”,inset:0,alignItems:”center”,justifyContent:”center”},Q.VP);function e9(e){let{linkUrl:t,linkMetadata:n,postId:i}=e,a=(0,en.wA)(),{data:r}=(0,ea.B)(t,{auto:!n,onReceive:e=>{i&&a({type:”posts-link_metadata”,payload:{id:i,link_metadata:e}})}}),o=null!=n?n:r;if(!o)return null;let c=null==o?void 0:o.title,s=null==o?void 0:o.image,d=null==o?void 0:o.host;return(0,l.Y)(eQ,{alignSelf:”stretch”,children:(0,l.FD)(J.pT,{as:”a”,href:t,target:”_blank”,className:ed.A.linkBubble,onClick:e=>e.stopPropagation(),gap:12,justifyContent:”center”,bg:”secondary”,alignItems:”start”,flex:”grow”,sizing:”border-box”,paddingY:4,minWidth:0,children:[(0,l.FD)(J.I1,{minWidth:0,gap:2,flex:”grow”,children:[d&&(0,l.Y)(J.EY.B4,{color:”secondary”,ellipsis:!0,children:d}),c&&(0,l.Y)(J.EY.B3,{color:”primary”,weight:”medium”,clamp:2,children:c})]}),s&&(0,l.Y)(J.I1,{radius:”md”,overflow:”hidden”,bg:”tertiary”,children:(0,l.Y)(E.o,{src:s,maxWidth:64,useRetinaSizing:!0,imageIsFixedWidth:!0,imageProps:{smartCrop:!0,aspect:”1:1″}})})]})})}function e5(e){let{text:t,isStatic:n}=e;return(0,l.Y)(J.pT,{paddingX:8,paddingY:4,children:(0,l.FD)(J.EY.B5,{color:”secondary”,weight:”semibold”,children:[(0,l.Y)(x.A,{strokeWidth:2,height:12,stroke:”#808080″,fill:”transparent”,isStatic:n}),” “,t]})})}function te(e){let t,{user:n,size:i,pubRole:a,userStatus:r,className:o,disabled:c,pubThemeAccentColor:s,pubThemePrintOnPopColor:d}=e,u=(0,U.BR)().isOnDestination;(0,ec.isAtLeastContributorRole)(null==a?void 0:a.role)?t=”author”:(null==a?void 0:a.is_founding)?t=”founding”:(null==a?void 0:a.membership_state)===”subscribed”&&(t=”paid”);let p=(0,l.Y)(K.tp,{user:n,size:i,className:o,disabled:c,linkProps:{target:”_blank”},noBase:u});return”author”!==t?(null==r?void 0:r.badge)?(0,l.Y)(G.Pk,{badge:r.badge,children:p}):p:(0,l.Y)(G.w4,{tier:t,fgOverride:d,bgOverride:s,children:p})}},26683:function(e,t,n){n.d(t,{LI:()=>x,Sd:()=>I,YD:()=>B,jx:()=>O});var i=n(69277),a=n(70408),r=n(4006),o=n(50172),l=n(17402),c=n(45994),s=n(32485),d=n.n(s),u=n(78649),p=n(7147),h=n(44518),m=n(46271),g=n(94729),y=n(12501),f=n(35369),b=n(17028),Y=n(97515),v=n(37598),_=n(57820),w=n(40837),k=n(75303),A=n(63136),C=n(56720),S=n(3898);let N=(0,o.createContext)({isLoading:!1,emojis:{suggestedReactionTypes:[],categories:[],reactionTypes:{}}});function I(e){let{children:t}=e,{user:n}=(0,m.ur)(),{result:i,isLoading:a}=(0,y.st)({pathname:”/api/v1/threads/reactions”,method:”GET”,cacheTtl:6e5,auto:!!n});return(0,r.Y)(N.Provider,{value:{emojis:i,isLoading:a},children:t})}function x(e){let{context:t,reactions:n,currentReaction:i,onReactionClick:a,isReadOnly:o,showCounts:l=!0,maxReactions:s,direction:p}=e,h=n&&Object.keys(n).some(e=>n[e]>0),m=(0,c.li)(null),[g,y]=(0,c.J0)(!1),{emojis:f,isLoading:Y}=(0,c.NT)(N),_=(0,c.Kr)(()=>n&&(null==f?void 0:f.reactionTypes)?Object.entries(n).sort((e,t)=>{let[n,i]=e,[a,r]=t;return i===r?n.localeCompare(a):r-i}).filter(e=>{let[t,n]=e;return n>0&&f.reactionTypes[t]}).slice(0,3):[],[n,f]);return(null==f?void 0:f.reactionTypes)?(0,r.Y)(u.Q,{children:(0,r.FD)(b.Ye,{onClick:U,className:d()(S.A.reactionsContainer,{[S.A.show]:h||g,[S.A.outgoing]:”outgoing”===p}),children:[_.map(e=>{let[n,o]=e,c=f.reactionTypes[n],s=n===i||c===i,u=(0,r.FD)(b.Ye,{className:d()(S.A.reaction,{[S.A.selected]:l&&s}),shadow:”sm”,bg:”primary”,gap:4,alignItems:”center”,justifyContent:”center”,paddingX:6,onClick:()=>c&&a&&a(n,c),children:[(0,r.Y)(A.EY.B4,{font:”emoji”,children:c}),l&&(0,r.Y)(A.EY.Meta,{fontWeight:”bold”,color:s?”white”:”primary”,children:o})]},n);return[“feed-recommended”,”direct-message”].includes(t.type)?u:(0,r.Y)(C.m_,{text:(0,r.Y)(F,{context:t,reaction:n}),side:”bottom”,children:u},n)}),!o&&(!s||!i)&&(0,r.Y)(v.A,{trigger:(0,r.Y)(D,{}),onOpen:()=>y(!0),onClose:()=>y(!1),children:e=>{let{close:t}=e;return(0,r.Y)(T,{emojis:f,isLoading:Y,currentReaction:i,onPick:(e,n)=>{a&&a(e,n),t()},inputRef:m})}})]})}):null}let D=(0,l.forwardRef)((e,t)=>(0,r.Y)(f.Nm,(0,a._)((0,i._)({ref:t,resetCss:!0,className:S.A.addReactButton,shadow:”sm”,bg:”primary”,paddingX:4,alignItems:”center”},e),{children:(0,r.Y)(p.A,{className:S.A.addReactIcon})})));function T(e){var t;let{emojis:i,isLoading:a,currentReaction:o,onPick:l,inputRef:s}=e,d=(0,c.Kr)(()=>(null==i?void 0:i.reactionTypes)&&!a?Object.keys(i.reactionTypes):[],[null==i?void 0:i.reactionTypes,a]),{result:p,isLoading:m}=(0,y.qK)(()=>n.e(“4022″).then(n.t.bind(n,70405,19)),[],{auto:!0}),g=(0,c.hb)(e=>[e,…(null==p?void 0:p[e])||[]],[p]),{filteredItems:f,setQuery:v,hasFiltered:k,query:A}=(0,h.S)({items:d,getKeys:g,deps:[d,g]});return(0,r.Y)(u.Q,{children:(0,r.FD)(b.I1,{sizing:”border-box”,gap:12,padding:12,minWidth:320,height:400,onClick:U,overflowY:”auto”,children:[(0,r.Y)(w.D,{ref:s,onChange:v}),a||m?(0,r.Y)(b.I1,{flex:”grow”,justifyContent:”center”,alignItems:”center”,children:(0,r.Y)(_.y$,{})}):(0,r.FD)(r.FK,{children:[k&&(f&&f.length>0?(0,r.Y)(E,{reactions:f,currentReaction:o,onPick:l,emojiMap:i.reactionTypes,title:null}):(0,r.Y)(Y.p,{title:”No results for “.concat(A),description:”Try another search”})),!k&&(0,r.FD)(r.FK,{children:[(0,r.Y)(E,{reactions:i.suggestedReactionTypes,currentReaction:o,onPick:l,emojiMap:i.reactionTypes,title:”Suggested”}),null==(t=i.categories)?void 0:t.map(e=>(0,r.Y)(E,{reactions:e.reactionTypes,currentReaction:o,onPick:l,emojiMap:i.reactionTypes,title:e.title},e.title))]})]})]})})}function F(e){var t;let{reaction:n,context:i}=e,a=[“posts”,”feed-subscribed”].includes(i.type)?”/api/v1/community/posts/”.concat(i.id,”/reactions”):”/api/v1/community/comments/”.concat(i.id,”/reactions”),{result:r,isLoading:o}=(0,y.st)({pathname:a,method:”GET”,auto:!0});if(o)return”Loading…”;let l=(null!=(t=null==r?void 0:r.reactions.filter(e=>e.reaction===n))?t:[]).map(e=>e.user.name),c=l.slice(0,6),s=Math.max(0,l.length-6),d=c.join(“, “);return s>0?””.concat(d,” + “).concat(s,” “).concat(1===s?”other”:”others”):d}function E(e){let{reactions:t,currentReaction:n,onPick:i,emojiMap:a,title:o}=e;return(0,r.FD)(b.I1,{gap:4,children:[o&&(0,r.Y)(A.EY.B4,{color:”secondary”,children:o}),(0,r.Y)(b.az,{className:S.A.emojiGrid,gap:2,alignItems:”center”,justifyContent:”center”,children:null==t?void 0:t.map(e=>(0,r.Y)(R,{onClick:()=>i(e,a[e]),className:d()(S.A.emojiBox,{[S.A.selected]:e===n}),children:(0,r.Y)(P,{children:a[e]})},e))})]})}let R=(0,k.I4)({bg:”primary”,alignItems:”center”,justifyContent:”center”,radius:”sm”,width:32,height:32,cursor:”pointer”},k.fI),P=(0,k.I4)({fontSize:20,lineHeight:20,color:”primary”,fontWeight:”medium”,font:”emoji”}),U=e=>{e.stopPropagation(),e.preventDefault()};async function B(e,t,n){try{return await (0,g.x6)(“/api/v1/community/”.concat(n,”/”).concat(t,”/reaction”),{method:”POST”,json:{reaction:e}})}catch(e){return e}}async function O(e,t,n){try{return await (0,g.x6)(“/api/v1/community/”.concat(n,”/”).concat(t,”/reaction”),{method:”DELETE”,query:{reaction:e}})}catch(e){return e}}},93038:function(e,t,n){n.d(t,{Ay:()=>g,Sq:()=>Y,_F:()=>f});var i=n(69277),a=n(70408),r=n(4006),o=n(32485),l=n.n(o),c=n(15734),s=n.n(c),d=n(27437),u=n(84777),p=n(95899),h=n(49807),m=n(3223);let g=e=>{let{id:t,type:n,name:i,url:a,photo_url:o,uuid:c,mentionText:s,isStatic:g=!1,isEditorContext:y=!1}=e;return g?(0,r.Y)(“span”,{className:l()(m.A.mention,m.A.mentionStatic),”data-component-name”:”MentionStatic”,children:(0,r.Y)(“a”,{href:(0,h.bzS)(n,t,i,a),children:i||”Substack user”})}):”user”===n?(0,r.Y)(p.HW,{children:(0,r.Y)(d.ProfileHoverCard,{subject:{id:t,name:i||”Substack user”,photo_url:o},utmSource:”mention”,trigger:(0,r.Y)(“a”,{className:m.A.mention,href:y?void 0:(0,h.bzS)(n,t,i,a),target:”_blank”,rel:”noopener”,”data-attrs”:JSON.stringify({name:i,id:t,type:n,url:a,photo_url:o,uuid:c}),onClick:e=>e.stopPropagation(),”data-component-name”:”MentionUser”,children:null!=s?s:i})})}):”pub”===n?(0,r.Y)(u.m,{pubId:t,utmSource:”mention”,trigger:(0,r.Y)(“a”,{className:m.A.mention,href:a,target:”_blank”,rel:”noopener”,”data-attrs”:JSON.stringify({name:i,id:t,type:n,url:y?void 0:(0,h.bzS)(n,t,i,a),uuid:c}),onClick:e=>e.stopPropagation(),”data-component-name”:”MentionPub”,children:null!=s?s:i})}):(0,r.Y)(“a”,{className:m.A.mention,target:”_blank”,rel:”noopener”,href:(0,h.bzS)(n,t,i,a),”data-attrs”:JSON.stringify({name:i,id:t,type:n,url:a,photo_url:o,uuid:c}),”data-component-name”:”Mention”,children:null!=s?s:i})},y={},f=async function(e){let{pathname:t=”/api/v1/posts/mention”}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(y[e])return y[e];let{profiles:n,publications:r}=(await s().get(t).query({query:e})).body,o=new Map;return n&&n.length&&o.set(“Writers”,n.map(e=>(0,a._)((0,i._)({},e),{type:”user”}))),r&&r.length&&o.set(“Publications”,null==r?void 0:r.map(e=>(0,a._)((0,i._)({},e),{type:”pub”,url:(0,h.Bte)({subdomain:e.subdomain}),photo_url:e.logo_url}))),y[e]=o,o},b={},Y=async function(e){let{pathname:t=”/api/v1/community/mention”}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=””.concat(t,”-“).concat(e);if(b[n])return b[n];let i=(await s().get(t).query({query:e})).body.results,a=new Map;return i&&a.set(“Writers”,i.map(e=>{var t,n,i;return{id:e.user_id,type:”user”,name:e.name,photo_url:null!=(t=e.photo_url)?t:void 0,bestseller_tier:null!=(n=e.bestseller_tier)?n:0,handle:null!=(i=e.handle)?i:void 0}})),b[n]=a,a}},34746:function(e,t,n){n.d(t,{pU:()=>E}),n(99851);var i=n(79785),a=n(4006),r=n(32485),o=n.n(r),l=n(17402),c=n(15734),s=n.n(c),d=n(47963),u=n(97432),p=n(81209),h=n(41873),m=n(84605),g=n(86500),y=n(68349),f=n(24078),b=n(35369),Y=n(76977);n(16993);var v=n(63136),_=n(11510),w=n(98111),k=n(56458),A=n(39318),C=n(41086),S=n(57324),N=n(73683);function I(){let e=(0,i._)([“Available now for iOS and Android”]);return I=function(){return e},e}function x(){let e=(0,i._)([“Upgrade to “,””]);return x=function(){return e},e}function D(){let e=(0,i._)([“Upgrade to “,””]);return D=function(){return e},e}function T(){let e=(0,i._)([“Already in the “,” plan?”]);return T=function(){return e},e}function F(){let e=(0,i._)([“Already in the Founding Member plan?”]);return F=function(){return e},e}let E=e=>{var t,n;let i,{className:r=null,title:c,subtitle:h=null,reauthenticationTitle:b,publication:w,post:N,user:x,freeSignup:D=null,freeSignupEmail:E=null,email_form:P=!1,autoFocus:U=!1,isStatic:O=!1,coupon:z=null,showPostUnlockPrompt:W=!1,magicToken:j=null,onPostUnlockError:H=null,isUnsubscribedPostUnlockUpsell:M,onOpenPostUnlockModal:K=null,hasCompletedUnsubscribedUnlock:G=!1}=e,V=null==x?void 0:x.reader_installed_at,{iString:J,iTemplate:q}=(0,m.GO)(),{modal:Q,open:X}=(0,d.El)({utm_campaign:S._9.paywallPostUnlockPrompt,utm_source:S.VU.substack,overrideCTA:V?J(“Open in app”):void 0,overrideTitle:J(V?”Unlock your free post in the Substack app”:”Get the free Substack app to unlock this post”),subTitle:q(I()),openUrl:null!=(t=V&&(0,A.XV8)(w.subdomain,N.slug))?t:void 0}),Z=x&&x.email||E||null,$=!!((null==x?void 0:x.is_subscribed)&&(null==x?void 0:x.is_magic)),ee=(null==N?void 0:N.audience)===”founding”,et=!!((null==x?void 0:x.is_free_subscribed)||D),en=(0,A.wu9)(w,N),ei=(0,_.Iu)(),ea=(0,l.useCallback)(async e=>{if(e||(0,g.u4)(g.qY.PAYWALL_UNLOCK_CTA_CLICKED,{post_id:N.id,publication_id:w.id,from_email:e,source:”paywall”}),M&&K)G&&ei?(0,y.V2)((0,A.XV8)(w.subdomain,N.slug,{redirect:”app-store”,params:{utm_campaign:S._9.paywallPostUnlockPrompt,utm_source:S.VU.paywall}})):K();else try{await s().post(“/api/v1/post_unlock_token”).send({post_id:N.id,token:j}),ei?(0,y.V2)((0,A.XV8)(w.subdomain,N.slug,{redirect:”app-store”,params:{utm_campaign:S._9.paywallPostUnlockPrompt,utm_source:S.VU.paywall}})):X()}catch(e){null==H||H()}},[N.id,N.slug,w.id,w.subdomain,j,V,X,H,ei,M,K,G]),er=(0,l.useCallback)(()=>ea(!0),[ea]),eo=(0,l.useCallback)(()=>ea(!1),[ea]);(0,l.useEffect)(()=>{W&&(0,g.u4)(g.qY.PAYWALL_UNLOCK_CTA_VIEWED,{publication_id:w.id,post_id:N.id})},[N.id,w.id,W]),(0,l.useEffect)(()=>{(0,C.y)(“launch_post_unlock_offer”)&&(er(),window.history.replaceState({},document.title,(0,A.oRR)({launch_post_unlock_offer:null})))},[er]);let el=!!z&&!!z.id&&!ee&&!W;return i=el?J((null==N?void 0:N.type)===”podcast”?”Listen to this episode with a 7-day free trial”:(null==N?void 0:N.type)===”video”?”Watch with a 7-day free trial”:”Keep reading with a 7-day free trial”):$?b:c,(0,a.FD)(“div”,{className:o()(“paywall”,r),”data-testid”:”paywall”,”data-component-name”:”Paywall”,role:”region”,”aria-label”:J(“Paywall”),children:[W&&(0,a.Y)(f.eu,{photoUrl:null!=(n=w.author_photo_url)?n:void 0,size:64,className:O?”paywall-unlock-avatar-static”:”paywall-unlock-avatar”}),Z&&!W&&(0,a.FD)(v.EY,{translated:!0,as:”div”,className:”paywall-intro”,paddingBottom:8*!!W,children:[“Hi “,(0,a.Y)(“b”,{children:I18N.p(Z)})]}),(0,a.Y)(“h2”,{className:o()(“paywall-title”,W&&”unlock-treatment-new”),children:i}),h&&!el&&(0,a.Y)(“p”,{className:”paywall-subtitle”,children:h}),el&&(0,a.FD)(“div”,{className:”paywall-free-trial-subtitle”,children:[(null==N?void 0:N.type)===”podcast”&&(0,a.FD)(v.EY,{translated:!0,as:”p”,className:”paywall-subtitle”,children:[“Subscribe to”,” “,(0,a.Y)(v.EY,{as:”span”,weight:”bold”,fontStyle:”italic”,children:I18N.p(w.name)}),” “,”to listen to this post and get 7 days of free access to the full post archives.”]}),(null==N?void 0:N.type)===”video”&&(0,a.FD)(v.EY,{translated:!0,as:”p”,className:”paywall-subtitle”,children:[“Subscribe to”,” “,(0,a.Y)(v.EY,{as:”span”,weight:”bold”,fontStyle:”italic”,children:I18N.p(w.name)}),” “,”to watch this video and get 7 days of free access to the full post archives.”]}),(null==N?void 0:N.type)===”newsletter”&&(0,a.FD)(v.EY,{translated:!0,as:”p”,className:”paywall-subtitle”,children:[“Subscribe to”,” “,(0,a.Y)(v.EY,{as:”span”,weight:”bold”,fontStyle:”italic”,children:I18N.p(w.name)}),” “,”to keep reading this post and get 7 days of free access to the full post archives.”]}),(null==N?void 0:N.type)===”adhoc_email”&&(0,a.FD)(v.EY,{translated:!0,as:”p”,className:”paywall-subtitle”,children:[“Subscribe to”,” “,(0,a.Y)(v.EY,{weight:”bold”,fontStyle:”italic”,children:I18N.p(w.name)}),” “,”to keep reading this email and get 7 days of free access to the full post archives.”]})]}),P?!et&&(0,a.Y)(Y.Ye,{paddingTop:24,justifyContent:”center”,children:(0,a.Y)(u.A,{autoFocus:null==U||U,email:Z,freeSignup:D,freeSignupEmail:E,onAccentBackground:!0,pub:w,source:”post-unlock”,submitButtonText:J((null==N?void 0:N.type)===”podcast”?”Start listening”:(null==N?void 0:N.type)===”video”?”Start watching”:”Start reading”),user:x,onSuccess:()=>document.location.reload()})}):W?(0,a.FD)(a.FK,{children:[Q,(0,a.Y)(L,{isStatic:O,onClick:eo,btnClassName:o()(W&&”paywall-cta-icon”),isUnsubscribedPostUnlockUpsell:M,children:J(M&&G?”Open the app”:”Claim my free post”)})]}):(0,a.Y)(R,{coupon:z,email:Z,isStatic:O,post:N,postUrl:en,publication:w,useCoupon:el,user:x}),W&&(0,a.Y)(B,{isStatic:O,publication:w,post:N,postUrl:en,coupon:z,useCoupon:el,children:M?(0,a.Y)(a.FK,{children:J(“Or purchase a paid subscription.”)}):(0,a.FD)(a.FK,{children:[J(“Or upgrade your subscription.”),” “,(0,a.Y)(“b”,{children:(0,a.Y)(p.n,{pub:w,user:x,isStatic:!0})})]})}),!$&&!O&&!W&&(0,a.Y)(“div”,{className:”paywall-login”,children:(0,a.FD)(“a”,{href:(0,A.a7q)({for_pub:w.subdomain,change_user:!!Z}),native:!0,children:[function(){let{post:e,publication:t,isPaid:n=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{iString:i,iTemplate:a}=I18N.i(t?{pub:t}:”en”);if(!n)return i(“Already a subscriber?”);if((null==e?void 0:e.audience)===”founding”){var r;return(0,k.m4)(t)?a(T(),null!=(r=(0,k.m4)(t))?r:””):a(F())}return i(“Already a paid subscriber?”)}({post:N,publication:w,isPaid:!P}),” “,(0,a.Y)(“b”,{children:J(Z?”Switch accounts”:”Sign in”)})]})})]})},R=e=>{var t,n;let{coupon:i,email:r,isStatic:o,post:l,postUrl:c,publication:s,useCoupon:d,user:u}=e,h=!!(null==u?void 0:u.is_founding),g=!!(null==u?void 0:u.is_subscribed),y=!!((null==u?void 0:u.is_subscribed)&&(null==u?void 0:u.is_magic)),f=(null==l?void 0:l.audience)===”founding”,{iString:b,iTemplate:Y}=(0,m.GO)();if(o){if(!s.plans)return null;let e=f?w.T.FOUNDING_CHECKOUT_URL:w.T.CHECKOUT_URL,n=d?”&coupon=”.concat(null==i?void 0:i.id):””,r=f?Y(x(),null!=(t=(0,k.m4)(s))?t:””):d?b(“Start trial”):(0,a.Y)(p.n,{pub:s,user:u,isStatic:o});return(0,a.Y)(P,{href:””.concat(e,”simple=true&utm_source=”).concat(S.VU.paywall,”&utm_medium=”).concat(S.Jn.email,”&utm_content=”).concat(l.id,”&next=”).concat(c).concat(n),children:r})}return!h&&f?s.plans?(0,a.Y)(U,{href:(0,A.my9)(s,{simple:!0,next:document.location.href,utm_source:S.VU.paywall,utm_medium:S.Jn.web,utm_content:l?l.id:null,plan:”founding”}),children:Y(D(),null!=(n=(0,k.m4)(s))?n:””)}):null:g?y?(0,a.Y)(U,{href:(0,A.a7q)({for_pub:s.subdomain,email:r}),children:b(“Click here to sign in”)}):null:s.plans?(0,a.Y)(U,{href:(0,A.my9)(s,{simple:!0,next:document.location.href,utm_source:d?S.VU.paywallFreeTrial:S.VU.paywall,utm_medium:o?S.VU.email:S.VU.web,utm_content:l?l.id:null,coupon:d?null==i?void 0:i.id:null}),children:d?b(“Start trial”):(0,a.Y)(p.n,{pub:s,user:u,isStatic:o})}):null},P=e=>{let{children:t,href:n}=e;return(0,a.Y)(“div”,{className:”paywall-cta”,children:(0,a.Y)(“a”,{className:”button primary subscribe-btn”,href:n,children:(0,a.Y)(“span”,{children:t})})})},U=e=>{let{children:t,href:n}=e;return(0,a.Y)(“div”,{className:”paywall-cta”,children:(0,a.Y)(“a”,{href:n,native:!0,children:(0,a.Y)(b.Nm,{resetCss:!0,className:o()(“subscribe-btn”,N.A.subscribeButton),children:t})})})},B=e=>{let{post:t,isStatic:n,publication:i,onClick:r,children:o,postUrl:l,coupon:c,useCoupon:s}=e,d=(0,A.my9)(i,{simple:!0,next:document.location.href,utm_source:S.VU.paywall,utm_medium:n?S.Jn.email:S.Jn.web,utm_content:t?t.id:null,just_signed_up:!1});r=async()=>{(0,y.V2)(d)};let u=s?”&coupon=”.concat(null==c?void 0:c.id):””,p=””.concat(d,”simple=true&utm_source=”).concat(S.VU.paywall,”&utm_medium=”).concat(S.Jn.email,”&utm_content=”).concat(t.id,”&next=”).concat(l).concat(u);return n?(0,a.Y)(O,{href:p,children:o}):(0,a.Y)(z,{onClick:r,href:p,children:o})},O=e=>{let{children:t,href:n}=e;return(0,a.Y)(“div”,{className:”paywall-secondary-cta”,children:(0,a.Y)(“a”,{href:n,children:t})})},z=e=>{let{children:t,href:n,onClick:i}=e;return(0,a.Y)(“div”,{className:”paywall-secondary-cta”,children:(0,a.Y)(“a”,{onClick:i,href:n,native:!0,children:t})})},L=e=>{let{isStatic:t,onClick:n,children:i,btnClassName:r,disabled:l,isUnsubscribedPostUnlockUpsell:c}=e;return t?(0,a.Y)(“div”,{className:”paywall-cta”,children:(0,a.Y)(“a”,{className:o()(“button”,”primary”,r),href:””.concat(w.T.POST_URL).concat(c?”&launch_post_unlock_offer=true&bypass_subscription_check=true”:”&launch_post_unlock_offer=true”),children:i})}):(0,a.Y)(“div”,{className:”paywall-cta”,children:(0,a.Y)(“a”,{onClick:n,native:!0,children:(0,a.Y)(b.Nm,{resetCss:!0,className:o()(“subscribe-btn”,N.A.subscribeButton,r),disabled:l,children:i})})})};h.A},5109:function(e,t,n){n.d(t,{dx:()=>P});var i=n(99851),a=n(79785),r=n(4006),o=n(32485),l=n.n(o),c=n(69843),s=n.n(c),d=n(17402),u=n(45516),p=n(34206),h=n(52820),m=n(84605),g=n(86500),y=n(94729),f=n(89490),b=n(35369),Y=n(33727),v=n(60322),_=n(76977),w=n(20500),k=n(76171);n(16993);var A=n(81203),C=n(94996),S=n(63136),N=n(11587),I=n(65842),x=n(61554),D=n(96400);n(39318);var T=n(46058),F=n(16722);function E(){let e=(0,a._)([“”,” on Substack”]);return E=function(){return e},e}class R extends d.Component{componentDidMount(){if(this.props.autoSubmit){var e,t,n;this.isComplete()?null==(e=this.formRef.current)||e.handleSubmit():null==(t=(n=this.props).onAutoSubmitFailed)||t.call(n)}}isComplete(){let{user:e,needsPhoto:t}=this.props;return e&&!e.is_magic&&e.name&&(!t||e.photo_url)}onError(e){var t,n,i;this.props.autoSubmit&&!this.state.autoSubmitFailed&&(this.setState({autoSubmitFailed:!0}),null==(n=(i=this.props).onAutoSubmitFailed)||n.call(i)),this.setState({sentLoginEmail:!1}),(null==(t=e.response)?void 0:t.status)===401&&this.sendLoginEmail()}async createDefaultPublication(e,t){let{iTemplate:n}=this.props;try{let i=await (0,y.x6)(“/api/v1/publication/suggestion”),a=t||n(E(),e);await (0,y.x6)(“/api/v1/publication”,{method:”post”,json:{name:e,subdomain:i.subdomain,hero_text:a,tos:!0}})}catch(e){(0,g.u4)(g.qY.DEFAULT_PUBLICATION_CREATION_FAILED),console.warn(“couldn’t set up a default publication”,e)}}async sendLoginEmail(){let e=this.state.newEmail||this.props.freeSignupEmail;if(!this.state.loading&&e){this.setState({loading:!0});try{await (0,y.x6)(“/api/v1/email-login”,{method:”post”,json:{email:e,redirect:document.location.href}}),this.setState({sentLoginEmail:!0})}catch(e){console.error(“Failed send login email:”,e)}this.setState({loading:!1})}}render(){var e;let{className:t,user:n,numVisibleSubscriptions:i,numSubscriptions:a,freeSignup:o,freeSignupEmail:c,needsPhoto:d,optionalPhoto:h,showHandle:m=!0,token:g,text:y,onSuccess:E,prepareData:R,pageTitle:P,primaryEligiblePublications:U,isPostInvite:B,complete:O,profileExists:z,onSkip:L,onEditReadVisibility:W,barebones:j,onEditRecommendations:H,numRecommendationsToMake:M,noSubscribeCta:K,style:G,iString:V,iPlural:J,showSocialHandle:q,pub:Q}=this.props,{newPhotoUrl:X,newName:Z,newHandle:$,newEmail:ee,loading:et,sentLoginEmail:en,sentAccountConfirmationEmail:ei,newBio:ea,createPublication:er,selectedSocial:eo,selectedSocialHandle:el,tosAccepted:ec,subscribeToNewsletter:es}=null!=(e=this.state)?e:{},ed=X||(0,T.w3)(n,{}),eu=”string”==typeof P||null===P?P:V(this.isComplete()?”Update your profile”:”Create your profile”),ep=Z||n&&n.name||””,eh=$||(null==n?void 0:n.handle)||””,em=”string”==typeof ea?ea:n&&n.bio||””,eg=(!n||n.is_magic)&&!c&&!B,ey=!z&&!!H&&!s()(M)&&M>0,ef=B&&U&&(null==n?void 0:n.has_publication)&&U.length>1,eb=”number”==typeof i&&!s()(a)&&a>0&&W,eY=!K&&!(n&&(n.is_subscribed||n.is_free_subscribed)||o),ev=B&&!(null==n?void 0:n.has_publication),e_=async(e,t)=>{e.body.emailConfirmationRequired?this.setState({sentAccountConfirmationEmail:!0}):(er&&await this.createDefaultPublication(ep,em),E(e,t))};return(0,r.FD)(“div”,{className:l()(“profile-updater”,t),style:G,children:[eu&&(0,r.Y)(S.EY.H4,{align:”left”,paddingBottom:20,children:eu}),(ed||d||h)&&(0,r.Y)(_.fI,{flex:”grow”,justifyContent:”center”,alignItems:”center”,children:(0,r.Y)(u.U,{user:{photo_url:X||(null==n?void 0:n.photo_url)||null},onChangePhoto:e=>{let{photo_url:t}=e;return this.setState({newPhotoUrl:t})}})}),(0,r.FD)(p.Ay,{ref:this.formRef,method:”put”,action:”/api/v1/user/profile”,prepareData:R,onSuccess:e_,onError:e=>this.onError(e),noInlineErrors:!0,loading:et,autoLock:!0,children:[(0,r.FD)(_.VP,{gap:20,children:[(0,r.FD)(I.A0,{children:[(0,r.Y)(k.sb,{htmlFor:”name”,children:V(“Name”)}),Q?(0,r.Y)(“input”,{type:”hidden”,name:”pub_id”,value:Q.id}):null,(0,r.Y)(I.ks,{autoFocus:!0,type:”text”,className:”profile-name”,placeholder:V(“Type your name…”),name:”name”,id:”name”,value:ep,onInput:e=>{this.setState({newName:e.currentTarget.value})}})]}),eg&&(0,r.FD)(I.A0,{children:[(0,r.Y)(k.sb,{htmlFor:”email”,children:V(“Email”)}),(0,r.Y)(I.ks,{type:”email”,placeholder:V(“Enter your email address…”),name:”email”,value:null!=ee?ee:void 0,onInput:e=>{this.setState({newEmail:e.currentTarget.value})}})]}),m&&(0,r.FD)(I.A0,{children:[(0,r.Y)(k.JU,{htmlFor:”handle”,children:V(“Handle”)}),(0,r.Y)(I.ks,{type:”text”,className:”profile-name”,placeholder:V(“Type your handle…”),name:”handle”,id:”handle”,value:eh,onInput:e=>{this.setState({newHandle:e.currentTarget.value})}})]}),!j&&(0,r.FD)(I.A0,{children:[(0,r.Y)(k.JU,{htmlFor:”bio”,children:V(“Bio”)}),(0,r.Y)(N.T,{placeholder:V(“Say something about yourself…”),name:”bio”,id:”bio”,value:em,onInput:e=>{this.setState({newBio:e.currentTarget.value})}}),B&&(0,r.Y)(w.EE,{align:”left”,children:V(“Tip: this will be shown at the bottom of your guest post”)})]}),B&&(0,r.Y)(“input”,{type:”hidden”,name:”needs_bio”,value:”true”}),q&&(0,r.FD)(I.A0,{children:[(0,r.Y)(k.Sy,{htmlFor:”social”,hint:V(“Optional”),children:V(“Where else can you be found?”)}),(0,r.FD)(_.fI,{gap:8,wrap:”wrap”,children:[(0,r.Y)(_.fI,{flex:”grow”,minWidth:200,children:(0,r.FD)(C.I,{flex:”grow”,name:”social”,value:eo,onChange:e=>{this.setState({selectedSocial:e.currentTarget.value})},children:[(0,r.Y)(C.K,{children:V(“Select a social network”)}),(0,r.Y)(“option”,{value:”twitter”,children:V(“Twitter”)}),(0,r.Y)(“option”,{value:”instagram”,children:V(“Instagram”)}),(0,r.Y)(“option”,{value:”tiktok”,children:V(“Tiktok”)}),(0,r.Y)(“option”,{value:”linkedin”,children:V(“LinkedIn”)}),(0,r.Y)(“option”,{value:”youtube”,children:V(“Youtube”)})]})}),(0,r.Y)(_.fI,{flex:”grow”,minWidth:200,children:(0,r.Y)(I.ks,{flex:”grow”,type:”text”,placeholder:V(“@yourhandle”),name:”socialHandle”,value:el,onInput:e=>{this.setState({selectedSocialHandle:e.currentTarget.value})}})})]})]}),ef&&(0,r.FD)(I.A0,{children:[(0,r.Y)(k.JU,{children:V(“Publication to display”)}),(0,r.Y)(Y.Z,{padding:12,gap:12,children:U.map((e,t)=>{var n,i;return(0,r.Y)(k.JU,{htmlFor:”primary-radio-“.concat(e.id),children:(0,r.FD)(_.fI,{gap:12,alignItems:”center”,children:[(0,r.Y)(“input”,{id:”primary-radio-“.concat(e.id),type:”radio”,name:”primary_publication_user_id”,value:e.id,checked:0===t}),(0,r.Y)(A.Nq,{pub:e.publication,size:24}),(0,r.Y)(S.EY.B3,{as:”span”,children:null!=(i=null==(n=e.publication)?void 0:n.name)?i:””})]})})})})]}),eY&&(0,r.FD)(_.Ye,{as:”label”,className:F.A.checkbox,gap:8,children:[(0,r.Y)(v.S,{size:”sm”,name:”free_signup”,defaultChecked:!0,checked:es,onChange:e=>this.setState({subscribeToNewsletter:e})}),(0,r.Y)(S.EY.B3,{as:”span”,children:V(“Subscribe to the newsletter”)})]}),ev&&(0,r.FD)(_.Ye,{as:”label”,className:F.A.checkbox,gap:8,children:[(0,r.Y)(v.S,{name:”create_publication”,id:”create-publication-checkbox”,checked:er,onChange:e=>{this.setState({createPublication:e})}}),(0,r.Y)(S.EY.B3,{as:”span”,children:V(“Create a Substack publication for me”)})]}),(0,r.Y)(“input”,{type:”hidden”,name:”confirmation_redirect_pathname”,value:document.location.pathname}),(0,r.Y)(“input”,{type:”hidden”,name:”photo_url”,value:null!=ed?ed:void 0}),(0,r.Y)(“input”,{type:”hidden”,name:”user_id”,value:(null==n?void 0:n.id)||””}),(0,r.Y)(“input”,{type:”hidden”,name:”needs_photo”,value:!!d}),(0,r.Y)(“input”,{type:”hidden”,name:”token”,value:g}),O&&(0,r.Y)(“input”,{type:”hidden”,name:”complete”,value:!0}),(0,r.FD)(“div”,{id:”error-container”,children:[en&&(0,r.FD)(S.EY,{as:”div”,translated:!0,className:”error other-error”,children:[“If you have an account with us, we’ve sent an email to “,(0,r.Y)(“b”,{children:D.TH.p(null!=ee?ee:””)}),” with a link that you can use to sign in.”]}),ei&&(0,r.Y)(“div”,{className:”error other-error”,children:V(“We have sent you a confirmation email. Please check your inbox before continuing.”)})]}),eb&&(0,r.FD)(S.EY.B3,{as:”span”,children:[(0,r.Y)(S.Yq,{cursor:”pointer”,decoration:”underline”,onClick:W,children:J(“1 subscription”,”%1 subscriptions”,i)}),” “,V(“will be displayed on your profile.”)]}),ey&&(0,r.FD)(S.EY.B3,{as:”span”,children:[(0,r.Y)(S.Yq,{cursor:”pointer”,decoration:”underline”,onClick:H,children:J(“1 recommendation”,”%1 recommendations”,M)}),” “,V(“will be made on your publication.”)]})]}),(0,r.FD)(_.VP,{gap:8,children:[!n&&(0,r.Y)(f.az,{className:F.A.tosCheckboxContainer,paddingTop:20,paddingBottom:12,children:(0,r.Y)(x.U,{checked:ec,onCheckboxChange:e=>this.setState({tosAccepted:e}),style:{display:”flex”}})}),(0,r.Y)(b.$n,{priority:”primary”,disabled:!n&&!ec,type:”submit”,size:”lg”,children:y||V(“Save”)}),L&&(0,r.Y)(b.$n,{priority:”secondary”,onClick:L||(()=>{}),children:V(“Skip”)})]})]})]})}constructor(e,t){var n;super(e,t),(0,i._)(this,”formRef”,void 0),this.formRef=(0,d.createRef)();const a=!!e.isPostInvite||!!e.profileExists;this.state={newName:null,newHandle:null,newBio:null,newEmail:e.user&&e.user.is_magic?e.user.email:null,selectedSocial:”instagram”,createPublication:!!e.isPostInvite&&!(null==(n=e.user)?void 0:n.has_publication),tosAccepted:a,subscribeToNewsletter:!0}}}let P=(0,h.WR)((0,m.wr)(R))},30855:function(e,t,n){n.d(t,{N:()=>b});var i=n(4006),a=n(46110),r=n(17402),o=n(10996);let l=e=>{let{children:t,disable:n}=e;return n?(0,i.Y)(i.FK,{children:t}):(0,i.Y)(o.NP,{theme:”light-theme”,children:t})};var c=n(84605),s=n(27749),d=n(2675),u=n(75840),p=n(35369),h=n(76977),m=n(16993),g=n(63136),y=n(504),f=n(44307);function b(e){let{item:t,pub:n,post:o}=e,[l,s]=(0,r.useState)(!1),{iString:d}=(0,c.GO)();return(0,i.FD)(i.FK,{children:[(0,i.Y)(p.K0,{priority:”quaternary”,size:”sm”,className:f.A.moreButton,onClick:()=>s(!0),children:(0,i.Y)(a.A,{size:16})}),(0,i.FD)(m.aF,{isOpen:l,onClose:()=>s(!1),width:440,children:[(0,i.Y)(m.rQ,{icon:(0,i.Y)(a.A,{size:20}),title:d(“Auto-generated clip”),showClose:!0,onClose:()=>s(!1)}),(0,i.Y)(m.cw,{children:(0,i.Y)(h.I1,{gap:16,children:(0,i.Y)(g.EY.B3,{children:d(“Substack automatically selected this clip for you from the full video below.”)})})}),(0,i.Y)(m.jl,{primaryButton:(0,i.Y)(Y,{item:t,pub:n,post:o,onClose:()=>s(!1)}),secondaryButton:(0,i.Y)(p.$n,{priority:”secondary”,onClick:()=>s(!1),children:d(“Done”)})})]})]})}let Y=e=>{let{item:t,pub:n,post:a,onClose:o}=e,{iString:h}=(0,c.GO)(),m=(0,d.vZ)({post:a,publication:n}),g=(0,s.PK)(),f=(0,r.useContext)(u.P);return(0,i.Y)(l,{children:(0,i.Y)(p.$n,{priority:”primary”,onClick:e=>{(0,y.Qb)(t,g,”watch_full_episode”,{tabId:f}),m(e),o()},children:h(“View Full Episode”)})})}},25859:function(e,t,n){n.d(t,{NY:()=>b,Yq:()=>v,yp:()=>Y});var i=n(69277),a=n(70408),r=n(32641),o=n(4006),l=n(32485),c=n.n(l);n(17402);var s=n(27437);n(84777);var d=n(84605),u=n(46271),p=n(99662),h=n(63136),m=n(83629),g=n(83357);n(39318);var y=n(28700),f=n(4438);function b(e){var{user:t,utm_source:n,utm_content:l,ellipsis:c,useYou:s,onClick:p}=e,h=(0,r._)(e,[“user”,”utm_source”,”utm_content”,”ellipsis”,”useYou”,”onClick”]);let{iString:m}=(0,d.GO)(),g=(0,u.Jd)(),y=(null==t?void 0:t.id)||(null==t?void 0:t.user_id)||0,f=s&&(null==g?void 0:g.id)===y?m(“You”):”name”in t?t.name:m(“User”);return(0,o.Y)(Y,(0,a._)((0,i._)({user:t,utm_source:n,utm_content:l,ellipsis:c,onClick:p},h),{children:f}))}function Y(e){var{user:t,utm_source:n,utm_content:l,children:c,onClick:d,ellipsis:u}=e,h=(0,r._)(e,[“user”,”utm_source”,”utm_content”,”children”,”onClick”,”ellipsis”]);let g=(0,a._)((0,i._)({},t),{id:t.author_id||t.user_id||t.id,name:t.user_profile_name||t.author_name||t.name,handle:(null==t?void 0:t.handle)||(null==t?void 0:t.author_handle)});return(0,o.Y)(s.ProfileHoverCard,{subject:g,utmSource:”feed”,trigger:(0,o.Y)(v,(0,a._)((0,i._)({href:(0,y.gY)(t,{noBase:m.Z,utm_content:l,utm_source:n}),onClick:d,showBack:!0,ellipsis:u,className:h.className,target:(0,p.y)()?”_blank”:void 0},h),{children:c}))})}function v(e){var{weight:t,color:n,decoration:l=”hover-underline”,ellipsis:s,native:d,className:u}=e,p=(0,r._)(e,[“weight”,”color”,”decoration”,”ellipsis”,”native”,”className”]);let m=p.href,y=null==m?void 0:m.match(/^([a-z]+:)?\/\//),b=null!=d?d:y&&!(null==m?void 0:m.startsWith(document.location.origin));return(0,o.Y)(h.EY,{as:”span”,ellipsis:s,weight:t,color:n,decoration:l,children:b?(0,o.Y)(“a”,(0,a._)((0,i._)({},p),{className:c()(u,f.A.link)})):(0,o.Y)(g.N,(0,a._)((0,i._)({},p),{className:c()(u,f.A.link)}))})}},94729:function(e,t,n){n.d(t,{Qd:()=>s,fR:()=>d,fk:()=>c,x6:()=>l});var i=n(99851),a=n(69277),r=n(32641),o=n(68349);async function l(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=(0,a._)({cache:”no-cache”},n),{query:o,json:l}=i,s=(0,r._)(i,[“query”,”json”]),d=e;if(o){let t=(o instanceof URLSearchParams?o:new URLSearchParams(Object.entries(o).reduce((e,t)=>{let[n,i]=t;return void 0!==i&&(Array.isArray(i)?i.forEach(t=>{void 0!==t&&e.push([“”.concat(n,”[]”),t])}):e.push([n,i])),e},[]))).toString();t&&(-1!==e.indexOf(“?”)?d+=”&”.concat(t):d+=”?”.concat(t))}l&&(s.body=JSON.stringify(l),s.headers instanceof Headers||(s.headers=new Headers(s.headers)),s.headers.set(“Content-Type”,”application/json”)),s.method&&(s.method=s.method.toUpperCase());let u=await fetch(d,s);if(!u.ok){let e;try{e=await u.json()}catch(t){e={}}throw new c(u,e)}return(null==(t=u.headers.get(“Content-Type”))?void 0:t.startsWith(“application/json”))?u.json():u.text()}class c extends Error{getMessage(e){return(0,o.LJ)(this.body,e)}constructor(e,t){const n=URL.parse?URL.parse(e.url):null;super(“”.concat(e.status,”: “).concat(e.statusText)),(0,i._)(this,”response”,void 0),(0,i._)(this,”body”,void 0),(0,i._)(this,”url”,void 0),this.response=e,this.body=t,this.name=”FetchError”,this.url=n}}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:”Something went wrong.”;return e instanceof c?e.getMessage():t}function d(e){var t;return e instanceof c?null==(t=e.body)?void 0:t.type:null}},67335:function(e,t,n){n.d(t,{A:()=>l});var i=n(17402),a=n(15734),r=n.n(a),o=n(39318);let l=function(e,t){let{dataKey:n=”rows”,totalKey:a=”total”,loadingDelay:l=150}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},[c,s]=(0,i.useState)([]),[d,u]=(0,i.useState)(!0),[p,h]=(0,i.useState)(!1),[m,g]=(0,i.useState)(0),y=(0,o.oRR)(e,t),f=async function(){let{reset:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=setTimeout(()=>{u(!0)},l);h(!1);try{let i=await r().get(y);return s([…e?[]:c,…i.body[n]]),g(i.body[a]),clearTimeout(t)}catch(e){return console.error(e),h(!0),clearTimeout(t)}finally{u(!1)}};return(0,i.useEffect)(()=>{f({reset:0===t.offset})},[e,t.offset,t.order_by,t.order_direction]),{rows:c,total:m,loading:d,error:p}}},80180:function(e,t,n){n.d(t,{A:()=>l});var i=n(69277),a=n(70408),r=n(68349),o=n(9036);let l=function(e){let{fireAnalyticsOnUrlChange:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((n,l)=>(0,a._)((0,i._)({},n),{[l]:n=>{let c=(0,o.m)(document.location.search),s=(0,i._)((0,a._)((0,i._)({},c),{[l]:n}),!t&&{_no_an:”true”}),d=Object.keys(s).map(t=>{let n=e[t]||(e=>e),i=t===l?n(s[t]):s[t];return null==i?void 0:””.concat(t,”=”).concat(encodeURI(i))}).filter(e=>e).join(“&”);(0,r.dJ)(“”.concat(document.location.pathname,”?”).concat(d))}}),{})}},95641:function(e,t,n){n.d(t,{E:()=>c});var i=n(69277),a=n(32641),r=n(15734),o=n.n(r),l=n(12501);function c(e){var{auto:t,initialResult:n,deps:r}=e,c=(0,a._)(e,[“auto”,”initialResult”,”deps”]);return(0,l.qK)(async e=>{var{signal:t}=e,n=(0,a._)(e,[“signal”]);let{pathname:r=””,query:l,body:s,method:d=”get”}=(0,i._)({},c,n),u=o()(d.toUpperCase(),r);l&&u.query(l),s&&u.send(s),t.addEventListener(“abort”,()=>{u.abort()});let p=await u;if(t.aborted)return;let h=p.error;if(h)throw h;return p.body},r||[],{auto:t,initialResult:n})}},57820:function(e,t,n){n.d(t,{Oy:()=>f,hZ:()=>_,t4:()=>Y,y$:()=>g});var i=n(69277),a=n(70408),r=n(32641),o=n(4006),l=n(41439),c=n(32485),s=n.n(c);n(17402);var d=n(84605),u=n(89490),p=n(76977),h=n(3483);let m={14:2,20:2.5,24:2,32:1.5,40:1.25};function g(e){var{size:t=24,theme:n=”default”,dataTestId:c,className:u}=e,m=(0,r._)(e,[“size”,”theme”,”dataTestId”,”className”]);let{iString:g}=(0,d.GO)();return(0,o.Y)(l.bL,{value:null,”data-testid”:c,”aria-label”:g(“Loading”),asChild:!0,children:(0,o.Y)(p.ov,(0,a._)((0,i._)({padding:16,className:s()(h.A.spinner,h.A[“theme_”.concat(n)],u)},m),{children:(0,o.Y)(y,{size:t})}))})}function y(e){var t;let{size:n}=e,i=null!=(t=m[n])?t:2;return(0,o.Y)(l.C1,{asChild:!0,children:(0,o.FD)(“svg”,{width:n,height:n,viewBox:”0 0 24 24″,vectorEffect:”non-scaling-stroke”,children:[(0,o.Y)(“circle”,{className:h.A.bg,cx:12,cy:12,r:11,strokeWidth:i,fill:”none”,stroke:”var(–color-utility-detail)”}),(0,o.Y)(“circle”,{className:h.A.fg,cx:12,cy:12,r:11,strokeWidth:i,fill:”none”})]})})}function f(e){var{size:t=24,theme:n=”default”,dataTestId:c}=e,u=(0,r._)(e,[“size”,”theme”,”dataTestId”]);let{iString:m}=(0,d.GO)();return(0,o.Y)(l.bL,{value:null,”data-testid”:c,”aria-label”:m(“Thinking”),asChild:!0,children:(0,o.Y)(p.ov,(0,a._)((0,i._)({padding:16,className:s()(h.A.thinker,h.A[“theme_”.concat(n)])},u),{children:(0,o.Y)(b,{size:t})}))})}function b(e){let{size:t}=e,n=Array.from({length:10},(e,t)=>””.concat(36*t,” 12 12″)).join(“;”);return(0,o.Y)(l.C1,{asChild:!0,children:(0,o.Y)(“svg”,{width:t,height:t,viewBox:”0 0 24 24″,children:(0,o.FD)(“g”,{children:[Array.from({length:10}).map((e,t)=>(0,o.Y)(“rect”,{x:”11″,y:”1″,width:2,height:6,rx:”1″,ry:”1″,opacity:(t+1)/10,transform:”rotate(“.concat(36*t,” 12 12)”)},t)),(0,o.Y)(“animateTransform”,{attributeName:”transform”,type:”rotate”,calcMode:”discrete”,dur:”0.5s”,values:n,repeatCount:”indefinite”})]})})})}function Y(e){var{size:t=24,theme:n=”default”,percent:c,dataTestId:u}=e,m=(0,r._)(e,[“size”,”theme”,”percent”,”dataTestId”]);let{iString:g}=(0,d.GO)(),y=Math.round(100*c);return(0,o.Y)(l.bL,{value:y,max:100,”data-testid”:u,”aria-label”:g(“Loading”),asChild:!0,children:(0,o.Y)(p.ov,(0,a._)((0,i._)({padding:16,className:s()(h.A.radialProgress,h.A[“theme_”.concat(n)]),style:{“–percent”:””.concat(c)}},m),{children:(0,o.Y)(v,{size:t})}))})}function v(e){var t;let{size:n}=e,i=null!=(t=m[n])?t:2;return(0,o.Y)(l.C1,{asChild:!0,children:(0,o.FD)(“svg”,{width:n,height:n,viewBox:”0 0 24 24″,vectorEffect:”non-scaling-stroke”,children:[(0,o.Y)(“circle”,{className:h.A.bg,cx:12,cy:12,r:11,strokeWidth:i,fill:”none”,stroke:”var(–color-utility-detail)”}),(0,o.Y)(“circle”,{className:h.A.fg,cx:12,cy:12,r:11,strokeWidth:i,fill:”none”})]})})}function _(e){var{height:t=4,theme:n=”default”,percent:c,flex:u=”auto”,dataTestId:m}=e,g=(0,r._)(e,[“height”,”theme”,”percent”,”flex”,”dataTestId”]);let{iString:y}=(0,d.GO)(),f=Math.round(100*c);return(0,o.Y)(l.bL,{value:f,max:100,”data-testid”:m,”aria-label”:y(“Loading”),asChild:!0,children:(0,o.Y)(p.fI,(0,a._)((0,i._)({radius:”full”,overflow:”hidden”,position:”relative”,className:s()(h.A.linearProgress,h.A[“theme_”.concat(n)]),height:t,flex:u,style:{“–percent”:””.concat(c)}},g),{children:(0,o.Y)(w,{})}))})}function w(){return(0,o.Y)(l.C1,{asChild:!0,children:(0,o.Y)(u.az,{position:”absolute”,radius:”full”,className:h.A.linearProgressFill})})}},63136:function(e,t,n){n.d(t,{EY:()=>m,KQ:()=>g,Yq:()=>x,k5:()=>y,nS:()=>k});var i=n(69277),a=n(70408),r=n(32641),o=n(4006),l=n(32485),c=n.n(l),s=n(17402),d=n(84605),u=n(11747),p=n(89490),h=n(24675);let m=e=>{var{className:t,align:n,size:l,weight:s,transform:m}=e,g=(0,r._)(e,[“className”,”align”,”size”,”weight”,”transform”]);g=(0,a._)((0,i._)({},g),{textAlign:null!=n?n:g.textAlign,textTransform:null!=m?m:g.textTransform,fontSize:null!=l?l:g.fontSize,fontWeight:null!=s?s:g.fontWeight});let{iString:y,language:f}=(0,d.GO)(),b=g.children;if(g.translated&&”en”!==f){let e=[],t=[],n=(0,u.oI)(g.children,e,t),i=y(n,…t);if(i&&i!==n)try{b=(0,u.HP)(i,e)}catch(e){console.log(“Could not translate “.concat(n),e)}}return(0,o.Y)(p.az,(0,a._)((0,i._)({className:c()(h.A.reset,t)},g),{children:b}))},g=e=>(0,o.Y)(m,(0,i._)({as:”span”},e));function y(e){var{className:t,displayName:n}=e,l=(0,r._)(e,[“className”,”displayName”]);let d=(0,s.forwardRef)((e,n)=>{var{className:s}=e,d=(0,r._)(e,[“className”]);return(0,o.Y)(m,(0,a._)((0,i._)({},l,d),{ref:n,className:c()(t,s)}))});return d.displayName=n,d}let f=y({as:”h1″,font:”display”,size:36,weight:”bold”,lineHeight:44}),b=y({as:”h2″,font:”display”,size:30,lineHeight:36,weight:”bold”}),Y=y({as:”h3″,font:”display”,size:24,lineHeight:28,weight:”bold”}),v=y({as:”h4″,font:”display”,size:20,lineHeight:24,weight:”bold”}),_=y({font:”text”,size:19,lineHeight:26,weight:”regular”}),w=y({font:”text”,fontSize:17,lineHeight:24,fontWeight:”regular”}),k={font:”text”,fontSize:15,lineHeight:20,fontWeight:”regular”},A=y(k),C=y({font:”text”,fontSize:13,lineHeight:20,fontWeight:”regular”}),S=y({font:”text”,size:11,lineHeight:20,weight:”regular”}),N=y((0,a._)((0,i._)({},{font:”meta”,fontSize:11,lineHeight:20,fontWeight:”medium”,textTransform:”uppercase”,color:”secondary”}),{className:h.A.meta})),I=y({font:”digit”,size:12,lineHeight:20,weight:”bold”,transform:”uppercase”,className:h.A.digit}),x=y({as:”a”,decoration:”hover-underline”});y({as:”span”});let D=y({font:”text”,color:”primary”,className:h.A.marketingBody}),T=y({as:”h1″,weight:”regular”,className:h.A.marketingHeading1}),F=y({as:”h2″,weight:”medium”,className:h.A.marketingHeading2}),E=y({as:”h3″,weight:”medium”,className:h.A.marketingHeading3}),R=y({as:”h4″,weight:”medium”,className:h.A.marketingHeading4}),P=y({as:”h5″,weight:”bold”,className:h.A.marketingHeading5}),U=y({as:”h4″,weight:”regular”,textAlign:”center”,className:h.A.marketingQuote}),B=y({as:”h4″,size:30,weight:”regular”,className:h.A.marketingSubtitle});m.H1=f,m.H2=b,m.H3=Y,m.H4=v,m.B1=_,m.B2=w,m.B3=A,m.B4=C,m.B5=S,m.Meta=N,m.Digit=I,m.MarketingBody=D,m.MarketingHeading1=T,m.MarketingHeading2=F,m.MarketingHeading3=E,m.MarketingHeading4=R,m.MarketingHeading5=P,m.MarketingQuote=U,m.MarketingSubtitle=B},47784:function(e,t,n){n.d(t,{A:()=>h});var i=n(69277),a=n(70408),r=n(32641),o=n(4006),l=n(32485),c=n.n(l),s=n(17402),d=n(11587),u=n(65842),p=n(24311);let h=(0,s.forwardRef)((e,t)=>{var{className:n,error:l=!1,defaultRows:h=4,maxRows:m,value:g,onChange:y}=e,f=(0,r._)(e,[“className”,”error”,”defaultRows”,”maxRows”,”value”,”onChange”]);let{innerRef:b,combinedRef:Y}=(0,u.N)(t),{value:v,handleChange:_}=(0,d.u)({value:g,onChange:y}),w=(0,s.useCallback)(()=>{let e=b.current;if(!e)return;let t=window.getComputedStyle(e),n=parseInt(t.borderTopWidth)+parseInt(t.borderBottomWidth),i=parseInt(t.paddingTop)+parseInt(t.paddingBottom),a=parseInt(t.lineHeight);e.style.height=”auto”;let r=m?a*m+n+i:1/0,o=a*h+n+i,l=Math.min(Math.max(e.scrollHeight+n,o),r);e.style.height=””.concat(l,”px”)},[h,m]);return(0,s.useEffect)(()=>{w(),document.fonts&&”loaded”!==document.fonts.status&&document.fonts.ready.then(w)},[w,g]),(0,s.useEffect)(()=>(window.addEventListener(“resize”,w),()=>window.removeEventListener(“resize”,w)),[w]),(0,o.Y)(d.T,(0,a._)((0,i._)({},f),{value:v,onChange:e=>{_(e),w()},rows:h,className:c()(n,p.A.autogrowing),ref:Y,error:l}))})},13892:function(e,t,n){n.d(t,{A:()=>i});let i=(0,n(89490).I4)({display:”contents”},”a”)},6237:function(e,t,n){n.d(t,{m:()=>l});var i=n(4006),a=n(51290),r=n(35369),o=n(13649);function l(e){let{tab:t,priority:n=”secondary”,onClick:l}=e,{leading:c,trailing:s,value:d,label:u}=t;return(0,i.Y)(a.l9,{asChild:!0,value:d,children:(0,i.Y)(r.$n,{size:”sm”,priority:n,leading:c,trailing:s,className:o.A.tab,onClick:l,children:u})})}},36994:function(e,t,n){n.d(t,{z:()=>g});var i=n(69277),a=n(70408),r=n(32641),o=n(4006),l=n(51290),c=n(17402),s=n(84605),d=n(17028),u=n(44552),p=n(6237),h=n(95187),m=n(11510);function g(e){var{tabs:t,value:n,onChange:g,priority:b=”secondary”,ariaLabel:Y,innerPadding:v=0}=e,_=(0,r._)(e,[“tabs”,”value”,”onChange”,”priority”,”ariaLabel”,”innerPadding”]);let w=(0,c.useRef)(null),k=(0,m.Iu)(),{iString:A}=(0,s.GO)(),{props:C,hasOverflow:S}=(0,u.h9)(w),{state:N,handleArrowClick:I}=(0,h.jA)(w),x=e=>{g(e)};return(0,o.Y)(y,(0,a._)((0,i._)({},_),{children:(0,o.Y)(l.bL,{value:n,onValueChange:x,asChild:!0,children:(0,o.FD)(f,{children:[!k&&(0,o.Y)(h.cK,{direction:”left”,isVisible:N.showLeft,onClick:I(-1)}),(0,o.Y)(l.B8,{asChild:!0,children:(0,o.Y)(d.fI,(0,a._)((0,i._)({},C),{ref:w,gap:8,paddingY:4,paddingX:null!=v?v:4,minWidth:0,flex:”grow”,overflow:”auto”,scrollBar:”hidden”,cursor:S()?”grab”:”default”,”aria-label”:null!=Y?Y:””.concat(A(“Tabs”)),children:t.map(e=>(0,o.Y)(p.m,{tab:e,priority:b,onClick:()=>{x(e.value)}},e.value))}))}),!k&&(0,o.Y)(h.cK,{direction:”right”,isVisible:N.showRight,onClick:I(1)})]})})}))}function y(e){var{children:t}=e,n=(0,r._)(e,[“children”]);return(0,o.Y)(d.VP,(0,a._)((0,i._)({position:”relative”},n),{children:t}))}let f=(0,d.I4)({display:”flex”,direction:”row”,position:”relative”,overflow:”hidden”,pullX:4,pullY:4})},67140:function(e,t,n){n.d(t,{H:()=>o,V:()=>c});var i=n(69843),a=n.n(i),r=n(82776);let o=”-“,l=[“currency”,”currency-truncated”,”dollar”,”dollar-truncated”],c=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:”USD”,i=arguments.length>3?arguments[3]:void 0,c=arguments.length>4?arguments[4]:void 0,s=a()(e)||!isFinite(e)||0===e,d=l.includes(t),u=e?d&&i?e/100:e:0,p=1>Math.abs(u),h=.01>Math.abs(u);if(s)return o;switch(t){case”number”:return new Intl.NumberFormat(c,{maximumFractionDigits:2,maximumSignificantDigits:p?2:void 0}).format(u);case”percent”:return new Intl.NumberFormat(c,{style:”percent”,maximumFractionDigits:2,maximumSignificantDigits:h?2:void 0}).format(u);case”dollar”:return new Intl.NumberFormat(c,{style:”currency”,currency:”USD”,minimumFractionDigits:2*!!p,maximumFractionDigits:2}).format(u);case”currency”:{let t=new Intl.NumberFormat(c,{style:”currency”,currency:n,minimumFractionDigits:2*!!p,maximumFractionDigits:2});return i?(0,r.centsToPriceString)(e,n):t.format(u)}case”number-truncated”:return new Intl.NumberFormat(c,{notation:”compact”,compactDisplay:”short”,maximumSignificantDigits:p?2:3}).format(u).toUpperCase();case”dollar-truncated”:return new Intl.NumberFormat(c,{style:”currency”,currency:”USD”,notation:”compact”,compactDisplay:”short”,minimumFractionDigits:p?2:void 0,maximumFractionDigits:2,maximumSignificantDigits:p?void 0:3}).format(u).toUpperCase();case”currency-truncated”:return new Intl.NumberFormat(c,{style:”currency”,currency:n,notation:”compact”,compactDisplay:”short”,minimumFractionDigits:p?2:void 0,maximumFractionDigits:2,maximumSignificantDigits:p?void 0:3}).format(u).toUpperCase();case”duration”:{let t=e<0,n=t?Math.ceil(e/1e3):Math.floor(e/1e3),i=t?Math.ceil(n/3600):Math.floor(n/3600),a=t?Math.ceil(n%3600/60):Math.floor(n%3600/60),r=n%60,o=new Intl.NumberFormat(c,{style:"unit",unit:"hour",unitDisplay:"narrow"}),l=new Intl.NumberFormat(c,{style:"unit",unit:"minute",unitDisplay:"narrow"}),s=new Intl.NumberFormat(c,{style:"unit",unit:"second",unitDisplay:"narrow"});if(Math.abs(i)>0)return””.concat(o.format(i).toUpperCase(),”\n “).concat(Math.abs(a)>0?” “.concat(l.format(a).toUpperCase()):””,”\n “).concat(Math.abs(r)>0?” “.concat(s.format(r).toUpperCase()):””);if(Math.abs(a)>0)return””.concat(l.format(a).toUpperCase(),”\n “).concat(Math.abs(r)>0?” “.concat(s.format(r).toUpperCase()):””);return””.concat(s.format(r).toUpperCase())}default:return o}}},48075:function(e,t,n){n.d(t,{l:()=>a});var i=n(17028);(0,i.I4)({bg:”primary”,radius:”md”,color:”primary”,sizing:”border-box”},i.VP);let a=(0,i.I4)({display:”flex”,bg:”primary”,border:”detail”,padding:20,gap:20,radius:”lg”,shadow:”xl”,width:440,sizing:”border-box”,textAlign:”center”},i.VP)},78558:function(e,t,n){n.d(t,{A:()=>a});var i=n(4006);let a=e=>{let{children:t}=e;return(0,i.Y)(“div”,{className:”data-module”,children:t})}},52145:function(e,t,n){n.d(t,{DE:()=>g,H2:()=>Y,MI:()=>y,PN:()=>f});var i=n(4006),a=n(38376),r=n(49436),o=n(84605),l=n(94729),c=n(35369),s=n(88774),d=n(36372),u=n(36319),p=n(70486),h=n(16291),m=n(35407);function g(e){let{onMute:t,customLabel:n}=e,{iString:r}=(0,o.GO)();return(0,i.Y)(s.Dr,{leading:(0,i.Y)(a.A,{className:m.A.muteIcon}),onClick:e=>{e.preventDefault(),e.stopPropagation(),t(“indefinitely”)},children:n||r(“Mute”)})}function y(e){let{onClick:t,customLabel:n}=e,{iString:a}=(0,o.GO)();return(0,i.Y)(s.Dr,{leading:(0,i.Y)(r.A,{className:m.A.muteIcon}),onClick:e=>{e.preventDefault(),t()},children:n||a(“Unmute”)})}function f(e){let{pubId:t}=e,{isMuted:n,handleUnmute:l,handleMute:d}=Y({pubId:t}),{iString:u}=(0,o.GO)();return n?(0,i.Y)(c.K0,{priority:”tertiary”,onClick:l,children:(0,i.Y)(a.A,{size:20})}):(0,i.FD)(s.W1,{trigger:(0,i.Y)(c.K0,{priority:”tertiary”,children:(0,i.Y)(r.A,{size:20})}),children:[(0,i.Y)(s.j,{children:u(“Mute chat”)}),(0,i.Y)(b,{onMute:d})]})}function b(e){let{onMute:t}=e,{iString:n}=(0,o.GO)();return(0,i.Y)(i.FK,{children:[[“1hour”,n(“For 1 hour”)],[“8hours”,n(“For 8 hours”)],[“24hours”,n(“For 24 hours”)],[“indefinitely”,n(“Until I change it”)]].map(e=>{let[n,a]=e;return(0,i.Y)(s.Dr,{onClick:e=>{e.preventDefault(),t(n)},children:a},n)})})}function Y(e){let{pubId:t}=e,n=(0,p.Pk)(),a=(0,p.wA)(),r=(0,d.d)(),{iString:c}=(0,o.GO)(),s=(0,u.iT)(n,t),m=null==s?void 0:s.muteStatus;return{isMuted:!!(m&&m.is_muted&&(null==m.expires_at||m.expires_at>new Date().toISOString())),handleMute:e=>{let n=function(e){let t=0;switch(e){case”1hour”:t=1;break;case”8hours”:t=8;break;case”24hours”:t=24;break;case”indefinitely”:return null}return(0,h.A)().add(t,”hour”).toISOString()}(e);a({type:”pub_chat-mute”,payload:{pubId:t,expires_at:n}}),(0,l.x6)(“/api/v1/community/publications/”.concat(t,”/mute”),{method:”POST”,json:{is_muted:!0,expires_at:null!=n?n:void 0,type:”mute”}}).then(()=>{r.popToast(()=>(0,i.Y)(d.y,{text:c(“Chat muted”)}))}).catch(e=>{console.error(e),r.popToast(()=>(0,i.Y)(d.y,{text:c(“Failed to mute chat”)}))})},handleUnmute:()=>{a({type:”pub_chat-unmute”,payload:{pubId:t}}),(0,l.x6)(“/api/v1/community/publications/”.concat(t,”/mute”),{method:”POST”,json:{is_muted:!1,type:”mute”}}).then(()=>{r.popToast(()=>(0,i.Y)(d.y,{text:c(“Chat unmuted”)}))}).catch(e=>{console.error(e),r.popToast(()=>(0,i.Y)(d.y,{text:c(“Failed to unmute chat”)}))})}}}},99051:function(e,t,n){n.d(t,{_Y:()=>m,no:()=>y});var i=n(69277),a=n(70408),r=n(4006),o=n(17402),l=n(86500),c=n(94729),s=n(35369),d=n(97515),u=n(32848),p=n(49807),h=n(57324);function m(e){let{error:t}=e;if(t instanceof c.fk){let{status:e,publication:i}=t.body;if(“CHAT_NOT_ENABLED”===e)return(0,r.Y)(d.p,{title:”This publication has not enabled chat yet.”,description:”Once it does, you can access its chat here.”,flex:”grow”});if([“FOUNDING_SUBSCRIPTION_REQUIRED”,”PAID_SUBSCRIPTION_REQUIRED”,”FREE_SUBSCRIPTION_REQUIRED”].includes(e)){var n;let t=i&&(0,r.Y)(g,{publication:i,status:e}),a=null!=(n=null==i?void 0:i.name)?n:”this publication”;if(“FOUNDING_SUBSCRIPTION_REQUIRED”===e)return(0,r.Y)(d.p,{title:”Founding subscribers only”,description:”Only founding subscribers to “.concat(a,” can access this chat.”),button:t,flex:”grow”});if(“PAID_SUBSCRIPTION_REQUIRED”===e)return(0,r.Y)(d.p,{title:”Paid subscribers only”,description:”Only paid subscribers to “.concat(a,” can access this chat.”),button:t,flex:”grow”});if(“FREE_SUBSCRIPTION_REQUIRED”===e)return(0,r.Y)(d.p,{title:”Subscribers only”,description:”Only subscribers to “.concat(a,” can access this chat.”),button:t,flex:”grow”})}if(“PUBLICATION_NOT_FOUND”===e)return(0,r.Y)(d.p,{title:”We could not find this publication.”,description:”Please select another publication and try again.”,flex:”grow”})}return t instanceof Error&&”FLAGGED_AS_SPAM”===t.message?(0,r.Y)(d.p,{title:”We could not find this publication.”,description:”Please select another publication and try again.”,flex:”grow”}):(0,r.Y)(d.p,{title:”Something went wrong loading the chat.”,description:”Please check back in again.”,flex:”grow”})}function g(e){let{publication:t,status:n}=e,c={publication_id:t.id,audience:n.startsWith(“FOUNDING”)?”founding”:n.startsWith(“PAID”)?”paid”:”free”};return(0,o.useEffect)(()=>{(0,l.u4)(l.qY.THREAD_SUBSCRIBE_WALL_VIEWED,c)},[t.id]),(0,r.Y)(y,{pub:t,utm_source:h.VU.webChatNavigation,onClick:()=>{(0,l.u4)(l.qY.THREAD_SUBSCRIBE_WALL_BUTTON_CLICKED,(0,a._)((0,i._)({},c),{did_subscribe:!0,source:”chat-paywall”}))}})}function y(e){let{pub:t,utm_source:n,onClick:i}=e,{isFreeSubscribed:a}=(0,u.NL)(t.id);return(0,r.Y)(s.$n,{priority:”primary”,onClick:()=>{null==i||i();let e=(0,p.eV6)(t,{addBase:!0,params:{next:document.location.href,utm_source:n}});window.open(e,”_blank”)||(window.location.href=e)},children:a?”Upgrade subscription”:”Subscribe”})}},69089:function(e,t,n){n.d(t,{e:()=>s,n:()=>d});var i=n(69277),a=n(32641),r=n(4006),o=n(26683),l=n(17028),c=n(3898);function s(e){var{children:t,setReactions:n=!0,alignSelf:l}=e,c=(0,a._)(e,[“children”,”setReactions”,”alignSelf”]);return n?(0,r.FD)(d,{position:”relative”,alignSelf:l,children:[t,(0,r.Y)(o.LI,(0,i._)({},c))]}):(0,r.Y)(r.FK,{children:t})}let d=(0,l.yw)({display:”flex”,className:c.A.reactionsHoverZone})},83804:function(e,t,n){n.d(t,{Kd:()=>C,zK:()=>w});var i=n(4006),a=n(32485),r=n.n(a),o=n(49921),l=n(5061),c=n(17402),s=n(17988),d=n(78649),u=n(82519),p=n(84605),h=n(85478),m=n(17028),g=n(69553),y=n(46376),f=n(70577),b=n(32848),Y=n(43296),v=n(55714),_=n(93375);let w=e=>{let{liveStream:t,handle:n,subscriptions:a,setSubscriptions:r,className:l,isHostView:c,isOpen:d=!0,onClose:u=()=>void 0,showClose:h=!1}=e,{iString:y}=(0,p.GO)(),f=(0,s.useMediaQuery)({maxWidth:800});return(0,i.FD)(m.VP,{display:!d||(null==n?void 0:n.active)||f?”none”:”flex”,width:400,alignSelf:”stretch”,sizing:”border-box”,borderLeft:”detail”,className:l,children:[(0,i.FD)(m.pT,{padding:16,borderBottom:”detail”,alignItems:”center”,justifyContent:”space-between”,children:[(0,i.Y)(m.EY.H4,{userSelect:”none”,children:y(“Live chat”)}),h&&(0,i.Y)(m.K0,{onClick:u,children:(0,i.Y)(o.A,{size:20})})]}),(0,i.Y)(k,{liveStream:t,isHostView:c}),(0,i.Y)(g.T,{liveStream:t,subscriptions:a,setSubscriptions:r,showShareButton:!c})]})},k=e=>{var t,n;let{liveStream:a,isHostView:r}=e,[o,s]=(0,c.useState)([]),[d,u]=(0,c.useState)(!0),p=(0,c.useRef)(null),{getConfigFor:g}=(0,h.mJ)(),_=g(“thefp_enable_web_livestream_kicking”),w=(0,Y.XW)(),k=(0,b.n7)(),N=e=>{s(t=>t.find(t=>t.id===e.id)?t:[…t,e].slice(-1e3))};if((0,c.useEffect)(()=>null==w?void 0:w.listen({[(0,v.sl)({streamId:a.liveStream.id})]:e=>{var t,n;let{data:i}=e;(null==i||null==(t=i.message)?void 0:t.type)===”live-stream:message-sent”&&N(i.message.message),(null==i||null==(n=i.message)?void 0:n.type)===”live-stream:viewer-count-updated”&&i.message.num_viewers_joined>0&&N(i.message),d&&setTimeout(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight)},0)}}),[w,a.liveStream.id,d]),(0,c.useEffect)(()=>{p.current&&!a.liveStreamInformation.desktopPlaybackUrl&&(p.current.scrollTop=p.current.scrollHeight)},[a.liveStreamInformation.desktopPlaybackUrl]),!r&&!a.liveStreamInformation.desktopPlaybackUrl)return(0,i.Y)(f.S,{});if(r&&0===o.length)return(0,i.Y)(m.VP,{flex:”grow”,position:”relative”,justifyContent:”center”,children:(0,i.Y)(m.pT,{justifyContent:”center”,children:(0,i.FD)(m.VP,{alignItems:”center”,gap:16,children:[(0,i.Y)(l.A,{size:24}),(0,i.Y)(m.EY.B4,{translated:!0,weight:”semibold”,children:”Live chat will appear here”})]})})});let I=null==(t=k.result)?void 0:t.publicationUserMap.get(null!=(n=a.liveStream.publication_id)?n:-1),x=(null==I?void 0:I.role)===”admin”;return(0,i.FD)(m.VP,{flex:”grow”,position:”relative”,children:[(0,i.Y)(A,{ref:p,onScroll:()=>{p.current&&u(32>=Math.abs(p.current.scrollTop))},children:(0,i.Y)(C,{children:o.map(e=>”user”in e?(0,i.Y)(y.K,{message:e,showBlockButton:!!x&&!!_,liveStream:a.liveStream,disableUserLinks:r},e.id):e.num_viewers_joined>0?(0,i.Y)(y.t,{message:e,disableUserLinks:r},e.id):null)})}),(0,i.Y)(S,{scrollRef:p,hidden:d})]})},A=(0,m.I4)({display:”flex”,direction:”column-reverse”,flex:”grow”,scrollBar:”hidden”,overflow:”auto”,position:”relative”}),C=(0,m.I4)({display:”flex”,direction:”column”,padding:16,gap:16}),S=e=>{let{scrollRef:t,hidden:n}=e;return(0,i.Y)(d.Q,{children:(0,i.Y)(m.pT,{bg:”primary”,radius:”full”,className:r()(_.A.jumpButton,n&&_.A.hidden),children:(0,i.Y)(m.K0,{priority:”secondary-outline”,rounded:!0,onClick:()=>{setTimeout(()=>{var e;null==(e=t.current)||e.scrollTo({top:t.current.scrollHeight,behavior:”smooth”})},0)},children:(0,i.Y)(u.A,{})})})})}},29611:function(e,t,n){n.d(t,{v:()=>o});var i=n(4006),a=n(94729),r=n(36372);function o(){let e=(0,r.d)();return(t,n)=>{e.popToast(()=>(0,i.Y)(r.y,{text:(0,a.Qd)(t,n)}))}}},80856:function(e,t,n){n.d(t,{Ru:()=>r,_:()=>c,an:()=>s,gB:()=>l,iQ:()=>o,lk:()=>a});var i=n(92636);let a=function(){let{utm_source:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,i.yR)(“”.concat((0,i.Ew)(),”/tos”),{utm_source:e})},r=function(){let{pub:e,utm_source:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e?(0,i.yR)(“”.concat((0,i.$_)(e),”/tos”),{utm_source:t}):a({utm_source:t})},o=function(){let{utm_source:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return””.concat((0,i.yR)(“”.concat((0,i.Ew)(),”/ccpa”),{utm_source:e}),”#personal-data-collected”)},l=function(){let{utm_source:e,hash:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return””.concat((0,i.yR)(“”.concat((0,i.Ew)(),”/privacy”),{utm_source:e})).concat(t?”#”.concat(t):””)},c=function(){let{pub:e,utm_source:t,hash:n=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e)return””.concat(l({utm_source:t,hash:n}));let a=n?”#”.concat(n):””;return””.concat((0,i.yR)(“”.concat((0,i.$_)(e),”/privacy”),{utm_source:t})).concat(a)},s=function(){let{utm_source:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return””.concat((0,i.yR)(“”.concat((0,i.Ew)(),”/accessibility”),{utm_source:e}))}}}]);