"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["4990"],{8923:function(e,t,n){n.d(t,{$1:()=>u,Sn:()=>h,wg:()=>p});var o=n(7409),i=n(99282),l=n(16584),a=n(6400),r=n(30396),s=n(80569),d=n.n(s);let c=(0,a.createContext)({oauthAccessToken:null,isOAuthProvider:!1}),p=()=>(0,r.qp)(c);function u(e){let t=t=>{let{oauthAccessToken:n}=p();return(0,l.tZ)(e,(0,i._)((0,o._)({},t),{oauthAccessToken:n}))};return t.displayName="WithOAuthEmbed(".concat(e.displayName||e.name||"Component",")"),t}let h=()=>{let{oauthAccessToken:e}=p();return(0,r.Ye)(()=>{let t=t=>(e&&t.set("Authorization","Bearer ".concat(e)),t);return{get:e=>t(d().get(e)),post:e=>t(d().post(e)),put:e=>t(d().put(e)),delete:e=>t(d().delete(e)),patch:e=>t(d().patch(e))}},[e])}},41258:function(e,t,n){n.d(t,{AM:()=>et,L8:()=>q,LB:()=>G,eR:()=>K,lf:()=>W,sA:()=>Y});var o=n(27412),i=n(7409),l=n(99282),a=n(58865),r=n(16584),s=n(6400),d=n(98661),c=n(30396),p=n(94184),u=n.n(p),h=n(74691),m=n.n(h),g=n(14293),f=n.n(g),v=n(43174),y=n.n(v),_=n(80569),C=n.n(_),S=n(79094),w=n(57391),b=n(95441),Z=n(15597),R=n(46914),N=n(68833),E=n(95434),k=n(63648),x=n(65892),B=n(41990),P=n(26419),T=n(82011),X=n(68072),O=n(46638),A=n(12900),M=n(71068),I=n(15771),D=n(19081),L=n(50364),H=n(47929);function F(){let e=(0,a._)(["Comment by ",""]);return F=function(){return e},e}let z=Math.min(Math.ceil((m()(document.body.clientWidth,400,728)-140)/50),10);class J extends s.Component{componentDidMount(){this.setSelectedHighlight(),this.setReplyStateFromHash(),this.updateOverflows()}componentDidUpdate(e){var t,n;(null===(t=e.comment)||void 0===t?void 0:t.id)!==(null===(n=this.props.comment)||void 0===n?void 0:n.id)&&this.setSelectedHighlight(),e.replying!==this.props.replying&&this.props.replying&&this.startReply()}setReplyStateFromHash(){if(this.props.comment.deleted||"undefined"==typeof window||!window.location.hash)return;let e=/^#comment-(\d+)-reply$/.exec(window.location.hash);e&&Number(e[1])===this.props.comment.id&&(window.location.hash=window.location.hash.replace(/-reply$/,""),this.startReply())}async startReply(){this.props.onStartReply?this.props.onStartReply(this.props.comment):await new Promise(e=>this.setState({replying:!0},e))}onDateClick(e){var t;let[n,o]=e.target.href.split("?")[0].split("#");n===(null===(t=window.location.href.split("?")[0])||void 0===t?void 0:t.split("#")[0])&&o&&(e.preventDefault(),this.setState({hideAnchors:!0},()=>{window.location.hash="#".concat(o),this.setState({hideAnchors:!1})}))}updateOverflows(){let e=this.bodyRef.current;if(!e)return;let t=e.scrollHeight-e.clientHeight;t>0&&t<200?e.classList.add("expanded"):t>=200&&(e.classList.add("long"),e.setAttribute("data-hidden-height",t))}render(e,t){var n,o,a,s;let{user:d,comment:c,freeSignup:p,freeSignupEmail:h,pub:m,post:g,reaction_token:v,depth:y,collapseAtDepth:_,onChange:C,scrollRef:S,retainUserCollapseState:w,onStartReply:b,noHoverProfile:Z,onProfileClick:R,onShareComment:N,hideContextMenu:E,noRestack:M,updateCommentReacted:H,iString:J,iTemplate:j,hideShare:W}=e,{isSelected:Y,replying:q,editing:G,hideAnchors:K,isCollapsed:V}=t,$=m.community_enabled&&g&&"none"!==g.write_comment_permissions,{user_banned:Q}=c;if(G&&d)return(0,r.tZ)(B._,{autoFocus:!0,user:d,freeSignup:p,freeSignupEmail:h,pub:m,post:g,commentBeingEdited:c,saveEdit:this.saveEdit,token:v,onCancel:()=>this.setState({editing:!1}),onSuccess:C?this.onSaveEditSuccess:null});let et=null===(n=(0,O.gz)(c))||void 0===n?void 0:n.name,en=et?j(F(),et):J("Comment");return(0,r.BX)("div",{className:u()("comment",{selected:Y,"post-reply":"reply"===c.type,collapsed:V}),children:[!K&&[(0,r.tZ)("div",{id:"comment-".concat(c.id),className:"comment-anchor"}),(0,r.tZ)("div",{id:"comment-".concat(c.id,"-reply"),className:"comment-anchor"})],(0,r.BX)(D.X2,{gap:12,paddingBottom:12,className:"comment-content",role:"article","aria-label":en,children:[(0,r.tZ)(D.sg,{ref:this.headContainerRef,children:(0,r.tZ)(T.a,{comment:c,noHover:Z,onClick:R?()=>R(c):void 0})}),(0,r.BX)(D.sg,{flex:"grow",children:[(0,r.tZ)(P.J,{post:g,pub:m,comment:c,isCollapsed:V,toggleCollapse:()=>this.setCollapsed(!this.state.isCollapsed),onProfileClick:R,userBanned:null!=Q&&Q,userPendingApproval:c.status===L.ql.new_commenter_approval_required&&!!(null==d?void 0:d.is_admin),onChange:this.onChange,startEdit:()=>this.startEdit(),startReport:this.showReportModal,openBan:this.openBan,hideContextMenu:E}),(0,r.tZ)(x.Z,{comment:c,bodyRef:this.bodyRef,expandToggleClicked:this.expandToggleClicked}),(0,r.tZ)(k.Z,{comment:c,pub:m,user:d,post:g,reaction_token:v,commentsEnabledForPost:$,noRestack:M,onChange:this.onChange,startReply:()=>this.startReply(),updateCommentReacted:H,shareComment:N,hideShare:W}),(0,r.tZ)(A.H,{expanded:q&&$,clip:!1,children:(0,r.tZ)(U,{children:(0,r.tZ)(B._,{autoFocus:!0,user:d,freeSignup:p,freeSignupEmail:h,pub:m,post:g,parent:c,token:v,onCancel:()=>this.setState({replying:!1}),onSuccess:C?e=>{this.setState({replying:!1}),C((0,l._)((0,i._)({},c),{children:[e].concat(c.children)}))}:null,alwaysShowButtons:!0})})})]})]}),c.childrenSummary&&(0,r.tZ)("div",{className:"more-replies-container",children:(0,r.tZ)("a",{className:"more-replies",href:(0,O.aE)(g,c,m),children:c.childrenSummary})}),!c.childrenSummary&&!f()(y)&&y>=z&&!!(null===(o=c.children)||void 0===o?void 0:o.length)&&(0,r.tZ)("div",{className:"more-replies-container",children:(0,r.tZ)(I.zx,{size:"sm",priority:"secondary-outline",href:(0,O.aE)(g,c,m),children:J("Continue Thread →")})}),!c.childrenSummary&&!f()(y)&&y0&&(0,r.tZ)(X.S,{onCollapse:()=>this.setCollapsed(!0)})]},c.id)}constructor(e,t){super(e,t),(0,o._)(this,"bodyRef",(0,s.createRef)()),(0,o._)(this,"headContainerRef",(0,s.createRef)()),(0,o._)(this,"openBan",()=>{this.props.commentActions.openBanDialog({comment:this.props.comment,onReply:()=>{this.startReply()}})}),(0,o._)(this,"setSelectedHighlight",()=>{let e=(0,O.Jr)()===this.props.comment.id;this.setState({isSelected:e})}),(0,o._)(this,"startEdit",()=>{this.setState({editing:!0})}),(0,o._)(this,"saveEdit",async e=>{if(this.state.editing)return{res:await C().patch("/api/v1/comment/".concat(this.props.comment.id)).send({body:e})}}),(0,o._)(this,"onSaveEditSuccess",e=>{var t,n;let{edited:o}=e;this.setState({editing:!1}),null===(t=(n=this.props).onChange)||void 0===t||t.call(n,(0,i._)({},this.props.comment,o))}),(0,o._)(this,"showReportModal",()=>{var e;let{pub:t,comment:n}=this.props;this.props.onReport({pub:t,canReportToAdmins:!!(null==t?void 0:t.moderation_enabled)&&!(null===(e=n.metadata)||void 0===e?void 0:e.is_author),onSubmit:async e=>{var o,a;let{reportCategory:r,reportedToSubstack:s,details:d}=e;await C().post("/api/v1/comment/".concat(n.id,"/report")).send({publication_id:null==t?void 0:t.id,details:d,reportCategory:r,reportedToSubstack:s}),null===(o=(a=this.props).onChange)||void 0===o||o.call(a,(0,l._)((0,i._)({},this.props.comment),{reported_by_user:!0}))}})}),(0,o._)(this,"expandToggleClicked",()=>{let e=this.bodyRef.current;e&&(e.classList.remove("long"),e.classList.add("expanded"),(0,N.j)(N.FP.COMMENT_EXPAND_TOGGLE_CLICKED,{hiddenHeight:e.getAttribute("data-hidden-height")}))}),(0,o._)(this,"onChange",e=>{this.props.onChange?this.props.onChange((0,i._)({},this.props.comment,e)):document.location.href=(0,O.Os)(this.props.post,this.props.pub)}),(0,o._)(this,"setComment",e=>{this.setState({comment:e})}),(0,o._)(this,"setCollapsed",e=>{var t,n;if(this.setState({isCollapsed:e}),e&&(null===(n=this.headContainerRef)||void 0===n?void 0:null===(t=n.current)||void 0===t?void 0:t.scrollIntoView)){let e=this.headContainerRef.current.getBoundingClientRect();e.top<0&&(document.documentElement.scrollTop+=e.top-80)}this.props.retainUserCollapseState&&(0,O.VS)(this.props.comment.id,e)}),this.state={editing:!1,replying:!1,hideAnchors:!1,isSelected:!1,isCollapsed:this.props.retainUserCollapseState&&(0,O.ei)(this.props.comment.id)}}}(0,o._)(J,"contextType",w.kx);let U=(0,M.zo)({display:"flex",flex:"grow",paddingTop:16}),j=(0,d.memo)((0,b.fz)(function(e){let t=(0,d.useContext)(en),n=(0,S.T)();return(0,r.tZ)(J,(0,l._)((0,i._)({},e),{commentActions:t,onReport:n}))}));J.displayName="Comment_Internal";let W=5,Y=1,q=16,G=50,K=200;function V(e){return e.reduce((e,t)=>e+1+V(t.children||[]),0)}let $=e=>{let{user:t,freeSignup:n,freeSignupEmail:o,pub:i,post:l,comments:a,reaction_token:s,depth:d,collapseAtDepth:p,onChange:h,pageSize:m,retainUserCollapseState:g,updateCommentReacted:f,parent:v,scrollRef:_,className:C,onStartReply:S,noHoverProfile:w,onProfileClick:N,hideContextMenu:E,noRestack:k,hideShare:x}=e,B=m||q,[P,T]=(0,c.eJ)(!1),[X,O]=(0,c.eJ)(!1),[A,M]=(0,c.eJ)(B),[D,L]=(0,c.eJ)(-1),[F,z]=(0,c.eJ)(new Set(a.map(e=>{let{id:t}=e;return t}))),{iString:J,iPlural:U}=(0,b.M1)();(0,c.d4)(()=>{D>=0&&window.scrollTo(window.scrollX,D)},[D]);let W=(0,Z.s)(),Y=(0,R.z)(e=>{W.open({pub:i,post:l,commentId:e,comments:a,user:null!=t?t:void 0,utm_campaign:H.VX.commentListShareCta})});if(0===(a||[]).length)return null;let[G,K]=y()(null!=a?a:[],e=>{let{id:n,user_id:o}=e;return F.has(n)||o===(null==t?void 0:t.id)}),$=G.slice(0,A);return(0,r.BX)("div",{className:u()("comment-list",C,{"has-new-comments":K.length>0}),children:[K.length>0&&(0,r.tZ)(I.zx,{size:"sm",priority:"secondary-outline",onClick:()=>{setTimeout(()=>{z(new Set(a.map(e=>{let{id:t}=e;return t}))),O(!1)},0),O(!0)},children:X?U("loading 1 new reply","loading %1 new replies",V(K)):U("1 new reply","%1 new replies",V(K))}),(0,r.tZ)("div",{className:"comment-list-items",children:$.map(e=>(0,r.tZ)(j,{user:t,freeSignup:n,freeSignupEmail:o,pub:i,post:l,comment:e,parent:v,reaction_token:s,collapseAtDepth:p,depth:d||0,onChange:h,scrollRef:_,retainUserCollapseState:g,onStartReply:S,noHoverProfile:w,onShareComment:Y,onProfileClick:N,hideContextMenu:E,noRestack:k,updateCommentReacted:f,hideShare:x},e.id))}),G.length>$.length&&(0,r.tZ)(I.zx,{size:"sm",priority:"secondary-outline",loading:P,onClick:()=>{L(window.scrollY),setTimeout(()=>{M(A+B),T(!1)},0),T(!0)},children:J("Load More")})]})};$.displayName="CommentList";let Q=(0,d.memo)($);Q.displayName="CommentList";let ee=Q;function et(e){let[t,n]=(0,c.eJ)(null),o=(0,d.useMemo)(()=>({openBanDialog:n}),[]);return(0,r.BX)(en.Provider,{value:o,children:[(0,r.tZ)(ee,(0,i._)({},e)),(0,r.tZ)(E.Gg,(0,l._)((0,i._)({},t),{onClose:()=>n(null),onBan:(t,n)=>{let{onChange:o}=e;o?o((0,l._)((0,i._)({},t),{user_banned:!0,bans:n.concat(t.bans)})):document.location.href=(0,O.Os)(e.post,e.pub)}}))]})}let en=(0,d.createContext)({openBanDialog:()=>void 0})},41990:function(e,t,n){n.d(t,{_:()=>J});var o=n(7409),i=n(99282),l=n(58865),a=n(16584),r=n(98661),s=n(30396),d=n(94184),c=n.n(d),p=n(80569),u=n.n(p),h=n(93666),m=n(18787),g=n(96726),f=n(42493),v=n(347),y=n(95441),_=n(8923),C=n(16451),S=n(68833),w=n(48980),b=n(98914),Z=n(52513),R=n(26419),N=n(46638),E=n(12900),k=n(15771),x=n(82402),B=n(19081),P=n(43570),T=n(58175),X=n(440),O=n(70379),A=n(37155),M=n(31377),I=n(60308),D=n(63651),L=n(84864),H=n(60648);function F(){let e=(0,l._)(["Only "," subscribers can comment on this post"]);return F=function(){return e},e}let z="commentInput",J=(0,r.forwardRef)((e,t)=>{let{commentBeingEdited:n,parent:l,post:r,autoFocus:d,formClassName:p,saveEdit:h,onCancel:m,onSuccess:g,user:f,freeSignup:C,freeSignupEmail:Z,pub:R,token:E,bannedFromNotes:k,alwaysShowButtons:x}=e,{iString:P}=(0,y.M1)(),T=(0,O.pm)(),X=(0,_.Sn)(),{isOAuthProvider:M,oauthAccessToken:F}=(0,_.wg)(),[J,U]=(0,s.eJ)(!1),[j,W]=(0,s.eJ)(null),Y=(0,s.Ye)(()=>{if("undefined"!=typeof localStorage){let e=JSON.parse(localStorage.getItem(z)||"{}");if(e.postId===r.id)return{value:e.value,alsoShareToNotes:!!e.alsoShareToNotes};localStorage.removeItem(z)}},[]),q=(0,o._)({value:null==n?void 0:n.body,alsoShareToNotes:!1,loading:!1,error:null},Y),[{value:G,alsoShareToNotes:K,loading:Q,error:ee},et]=(0,s.eJ)(q),en=e=>et(t=>(0,i._)((0,o._)({},t),{value:e})),eo=(0,s.sO)(null),ei=(0,s.sO)(null);(0,s.aP)(t,()=>({focus(){var e;null===(e=eo.current)||void 0===e||e.focus()}}),[]),(0,s.d4)(()=>{if(d){var e;null===(e=eo.current)||void 0===e||e.focus()}},[]);let el=!(null==f?void 0:f.name),ea=(0,s.sO)(),er=async()=>{var e;(0,S.j)(S.FP.COMMENT_PAYWALL_SHOWN,{post_id:r.id,post_type:r.type,parent_id:null==l?void 0:l.id}),await (null===(e=ea.current)||void 0===e?void 0:e.open())},es=(0,s.sO)(),ed=async()=>{(0,S.j)(S.FP.FINISH_MAGIC_LOGIN_MODAL_SHOWN,{post_id:r.id,post_type:r.type,parent_id:null==l?void 0:l.id});let e=es.current;e&&(await eh(),await e.open())},ec=(0,s.sO)(),ep=async()=>{var e;(0,S.j)(S.FP.PROFILE_UPDATER_SHOWN,{post_id:r.id,parent_id:null==l?void 0:l.id}),await (null===(e=ec.current)||void 0===e?void 0:e.open())},eu=(0,s.sO)(!1),eh=async()=>{if(!f){console.error("cannot sendLoginEmail, user not defined");return}if(!eu.current){eu.current=!0;try{var e;let t=await (0,w.rd)("/api/v1/email-login",{method:"POST",json:{email:f.email,redirect:null===(e=document.location.href.split("?")[0])||void 0===e?void 0:e.split("#")[0]}});"optional"===t.verification_code&&(U(!0),t.onboarding_redirect&&W(t.onboarding_redirect))}catch(e){alert((0,b.zx)(e))}}},em=()=>{localStorage.setItem(z,JSON.stringify({postId:r.id,value:G,alsoShareToNotes:K}))},eg=async()=>{if(n){et(e=>(0,i._)((0,o._)({},e),{loading:!0}));try{let e=await (null==h?void 0:h(G));ev(e)}catch(e){et(t=>(0,i._)((0,o._)({},t),{loading:!1,error:e}))}}else ef()},ef=async function(){var e;let{profileUpdated:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Q)return;if(!(0,L.canPostComments)(f,r,R).canReply){em(),await er(),await (0,A.g)(600),et(e=>(0,i._)((0,o._)({},e),{error:P("Please sign in.")}));return}if(el&&!t){em(),await ep(),await (0,A.g)(600),et(e=>(0,i._)((0,o._)({},e),{error:P("Please update your profile.")}));return}et(e=>(0,i._)((0,o._)({},e),{loading:!0}));let n={body:null===(e=eo.current)||void 0===e?void 0:e.value,token:E};try{let e;if(K){let t=await X.post("/api/v1/comment/attachment").send({type:"link",url:(0,I.uRy)(R,r)}),i=null==t?void 0:t.body;if(i){let t=(0,o._)({},n);t.attachmentIds=[i.id],e=await X.post("/api/v1/comment/feed").send(t)}else console.warn("Error creating attachment")}l&&(n.parent_id=l.id);let t=await X.post("/api/v1/post/".concat(r.id,"/comment")).send(n);if(localStorage.removeItem(z),!(null==f?void 0:f.profile_set_up_at)){let{body:{count:e}}=await u().get("/api/v1/user/profile_role_count");if(e>=2){let e=(0,I.n1t)("".concat((0,I.ZJn)(),"/profile/start"),{commentProfileFlow:!0,next:(0,N.aE)(r,t.body,R)});return(0,b.uX)(e),!1}}ev({notesComment:e,res:t})}catch(e){e.response&&403===e.response.statusCode&&(f&&f.is_magic?await ed():await er()),et(t=>(0,i._)((0,o._)({},t),{loading:!1,error:e}))}},ev=e=>{let{res:t,notesComment:n}=e;if(!1!==t){if(g&&!el){if(K&&n){let e=(0,D.Sgq)(n.body);T.popToast(t=>(0,a.tZ)(O.FN,(0,i._)((0,o._)({},t),{text:P("Shared to Notes"),cta:P("View Now"),href:e})))}en(""),g(t.body)}else{let e=(0,N.Os)(r,R);M?(0,b.uX)((0,N.fg)(r,R,null!=F?F:"")):window.location.pathname===e?window.location.reload():(0,b.uX)((0,N.Os)(r,R,K?{feedCommentUrl:(0,D.Sgq)(t.body)}:{}))}et(e=>(0,i._)((0,o._)({},e),{loading:!1}))}};return(0,a.tZ)(v.h,{children:(0,a.BX)(B.hs,{"data-test-id":"comment-input",flex:"grow",className:c()({comment:n}),children:[(0,a.tZ)("form",{className:c()(H.Z.form,p),onSubmit:e=>{e.preventDefault(),eg()},ref:ei,children:(0,a.tZ)($,{user:f,commentBeingEdited:n,post:r,pub:R,value:G,bodyInputRef:eo,onInput:e=>{let t=e.currentTarget.value;if(!(0,L.canPostComments)(f,r,R).canReply){e.preventDefault(),er();return}en(t)},onKeyDown:e=>{var t,n;if(null==f?void 0:f.is_magic){e&&e.preventDefault(),ed();return}if(!(0,L.canPostComments)(f,r,R).canReply){e.preventDefault(),er();return}"Escape"===e.key&&(null===(t=eo.current)||void 0===t?void 0:t.value.trim())===""?(null===(n=eo.current)||void 0===n||n.blur(),null==m||m()):"Enter"===e.key&&e.metaKey&&eg()},bannedFromNotes:k,alsoShareToNotes:K,onShareToNotesChange:()=>et(e=>(0,i._)((0,o._)({},e),{alsoShareToNotes:!K})),onCancel:()=>{m?m():en("")},error:ee,loading:Q,alwaysShowButtons:x,isReplying:!!l})}),(0,a.tZ)(V,{user:f,freeSignup:C,freeSignupEmail:Z,pub:R,post:r,token:E,profileUpdaterRef:ec,modalPaywallRef:ea,finishMagicLoginModalRef:es,otpLoginEnabled:J,onboardingRedirect:j,onProfileUpdaterSuccess:e=>"boolean"!=typeof e||!!(e&&ef({profileUpdated:e}))})]})})}),U=e=>{let{error:t}=e;if(!t)return null;let n="string"==typeof t?t:(0,b.zx)(t,"Something went wrong.");return(0,a.tZ)(B.hs,{children:(0,a.tZ)(P.Vp,{priority:"secondary",theme:"error",flex:"auto",children:n})})},j=e=>{let{alsoShareToNotes:t,onChange:n}=e,{iString:o}=(0,y.M1)();return(0,a.BX)(B.hs,{gap:12,alignItems:"center",justifyContent:"center",children:[(0,a.tZ)(x.X,{name:"also_feed",checked:t,onChange:n}),(0,a.tZ)(T.xv.B3,{color:"secondary",children:o("Also share to Notes")})]})},W=e=>{let{bodyInputRef:t,value:n,onInput:o,onKeyDown:i,iString:l,disabled:r}=e;return(0,a.tZ)(X.l,{ref:t,name:"body",placeholder:l("Write a comment..."),defaultRows:4,maxRows:24,value:n||"",onInput:o,onKeyDown:i,className:H.Z.input,disabled:r,"aria-label":l("Write a comment...")})},Y=e=>{let{isEditing:t,isReplying:n,bannedFromNotes:o,alsoShareToNotes:i,onShareToNotesChange:l,onCancel:r,loading:s,disableSubmit:d}=e;return(0,a.BX)(B.X2,{alignItems:"center",justifyContent:"space-between",children:[!t&&!o&&(0,a.tZ)(j,{alsoShareToNotes:i,onChange:l}),(0,a.BX)(q,{children:[(0,a.tZ)(G,{onCancel:r}),(0,a.tZ)(K,{isEditing:t,isReplying:n,loading:s,disabled:d})]})]})},q=e=>{let{children:t}=e;return(0,a.tZ)(B.X2,{gap:8,justifyContent:"end",flex:"grow",children:t})},G=e=>{let{onCancel:t}=e,{iString:n}=(0,y.M1)();return(0,a.tZ)(k.zx,{priority:"secondary",onClick:t,children:n("Cancel")})},K=e=>{let{isEditing:t,isReplying:n,loading:o,disabled:i}=e,{iString:l}=(0,y.M1)();return(0,a.tZ)(k.zx,{priority:"primary",type:"submit",loading:o,disabled:i,children:l(t?"Save":n?"Reply":"Post")})},V=e=>{var t,n;let{user:o,freeSignup:i,freeSignupEmail:l,pub:r,post:s,token:d,profileUpdaterRef:c,modalPaywallRef:p,finishMagicLoginModalRef:u,onProfileUpdaterSuccess:v,otpLoginEnabled:_,onboardingRedirect:C}=e,{iString:S,iTemplate:w}=(0,y.M1)();return(0,a.BX)(g.h,{children:[(0,a.tZ)(f.EB,{ref:c,user:o,freeSignup:i,freeSignupEmail:l,optionalPhoto:!0,token:d,text:S("Save & Post Comment"),onBeforeClose:v}),(0,a.tZ)(m.sF,{ref:p,user:o,freeSignup:i,freeSignupEmail:l,publication:r,post:s,title:w(F(),(0,M.isFoundingAudience)(s.audience)?"founding":"paid"),reauthenticationTitle:S("To post a comment, please re-authenticate.")}),(0,a.BX)(h.p,{ref:u,className:"finish-magic-login-modal",children:[(0,a.tZ)("h4",{children:S("Check your email")}),(0,a.tZ)("p",{children:S("For your security, we need to re-authenticate you.")}),_?(0,a.BX)(a.HY,{children:[(0,a.BX)(T.xv,{as:"p",translated:!0,children:["Click the link we sent to ",I18N.p(null!==(t=null==o?void 0:o.email)&&void 0!==t?t:"")," or enter the code below."]}),(0,a.tZ)(Z.E,{email:null==o?void 0:o.email,redirect:C||document.location.href})]}):(0,a.BX)(T.xv,{as:"p",translated:!0,children:["Click the link we sent to ",I18N.p(null!==(n=null==o?void 0:o.email)&&void 0!==n?n:""),", or"," ",(0,a.tZ)("a",{href:(0,I.uXE)({for_pub:r.subdomain,with_password:!0}),native:!0,children:"click here to sign in"}),"."]})]})]})},$=e=>{let{user:t,commentBeingEdited:n,post:o,pub:i,value:l,bodyInputRef:r,onInput:s,onKeyDown:d,bannedFromNotes:c,alsoShareToNotes:p,onShareToNotesChange:u,onCancel:h,error:m,loading:g,alwaysShowButtons:f,isReplying:v}=e,{iString:_}=(0,y.M1)(),S=!(null==l?void 0:l.trim());return(0,a.BX)(a.HY,{children:[(0,a.tZ)(C.Zb,{size:32,user:t}),(0,a.BX)(B.tu,{flex:"grow",gap:8,children:[n&&(0,a.tZ)(R.J,{comment:n,post:o,pub:i,isCollapsed:!0,userBanned:!1,hideContextMenu:!0,onChange:()=>{},startEdit:()=>{},startReport:()=>{},openBan:()=>{}}),(0,a.tZ)(W,{bodyInputRef:r,value:l,onInput:s,onKeyDown:d,iString:_,disabled:g}),(0,a.tZ)(U,{error:m}),(0,a.tZ)(E.H,{expanded:!S||!!f,clip:!1,children:(0,a.tZ)(Y,{isReplying:v,isEditing:!!n,bannedFromNotes:c,alsoShareToNotes:p,onShareToNotesChange:u,onCancel:h,loading:g,disableSubmit:S})})]})]})}},1980:function(e,t,n){n.d(t,{l:()=>i});var o=n(16584);let i=()=>(0,o.BX)("div",{className:"comment-silhouette",children:[(0,o.tZ)("div",{className:"comment-silhouette-head"}),(0,o.BX)("div",{className:"comment-silhouette-content",children:[(0,o.tZ)("div",{className:"comment-silhouette-meta"}),(0,o.tZ)("div",{className:"comment-silhouette-body"}),(0,o.tZ)("div",{className:"comment-silhouette-actions"})]})]})}}]);