!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"substack@ee6f1f5"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4e10f21c-ee73-4280-bef9-72f783d78864",e._sentryDebugIdIdentifier="sentry-dbid-4e10f21c-ee73-4280-bef9-72f783d78864")}catch(e){}}();"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["63149"],{82936:function(e,t,n){if(n.d(t,{Hv:()=>_,_N:()=>C,b4:()=>v,bd:()=>w,d1:()=>x,hU:()=>E,uL:()=>U}),!/^(47582|70581|78893|89623)$/.test(n.j))var r=n(79785);var i=n(4006);if(!/^(47582|70581|78893|89623)$/.test(n.j))var o=n(63122);if(!/^(47582|70581|78893|89623)$/.test(n.j))var a=n(40972);var l=n(17402),c=n(84605),u=n(46271),s=n(94729),d=n(12501),f=n(68349),p=n(45859),h=n(36372);function y(){let e=(0,r._)([""," muted"]);return y=function(){return e},e}function m(){let e=(0,r._)([""," unmuted"]);return m=function(){return e},e}function g(){let e=(0,r._)([""," blocked"]);return g=function(){return e},e}function b(){let e=(0,r._)([""," unblocked"]);return b=function(){return e},e}let k={mutes:[],blocks:[],blocked:[]},Y=(0,l.createContext)({result:k,refetch:async()=>null,isBlockingUser:()=>!1,isMutedByUser:()=>!1,isBlockedByUser:()=>!1});function v(e){let{user:t,children:n}=e,r=(0,d.st)({pathname:"/api/v1/blocks/ids",deps:[t],auto:!!t}),o=(0,l.useMemo)(()=>{let{result:e,refetch:t}=r;if(e){let{blocked:n,mutes:r,blocks:i}=e,o=new Set(n),a=new Set(r),l=new Set(i);return{result:e,refetch:t,isBlockingUser:e=>o.has(e),isMutedByUser:e=>a.has(e),isBlockedByUser:e=>l.has(e)}}return{result:k,refetch:t,isBlockingUser:()=>!1,isMutedByUser:()=>!1,isBlockedByUser:()=>!1}},[r.result]);return(0,i.Y)(Y.Provider,{value:o,children:n})}function x(){return(0,l.useContext)(Y)}function C(e){let{isBlockingUser:t,isBlockedByUser:n}=(0,l.useContext)(Y);return e?n(e)?"blocking":t(e)?"blocked":null:null}function _(e){let{isBlockingUser:t,isBlockedByUser:n,isMutedByUser:r}=(0,l.useContext)(Y);return e?r(e)?"muting":n(e)?"blocking":t(e)?"blocked":null:null}function w(e,t){let{surface:n,noteId:r,onClick:l}=t,{iString:d,iTemplate:k}=(0,c.GO)(),Y=(0,u.Jd)(),v=!!(Y&&e&&Y.id!==e.id),C=x(),w=_(null==e?void 0:e.id),I=(0,h.d)(),U=async()=>{if(e){try{await (0,s.x6)("/api/v1/blocks/".concat(e.id),{method:"POST",json:{type:"mute",surface:n,noteId:r}})}catch(e){I.popToast(()=>(0,i.Y)(h.y,{text:(0,f.uX)(e)}));return}C.refetch(),I.popToast(()=>(0,i.Y)(h.y,{text:k(y(),e.name||"User"),Icon:o.A})),null==l||l("mute")}},E=async()=>{if(e){try{await (0,s.x6)("/api/v1/blocks/".concat(e.id),{method:"DELETE",query:{surface:n,noteId:r}})}catch(e){I.popToast(()=>(0,i.Y)(h.y,{text:(0,f.uX)(e)}));return}C.refetch(),I.popToast(()=>(0,i.Y)(h.y,{text:k(m(),e.name||"User"),Icon:o.A})),null==l||l("unmute")}},B=async()=>{if(e){try{await (0,s.x6)("/api/v1/blocks/".concat(e.id),{method:"POST",json:{type:"block",surface:n,noteId:r}})}catch(e){I.popToast(()=>(0,i.Y)(h.y,{text:(0,f.uX)(e)}));return}C.refetch(),I.popToast(()=>(0,i.Y)(h.y,{text:k(g(),e.name||"User"),Icon:a.A})),null==l||l("block")}},D=async()=>{if(e){try{await (0,s.x6)("/api/v1/blocks/".concat(e.id),{method:"DELETE",query:{surface:n,noteId:r}})}catch(e){I.popToast(()=>(0,i.Y)(h.y,{text:(0,f.uX)(e)}));return}C.refetch(),I.popToast(()=>(0,i.Y)(h.y,{text:k(b(),e.name||"User"),Icon:a.A})),null==l||l("unblock")}},T=[];return v&&("blocking"!==w&&T.push((0,i.Y)(p.Dr,{leading:(0,i.Y)(o.A,{}),priority:"destructive",onClick:"muting"===w?E:U,children:d("muting"===w?"Unmute":"Mute")})),T.push((0,i.Y)(p.Dr,{leading:(0,i.Y)(a.A,{}),priority:"destructive",onClick:"blocking"===w?D:B,children:d("blocking"===w?"Unblock":"Block")}))),T}Y.displayName="UserBlockContext";let I=(0,l.createContext)(!1);function U(e){let{muteFree:t=!0,children:n}=e;return(0,i.Y)(I.Provider,{value:t,children:n})}function E(){return(0,l.useContext)(I)}I.displayName="MuteFreeZone"},66511:function(e,t,n){n.d(t,{k6:()=>s,fN:()=>u,m_:()=>p,Sr:()=>d,hW:()=>f});var r=n(4006),i=n(38146),o=n(17402),a=n(49978),l=n(3011),c=n(53168);let u=500,s=8,d=320,f=48981==n.j?{size:16,color:"var(--color-utility-white)"}:null;function p(e){let{children:t,text:n,title:f,imageUrl:p,leading:h,trailing:y,side:m,disabled:g,delayEnter:b=u}=e,[k,Y]=(0,o.useState)(!1),v=(0,l.a)()?o.Fragment:l.B;return g?(0,r.Y)(r.FK,{children:t}):(0,r.Y)(v,{children:(0,r.FD)(i.bL,{delayDuration:b,open:k,onOpenChange:Y,children:[(0,r.Y)(i.l9,{asChild:!0,children:(0,r.Y)("span",{children:t})}),(0,r.Y)(i.ZL,{children:(0,r.Y)(i.UC,{side:m,sideOffset:s,collisionPadding:s,className:"content-t9D9VH",style:{maxWidth:d,zIndex:c.QW,"--offset":"".concat(s,"px")},children:(0,r.Y)(a.c,{text:n,title:f,imageUrl:p,leading:h,trailing:y})})})]})})}},49978:function(e,t,n){n.d(t,{c:()=>h});var r=n(4006),i=n(17402),o=n(23623),a=n(78649),l=n(33764),c=n(89490),u=n(76977),s=n(63136),d=n(66511),f=n(53168);let p={title:"title-V6r8cy",imageContainer:"imageContainer-UzIosZ",endcapContainer:"endcapContainer-E0pGpX"};function h(e){let{leading:t,trailing:n,text:c,title:u,imageUrl:d,children:f}=e,h=c&&!u&&!d;return(0,r.Y)(o.a,{children:(0,r.Y)(a.Q,{children:(0,r.Y)(k,{children:(0,r.FD)(y,{textOnly:!!h,children:[d&&(0,r.Y)(b,{children:(0,r.Y)(l.o,{src:d,maxWidth:296,useRetinaSizing:!0,imageIsFixedWidth:!0})}),(0,r.FD)(g,{hasTitle:!!u,children:[t&&(0,r.Y)(m,{children:t}),(0,r.FD)(Y,{children:[u&&(0,r.Y)(s.EY.B4,{weight:"medium",color:"primary",className:p.title,children:u}),(0,r.Y)(s.EY.B4,{color:"primary",opacity:80,lineHeight:16,children:"string"==typeof c?c.split("\n").map((e,t)=>(0,r.FD)(i.Fragment,{children:[t>0&&(0,r.Y)("br",{}),e]},t)):c}),f]}),n&&(0,r.Y)(m,{children:n})]})]})})})})}function y(e){let{textOnly:t,children:n}=e;return(0,r.Y)(u.VP,{alignItems:"center",paddingY:t?6:12,paddingX:t?8:12,gap:8,children:n})}function m(e){let{children:t}=e;return(0,r.Y)(u.fI,{alignItems:"center",justifyContent:"center",className:p.endcapContainer,flex:"auto",gap:8,children:t})}function g(e){let{hasTitle:t,children:n}=e;return(0,r.Y)(u.fI,{alignItems:t?"start":"center",gap:8,children:n})}function b(e){let{children:t}=e;return(0,r.Y)(u.VP,{border:"detail",radius:"sm",className:p.imageContainer,overflow:"hidden",children:t})}function k(e){let{children:t}=e;return(0,r.Y)(c.az,{className:p.content,style:{maxWidth:d.Sr,zIndex:f.QW,"--offset":"".concat(d.k6,"px")},radius:"sm",shadow:"md",border:"detail",bg:"primary",children:t})}let Y=(0,c.I4)({display:"flex",direction:"column",gap:2})},3011:function(e,t,n){n.d(t,{B:()=>u,a:()=>c});var r=n(4006),i=n(38146),o=n(17402),a=n(66511);let l=(0,o.createContext)(!1);function c(){return(0,o.useContext)(l)}function u(e){let{children:t}=e;return(0,r.Y)(i.Kq,{delayDuration:a.fN,skipDelayDuration:300,children:(0,r.Y)(l.Provider,{value:!0,children:t})})}},94874:function(e,t,n){n.d(t,{F:()=>m,z:()=>g});var r=n(69277),i=n(70408),o=n(4006),a=n(46271),l=n(94729),c=n(56804),u=n(12501),s=n(36372),d=n(70486),f=n(46453),p=n(29611),h=n(15567),y=n(28700);function m(e){let{source:t}=e,n=g({source:t}),u=(0,p.v)(),d=(0,s.d)(),m=(0,a.Jd)(),{onboardingModal:b,requireLogin:k}=(0,f.eE)(),Y=async e=>{var t;if(!m)return k?k():b?b.open():u(Error("Onboarding modal not found"),"Could not start conversation."),!1;let r=await n.handleStart(e);return r instanceof Error?(r instanceof l.fk&&(null==(t=r.body)?void 0:t.type)==="profile_not_set_up"?d.popToast(()=>(0,o.Y)(s.y,{text:"Please set up your profile before sending a message.",cta:"Set up profile",href:(0,y.W$)({utm_source:"substack",utm_campaign:"chat_dm_button",redirect:window.location}),localNavigation:!1})):u(r,"Could not start conversation."),!1):((0,c.z)((0,h.tv)(r.thread.id)),!0)};return(0,i._)((0,r._)({},n),{handleStart:Y})}function g(e){let{source:t}=e,n=(0,d.wA)(),o=(0,u.st)({pathname:"/api/v1/messages/dm/start",method:"POST"}),a=async e=>{let r=await o.refetch({json:{user_ids:e,source:t}});return r instanceof Error||n({type:"conversation-load_more",payload:{edge:"before",cursor:null,page:r}}),r};return(0,i._)((0,r._)({},o),{handleStart:a})}},11510:function(e,t,n){n.d(t,{Iu:()=>a,fz:()=>l});var r=n(17402),i=n(17988);n(68349);var o=n(98949);function a(){let e=(0,i.useMediaQuery)({maxWidth:650}),[t,n]=(0,r.useState)(!1);return(0,r.useLayoutEffect)(()=>{n((0,o.Fr)())},[]),t||e}function l(){return(0,i.useMediaQuery)({minWidth:1280})}}}]);