"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["3862"],{64473:function(e,t,n){n.d(t,{Z:()=>i});let i={iframe:"iframe-_GPXZ7",codeInput:"codeInput-elXe0s"}},8108:function(e,t,n){n.d(t,{Z:()=>i});let i={dropdownMenu:"dropdownMenu-ASlbF5",textInput:"textInput-kYr7wC"}},68139:function(e,t,n){n.d(t,{Z:()=>i});let i={wrapper:"wrapper-vT80lr"}},85131:function(e,t,n){n.d(t,{Z:()=>i});let i={gifPreview:"gifPreview-aspqQH",visible:"visible-LWauZo",image:"image-Aqe6vn",videoPlayerWrapper:"videoPlayerWrapper-cIRA2m",videoPlayerClassName:"videoPlayerClassName-wHpwKj",videoClassName:"videoClassName-F40TTj"}},68857:function(e,t,n){n.d(t,{Z:()=>i});let i={scrollBox:"scrollBox-zHkQVP",arrowButtonContainer:"arrowButtonContainer-O4uSiH",visible:"visible-JMTC0j",right:"right-i3oWGi",left:"left-Tg8vqp",arrowButtonOffsetContainer:"arrowButtonOffsetContainer-VMYLE4",arrowButtonOverlaidContainer:"arrowButtonOverlaidContainer-t10AyH",overlay:"overlay-zrMCxn",primary:"primary-lv_sOW",secondary:"secondary-pOosZC",arrowButtonOverlaid:"arrowButtonOverlaid-xLyA_z"}},61649:function(e,t,n){n.d(t,{AO:()=>_,AT:()=>C,BY:()=>T,MZ:()=>S,Sr:()=>I,Zl:()=>b,ar:()=>w,eD:()=>Z,l7:()=>B,ss:()=>k});var i=n(7409),r=n(16584),o=n(6400),l=n(30396),a=n(74691),s=n.n(a),c=n(7654),d=n.n(c),u=n(14293),h=n.n(u),v=n(5463),p=n(32224),f=n(36671),m=n(68833),y=n(15771),g=n(19081);let C=5,w=300,Z=600,b=60,k=30,_=e=>{let t=s()(e,1,16),n=Z-b;return s()(Z-(t-1)/15*n,b,Z)},S=e=>{for(let t=16;t>=1;t--)if(_(t)>=2*e)return s()(t,1,16);return 1},x=(0,o.createContext)({clipTimes:null,isClipping:!1,setClipEnd:()=>void 0,setClipStart:()=>void 0,setClipTitle:()=>void 0,virtualizedListRef:{current:null},onCancelClipping:()=>void 0,onStartClipping:()=>void 0,clipTitle:null,zoom:0,setZoom:()=>void 0}),T=e=>{let{children:t,postId:n,videoPlayerRef:o,virtualizedListRef:a}=e,[c,u]=(0,l.eJ)(!1),[v,p]=(0,l.eJ)(),[f,y]=(0,l.eJ)(),[g,Z]=(0,l.eJ)(null),[b,_]=(0,l.eJ)(1),T=(0,l.sO)(!1),I=(0,l.Ye)(()=>h()(v)||h()(f)?null:{start:v,end:f},[f,v]);(0,l.d4)(()=>{T.current||void 0==v||void 0==f||(_(S(f-v)),T.current=!0)},[v,f]);let B=(0,l.I4)(e=>{var t,r,l,a,c,v,f,g,b;let{start:_,end:S,source:x,title:T}=e,I=null!==(f=null==o?void 0:null===(r=o.current)||void 0===r?void 0:null===(t=r.player)||void 0===t?void 0:t.duration)&&void 0!==f?f:300;d()(I)&&(I=300);let B=h()(_)||h()(S)?null:{start:_,end:Math.min(S,_+w)},H=null!=B?B:{start:Math.max(0,null!==(g=null==o?void 0:null===(a=o.current)||void 0===a?void 0:null===(l=a.player)||void 0===l?void 0:l.currentTime)&&void 0!==g?g:0),end:Math.min(null!=I?I:C,(null!==(b=null==o?void 0:null===(v=o.current)||void 0===v?void 0:null===(c=v.player)||void 0===c?void 0:c.currentTime)&&void 0!==b?b:0)+k)};if(B?H.end=Math.max(H.start+C,H.end):(H.start=s()(H.start,0,I-C),H.end=s()(H.end,H.start+C,Math.min(H.start+w,I))),p(H.start),y(H.end),u(!0),T&&Z(T),(0,m.j)(m.FP.VIDEO_CLIP_INITIATED,(0,i._)({post_id:n,source:x},B)),!B&&!(null==o?void 0:o.current)){let e=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;setTimeout(()=>{var n,i;(null==o?void 0:null===(i=o.current)||void 0===i?void 0:null===(n=i.player)||void 0===n?void 0:n.readyState)!==4?t<10&&e(t+1):(p(0),y(Math.min(o.current.player.duration,k)))},100)};e()}},[n,o]),H=(0,l.I4)(e=>{var t,n,i;let r=null!==(i=null==o?void 0:null===(n=o.current)||void 0===n?void 0:null===(t=n.player)||void 0===t?void 0:t.duration)&&void 0!==i?i:0,l=s()(e,C,r);y(l),p(e=>s()(null!=e?e:0,Math.max(l-w,0),l-C))},[o]),M=(0,l.I4)(e=>{var t,n,i;let r=null!==(i=null==o?void 0:null===(n=o.current)||void 0===n?void 0:null===(t=n.player)||void 0===t?void 0:t.duration)&&void 0!==i?i:0,l=s()(e,0,r-C);p(l),y(e=>s()(null!=e?e:0,l+C,Math.min(l+w,r)))},[o]),O=(0,l.I4)(()=>{u(!1)},[]);return(0,r.tZ)(x.Provider,{value:{clipTimes:I,isClipping:c,setClipEnd:H,setClipStart:M,setClipTitle:Z,virtualizedListRef:a,onCancelClipping:O,onStartClipping:B,clipTitle:g,zoom:b,setZoom:_},children:t})},I=()=>(0,l.qp)(x),B=()=>{let{zoom:e,setZoom:t}=I();return(0,r.BX)(g.gq,{gap:12,justifyContent:"center",alignItems:"center",children:[(0,r.tZ)(y.hU,{priority:"secondary-outline",size:"sm",onClick:()=>t(Math.max(1,e-1)),children:(0,r.tZ)(v.Z,{size:20})}),(0,r.tZ)(f.Z,{min:1,max:16,step:1,value:e,onChange:t}),(0,r.tZ)(y.hU,{priority:"secondary-outline",size:"sm",onClick:()=>t(Math.min(16,e+1)),children:(0,r.tZ)(p.Z,{size:20})})]})}},59154:function(e,t,n){n.d(t,{Z:()=>s});var i=n(7409),r=n(99282),o=n(98848),l=n(16584),a=n(64515);let s=e=>{var{size:t=24,fill:n="var(--color-fg-primary)"}=e,s=(0,o._)(e,["size","fill"]);return(0,l.tZ)(a.l,(0,r._)((0,i._)({},s),{name:"BlueskyIcon",svgParams:{viewBox:"0 0 600 600"},width:t,height:t,fill:n,stroke:"none",children:(0,l.tZ)("path",{stroke:"none",d:"m135.72 44.03c66.496 49.921 138.02 151.14 164.28 205.46 26.262-54.316 97.782-155.54 164.28-205.46 47.98-36.021 125.72-63.892 125.72 24.795 0 17.712-10.155 148.79-16.111 170.07-20.703 73.984-96.144 92.854-163.25 81.433 117.3 19.964 147.14 86.092 82.697 152.22-122.39 125.59-175.91-31.511-189.63-71.766-2.514-7.3797-3.6904-10.832-3.7077-7.8964-0.0174-2.9357-1.1937 0.51669-3.7077 7.8964-13.714 40.255-67.233 197.36-189.63 71.766-64.444-66.128-34.605-132.26 82.697-152.22-67.108 11.421-142.55-7.4491-163.25-81.433-5.9562-21.282-16.111-152.36-16.111-170.07 0-88.687 77.742-60.816 125.72-24.795z"})}))}},79138:function(e,t,n){n.d(t,{Z:()=>s});var i=n(7409),r=n(99282),o=n(98848),l=n(16584),a=n(64515);let s=e=>{var{size:t=24,fill:n="var(--color-fg-primary)"}=e,s=(0,o._)(e,["size","fill"]);return(0,l.tZ)(a.l,(0,r._)((0,i._)({},s),{name:"FacebookIcon",svgParams:{viewBox:"0 0 20 20"},width:t,height:t,fill:n,stroke:"none",children:(0,l.tZ)("path",{stroke:"none",d:"M20 10C20 4.47715 15.5229 0 10 0C4.47715 0 0 4.47715 0 10C0 14.9912 3.65684 19.1283 8.4375 19.8785V12.8906H5.89844V10H8.4375V7.79688C8.4375 5.29063 9.93047 3.90625 12.2146 3.90625C13.3084 3.90625 14.4531 4.10156 14.4531 4.10156V6.5625H13.1922C11.95 6.5625 11.5625 7.3334 11.5625 8.125V10H14.3359L13.8926 12.8906H11.5625V19.8785C16.3432 19.1283 20 14.9912 20 10Z"})}))}},37632:function(e,t,n){n.d(t,{Z:()=>s});var i=n(7409),r=n(99282),o=n(98848),l=n(16584),a=n(64515);let s=e=>{var{size:t=24,fill:n="var(--color-fg-primary)"}=e,s=(0,o._)(e,["size","fill"]);return(0,l.tZ)(a.l,(0,r._)((0,i._)({},s),{name:"LinkedInIcon",svgParams:{viewBox:"0 0 20 20"},width:t,height:t,fill:n,stroke:"none",children:(0,l.tZ)("path",{stroke:"none",d:"M18.5195 0H1.47656C0.660156 0 0 0.644531 0 1.44141V18.5547C0 19.3516 0.660156 20 1.47656 20H18.5195C19.3359 20 20 19.3516 20 18.5586V1.44141C20 0.644531 19.3359 0 18.5195 0ZM5.93359 17.043H2.96484V7.49609H5.93359V17.043ZM4.44922 6.19531C3.49609 6.19531 2.72656 5.42578 2.72656 4.47656C2.72656 3.52734 3.49609 2.75781 4.44922 2.75781C5.39844 2.75781 6.16797 3.52734 6.16797 4.47656C6.16797 5.42188 5.39844 6.19531 4.44922 6.19531ZM17.043 17.043H14.0781V12.4023C14.0781 11.2969 14.0586 9.87109 12.5352 9.87109C10.9922 9.87109 10.7578 11.0781 10.7578 12.3242V17.043H7.79688V7.49609H10.6406V8.80078H10.6797C11.0742 8.05078 12.043 7.25781 13.4844 7.25781C16.4883 7.25781 17.043 9.23438 17.043 11.8047V17.043Z"})}))}},4473:function(e,t,n){n.d(t,{Z:()=>s});var i=n(7409),r=n(99282),o=n(98848),l=n(16584),a=n(64515);let s=e=>{var{size:t=24,fill:n="var(--color-fg-primary)"}=e,s=(0,o._)(e,["size","fill"]);return(0,l.BX)(a.l,(0,r._)((0,i._)({},s),{name:"SubstackIcon",svgParams:{viewBox:"0 0 20 20"},width:t,height:t,fill:n,stroke:"none",children:[(0,l.tZ)("path",{d:"M1.96484 0.624512H18.0354V2.70052H1.96484V0.624512Z",stroke:"none"}),(0,l.tZ)("path",{d:"M1.96484 4.77655H18.0354V6.85254H1.96484V4.77655Z",stroke:"none"}),(0,l.tZ)("path",{d:"M1.96484 8.92857V19.9505L10.0001 14.6347L18.0354 19.9505V8.92857H1.96484Z",stroke:"none"})]}))}},91379:function(e,t,n){n.d(t,{c:()=>Z});var i=n(16584),r=n(30396),o=n(71375),l=n(80569),a=n.n(l),s=n(80878),c=n(15771),d=n(19081),u=n(4615),h=n(58175),v=n(70379),p=n(60308),f=n(84864),m=n(47929),y=n(33803),g=n(4291),C=n(68139);let w=(e,t,n,r,o)=>{if(!t)return null;switch(e){case"post-login":if(!t.profile_set_up_at)return null;return{title:"Your profile is set up!",body:"Now you can like posts, leave comments, and follow other people on Substack.",ctaText:"View your profile",ctaLink:(0,p.NNq)(t,{utm_source:m.b3.profileToast,noBase:n})};case"post-subscribe-success":if(!r||!t.profile_set_up_at)return null;return{title:"Welcome to ".concat(r?r.name:""),body:(0,i.BX)(h.xv,{children:["You'll now receive new posts in your inbox. Next, check out the"," ",(0,i.tZ)(h.hh,{decoration:"underline",target:"_blank",href:r?(0,p.sai)(r):void 0,children:"archive"})," ","or visit your profile."]}),ctaText:"View your profile",ctaLink:(0,p.NNq)(t,{utm_source:m.b3.profileToast,noBase:n})};case"start-writing":return{title:"Want to start writing on Substack?",body:"Congrats on subscribing to your ".concat((0,f.numberToOrdinal)(o)," Substack! Start your own just 5 minutes"),ctaText:"Start writing",ctaLink:(0,p._HV)({utm_source:m.b3.profileToast})};default:return null}};function Z(e){let{user:t,pub:n=null,noBase:l=!1}=e,p=(0,v.pm)();return(0,r.d4)(()=>{async function e(){await a().put("/api/v1/user-setting").send({type:"has_seen_reader_to_writer_upsell",value_bool:!0})}let r=new URL(location.toString()),v=r.searchParams.get("profile-setup-message");if(!v)return;let f="start-writing"===v?Number(r.searchParams.get("nthPub")):void 0;r.searchParams.delete("nthPub"),r.searchParams.delete("profile-setup-message"),history.replaceState({},"",r);let m=w(v,t,l,n,f);m&&("start-writing"===v&&e(),p.popToast(e=>{let{onClose:t}=e;return(0,i.tZ)(u.f6,{theme:n?g.Z.pubTheme:y.Z.elevatedTheme,children:(0,i.BX)(d.tu,{gap:20,bg:"primary",radius:"md",shadow:"lg",border:"detail",sizing:"border-box",position:"relative",padding:20,className:C.Z.wrapper,children:[(0,i.BX)(d.gq,{flex:"grow",justifyContent:"space-between",alignItems:"start",children:[(0,i.BX)(d.tu,{gap:8,children:[(0,i.tZ)(h.xv.H3,{weight:"heavy",flex:"grow",color:"primary",children:m.title}),(0,i.tZ)(h.xv.B3,{color:"secondary",children:m.body})]}),(0,i.tZ)(c.hU,{priority:"tertiary",onClick:t,children:(0,i.tZ)(o.Z,{size:20})})]}),(0,i.tZ)(c.zx,{priority:"primary",onClick:e=>{(0,s.Q)(e,m.ctaLink,{native:!0}),t()},children:m.ctaText})]})})},{ttl:null}))},[]),null}},93029:function(e,t,n){n.d(t,{Z:()=>d});var i=n(16584),r=n(30396),o=n(94184),l=n.n(o),a=n(74571),s=n(60308),c=n(85131);let d=e=>{let{post:t,containerRef:n,aspectRatio:o,size:d="small",alwaysShow:u=!1,className:h}=e,[v]=(0,a.i5)(n),[p,f]=(0,r.eJ)(!1),m=(0,s.W$Z)({post:t,height:"large"===d?480:320});return m&&(v||u)?(0,i.tZ)("div",{className:l()(c.Z.gifPreview,{[c.Z.visible]:p},h),children:(0,i.tZ)("img",{className:c.Z.image,src:m,style:"aspect-ratio: ".concat(o),onLoad:()=>f(!0)})}):null}},17352:function(e,t,n){n.d(t,{Z:()=>Z});var i=n(7409),r=n(99282),o=n(98848),l=n(16584),a=n(92027),s=n(98661),c=n(20160),d=n(71068),u=n(15771),h=n(19081),v=n(1844),p=n(68709),f=n(98248),m=n(63474),y=n(58175),g=n(87077),C=n(52434);let w=()=>(0,l.tZ)(h.sg,{flex:"grow",justifyContent:"center",alignItems:"center",children:(0,l.tZ)(f.$j,{})}),Z=e=>{var t,n,{children:a,gap:u=8,direction:h="column",radius:v="md",outline:p="detail",bg:f="primary",elevated:y=!0,loading:g,href:C,onClick:Z}=e,b=(0,o._)(e,["children","gap","direction","radius","outline","bg","elevated","loading","href","onClick"]);let k=C||Z,_=y?c.W:s.Fragment,S=k?m.A0:s.Fragment;return(0,l.tZ)(_,{children:(0,l.tZ)(S,{href:C,onClick:Z,children:(0,l.tZ)(d.xu,(0,r._)((0,i._)({display:"flex",sizing:"border-box",direction:h,bg:f,outline:p,radius:v,gap:u,shadow:null!==(t=b.shadow)&&void 0!==t?t:y?"xs":void 0,pressable:null!==(n=b.pressable)&&void 0!==n?n:k?"lg":void 0},b),{children:g?(0,l.tZ)(w,{}):a}))})})};Z.Title=e=>{let{children:t}=e;return(0,l.tZ)(p.__,{children:t})},Z.Header=e=>{let{children:t}=e;return(0,l.tZ)(h.X2,{justifyContent:"space-between",gap:12,paddingTop:20,paddingX:20,children:t})},Z.Body=e=>{var{children:t}=e,n=(0,o._)(e,["children"]);return(0,l.tZ)(h.sg,(0,r._)((0,i._)({paddingX:20},n),{children:t}))},Z.Footer=e=>{let{children:t}=e;return(0,l.tZ)(h.sg,{paddingBottom:20,paddingX:20,children:t})},Z.Description=e=>{let{children:t}=e;return(0,l.tZ)(v.p6,{children:t})},Z.Loading=w,Z.Value=e=>{let{children:t}=e;return(0,l.tZ)(y.xv.H2,{className:C.Z.value,children:t})},Z.Tooltip=e=>{let{title:t,text:n,disabled:i}=e;return(0,l.tZ)(g.u,{title:t,text:n,disabled:i,hoverOptions:{delayEnter:250},children:(0,l.tZ)(h.M5,{width:20,height:20,children:(0,l.tZ)(u.hU,{priority:"quaternary",size:"xs",children:(0,l.tZ)(a.Z,{size:16,stroke:"var(--color-fg-secondary)"})})})})}},20730:function(e,t,n){n.d(t,{A:()=>d});var i=n(16584),r=n(94184),o=n.n(r),l=n(98661),a=n(80026),s=n(63474);let c={chip:"chip-lJKwY5",textOnly:"textOnly-SPwDNp",leading:"leading-TvXpau",trailing:"trailing-lhDVKn",clickable:"clickable-IxUlBk",fillIcon:"fillIcon-jYnt2U"},d=(0,l.forwardRef)((e,t)=>{let{children:n,trailing:r,leading:l,href:d,onClick:u,fillIcon:h}=e,v=d||u,p=!l&&!r;return(0,i.BX)(a.kG,{resetCss:!0,ref:t,className:o()(c.chip,h&&c.fillIcon,v&&c.clickable,p&&c.textOnly),href:d,onClick:u,pressable:v?"sm":void 0,children:[l&&(0,i.tZ)(s.M5,{className:c.leading,children:l}),(0,i.tZ)(a.xv.B4,{color:"primary",children:n}),r&&(0,i.tZ)(s.M5,{className:c.trailing,children:r})]})})},92039:function(e,t,n){n.d(t,{m:()=>f,rG:()=>p,rw:()=>v});var i=n(27412),r=n(7409),o=n(99282),l=n(16584),a=n(98661),s=n(30396),c=n(48980),d=n(12120);class u{async connect(){try{if(!this.host)throw Error("Attempted to connect without a token");this.ws=new WebSocket(this.host),this.ws.addEventListener("open",()=>{for(let[e,t]of this.channels)t.size>0&&this.send({action:"subscribe",channel:e})}),this.ws.addEventListener("error",e=>{console.error(e),"closed"!==this.connectivityState&&(this.error=Error("Generic error"),this.handleError())}),this.ws.addEventListener("close",e=>{"closed"!==this.connectivityState&&(this.error={code:e.code,reason:e.reason,wasClean:e.wasClean},this.handleError())}),this.ws.addEventListener("message",e=>{"open"!==this.connectivityState&&(this.connectivityState="open",clearTimeout(this.timeoutId),this.reconnectInterval=900,this.notifyConnectivityChange());let t=JSON.parse(e.data),n=(0,o._)((0,r._)({},t),{data:t.data?(0,o._)((0,r._)({},t.data),{message:"string"==typeof t.data.message?JSON.parse(t.data.message):null}):null});if(n.data){var i;for(let e of null!==(i=this.channels.get(n.data.channel))&&void 0!==i?i:[])e(n)}}),clearTimeout(this.timeoutId);let e=this.ws;this.timeoutId=setTimeout(()=>{"connecting"===this.connectivityState&&(this.error=Error("Timeout"),e.close(),this.handleError())},3e4)}catch(e){this.error=e instanceof Error?e:Error(String(e)),this.handleError()}}async refreshToken(){let e;this.channels.size>0&&(e=Array.from(this.channels.keys()).join(","));let t=await (0,c.rd)("/api/v1/realtime/token",{query:{channels:e}});return this.token=t.token,this.expiry=t.expiry,this.host=t.endpoint,this.ws||this.connect(),t}send(e){let{ws:t}=this;if(!t)throw Error("Cannot send without a connection.");t.send(JSON.stringify((0,r._)({token:this.token},e)))}publish(e,t){this.send({action:"publish",channel:e,message:JSON.stringify(t)})}listen(e){let t=[],n=new Set(this.channels.keys());return this.subscriptionQueue=this.subscriptionQueue.then(async()=>{for(let[n,i]of Object.entries(e)){let e=this.channels.get(n);e||(e=new Set,this.channels.set(n,e)),e.add(i),t.push(()=>{var e;let t=this.channels.get(n);null==t||t.delete(i),(null==t?void 0:t.size)===0&&(null===(e=this.ws)||void 0===e?void 0:e.readyState)===WebSocket.OPEN&&(this.send({action:"unsubscribe",channel:n}),this.channels.delete(n))})}let i=(0,d.e5)(new Set(this.channels.keys()),n);if(i.size>0){var r;if(await this.refreshToken(),(null===(r=this.ws)||void 0===r?void 0:r.readyState)===WebSocket.OPEN)for(let e of i)this.send({action:"subscribe",channel:e})}}),()=>{let e=new Set(this.channels.keys());for(let e of t)e();(0,d.e5)(e,new Set(this.channels.keys())).size>0&&this.refreshToken()}}onConnectivityChange(e){return this.connectivityHandlers.add(e),()=>{this.connectivityHandlers.delete(e)}}destroy(){var e;this.channels.clear(),this.connectivityHandlers.clear(),this.connectivityState="closed",null===(e=this.ws)||void 0===e||e.close(),clearTimeout(this.reconnectTimeoutId),clearTimeout(this.timeoutId)}notifyConnectivityChange(){for(let e of this.connectivityHandlers)e(this.connectivityState)}handleError(){console.warn("ZyncSocket: Connection closed"),clearTimeout(this.timeoutId),"closed"!==this.connectivityState&&(this.connectivityState="closed",this.notifyConnectivityChange()),0===this.reconnectTimeoutId&&(console.warn("ZyncSocket: Attempting to reconnect..."),this.reconnectTimeoutId=setTimeout(()=>{this.reconnectTimeoutId=0,this.reconnectInterval=Math.min(2*this.reconnectInterval,6e4),this.connect()},this.reconnectInterval+.2*this.reconnectInterval))}constructor(){(0,i._)(this,"token",void 0),(0,i._)(this,"expiry",void 0),(0,i._)(this,"host",void 0),(0,i._)(this,"ws",void 0),(0,i._)(this,"connectivityState","closed"),(0,i._)(this,"error",void 0),(0,i._)(this,"reconnectInterval",900),(0,i._)(this,"reconnectTimeoutId",0),(0,i._)(this,"channels",new Map),(0,i._)(this,"connectivityHandlers",new Set),(0,i._)(this,"timeoutId",0),(0,i._)(this,"subscriptionQueue",Promise.resolve())}}let h=(0,a.createContext)(null);function v(e){let{children:t}=e,[n,i]=(0,s.eJ)(null);return(0,s.d4)(()=>{null==n||n.destroy();let e=new u;return i(e),()=>{e.destroy()}},[]),(0,l.tZ)(h.Provider,{value:n,children:t})}function p(){return(0,s.qp)(h)}function f(){var e;let t=p(),[n,i]=(0,s.eJ)(null!==(e=null==t?void 0:t.connectivityState)&&void 0!==e?e:"closed");return(0,s.d4)(()=>null==t?void 0:t.onConnectivityChange(i),[t]),n}},97434:function(e,t,n){n.d(t,{B:()=>v,c:()=>h});var i=n(7409),r=n(99282),o=n(98848),l=n(16584),a=n(6400),s=n(30396),c=n(6490),d=n(74312);let u=(0,a.createContext)({open:()=>void 0});function h(e){var t;let{children:n}=e,[o,a]=(0,s.eJ)(null),c=(0,s.Ye)(()=>({open:e=>a(e)}),[]);return(0,l.BX)(u.Provider,{value:c,children:[n,(0,l.tZ)(p,(0,r._)((0,i._)({},o),{source:null!==(t=null==o?void 0:o.source)&&void 0!==t?t:"substack",isOpen:!!o,onClose:()=>a(null)}))]})}function v(){return(0,s.qp)(u)}function p(e){var{isOpen:t,onClose:a}=e,s=(0,o._)(e,["isOpen","onClose"]);return(0,l.tZ)(c.u_,{isOpen:t,onClose:a,children:(0,l.tZ)(d.cr,(0,r._)((0,i._)({},s),{module:"@/frontend/reader2/chat/DmShareModal",onRequest:()=>n.e("2667").then(n.bind(n,84422)),resolve:e=>e.DmComposerModal,onClose:a}))})}},78446:function(e,t,n){n.d(t,{N4:()=>a,sm:()=>s});var i=n(16584),r=n(30396),o=n(15771),l=n(15562);function a(){let[e,t]=(0,r.eJ)(null);return{confirm:()=>new Promise((n,i)=>{e&&i(Error("Already confirming.")),t({resolve:n,reject:i})}),isConfirming:!!e,handleConfirm:n=>{t(null),null==e||e.resolve(n)},handleCancel:n=>{t(null),null==e||e.resolve(n)}}}function s(e){let{title:t,body:n,cancelLabel:r="Cancel",confirmLabel:a="Confirm",modal:s}=e;return(0,i.tZ)(l.W,{isOpen:s.isConfirming,onClose:()=>s.handleCancel(!1),title:t,description:n,primaryButton:(0,i.tZ)(o.zx,{priority:"destructive",onClick:()=>s.handleConfirm(!0),children:a}),secondaryButton:(0,i.tZ)(o.zx,{priority:"secondary",onClick:()=>s.handleCancel(!1),children:r})})}},84923:function(e,t,n){n.d(t,{d:()=>r});var i=n(30396);function r(){let[e,t]=(0,i.eJ)(!1);return{isOpen:e,onOpen:()=>t(!0),onClose:()=>t(!1)}}},12120:function(e,t,n){function i(e,t){let n=new Set(e);return n.add(t),n}function r(e,t){let n=new Set(e);return n.delete(t),n}function o(e,t){return new Set([...e].filter(e=>!t.has(e)))}n.d(t,{e5:()=>o,oR:()=>i,zu:()=>r})}}]);