!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@538433c"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4e228975-983d-426f-8d62-3bcef619fbff",e._sentryDebugIdIdentifier="sentry-dbid-4e228975-983d-426f-8d62-3bcef619fbff")}catch(e){}}();"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["95852"],{3223:function(e,t,n){n.d(t,{A:()=>i});let i={mention:"mention-pnpTE1",mentionStatic:"mentionStatic-liMklk"}},65259:function(){},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"}},66874:function(e,t,n){n.d(t,{A:()=>i});let i={dismissButton:"dismissButton-R_gyXq"}},22857:function(e,t,n){n.d(t,{q:()=>r});var i=n(4006),a=n(10996);let r=e=>{let{children:t,disable:n}=e;return n?(0,i.Y)(i.FK,{children:t}):(0,i.Y)(a.NP,{theme:"light-theme",children:t})}},80520:function(e,t,n){n.d(t,{N:()=>y});var i=n(4006),a=n(46110),r=n(17402),o=n(22857),l=n(84605),s=n(27749),c=n(2675),d=n(75840),u=n(35369),h=n(76977),p=n(28911),g=n(63136),m=n(504),f=n(44307);function y(e){let{item:t,pub:n,post:o}=e,[s,c]=(0,r.useState)(!1),{iString:d}=(0,l.GO)();return(0,i.FD)(i.FK,{children:[(0,i.Y)(u.K0,{priority:"quaternary",size:"sm",className:f.A.moreButton,onClick:()=>c(!0),children:(0,i.Y)(a.A,{size:16})}),(0,i.FD)(p.aF,{isOpen:s,onClose:()=>c(!1),width:440,children:[(0,i.Y)(p.rQ,{icon:(0,i.Y)(a.A,{size:20}),title:d("Auto-generated clip"),onClose:()=>c(!1)}),(0,i.Y)(p.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)(p.jl,{primaryButton:(0,i.Y)(Y,{item:t,pub:n,post:o,onClose:()=>c(!1)}),secondaryButton:(0,i.Y)(u.$n,{priority:"secondary",onClick:()=>c(!1),children:d("Done")})})]})]})}let Y=e=>{let{item:t,pub:n,post:a,onClose:h}=e,{iString:p}=(0,l.GO)(),g=(0,c.vZ)({post:a,publication:n}),f=(0,s.PK)(),y=(0,r.useContext)(d.P);return(0,i.Y)(o.q,{children:(0,i.Y)(u.$n,{priority:"primary",onClick:e=>{(0,m.Qb)(t,f,"watch_full_episode",{tabId:y}),g(e),h()},children:p("View Full Episode")})})}},75051:function(e,t,n){n.d(t,{Y:()=>E});var i=n(69277),a=n(70408),r=n(4006),o=n(32485),l=n.n(o),s=n(45773),c=n(78834),d=n(70511),u=n(17402),h=n(78649),p=n(33764),g=n(93355),m=n(86500),f=n(12501),y=n(17028),Y=n(62870),b=n(93812),v=n(92563),w=n(29682),C=n(39318),S=n(49807),k=n(98949);let _={header:"header-LkrdOr",footer:"footer-EnTWMp",swatchContainer:"swatchContainer-aa9QGg",checkIconContainer:"checkIconContainer-OhnBup"};function A(e){var t,n,i,a,o,l;let{comment:s,imageShareAsset:c,aspectRatio:d}=e,{width:u,height:h}=(0,v.S8)(d),{img:p,imgDownload:f,shareData:y,useNativeShare:b}=(0,g.Y)({shareTitle:"A note from ".concat(s.name),shareText:s.body,shareUrl:(0,S.M$q)("c-".concat(s.id)),imageUrl:null!=(t=null==c?void 0:c.composed_url)?t:"",imageDownloadUrl:null!=(o=null!=(a=(0,C.tbS)({noteId:"c-".concat(s.id),variant:null!=(n=null==c?void 0:c.variant)?n:"orange",type:"composed",aspectRatio:null!=(i=null==c?void 0:c.aspectRatio)?i:"stories"}))?a:null==c?void 0:c.composed_url)?o:"",imageUrlSameOrigin:null!=(l=null==c?void 0:c.composed_url)?l:""});async function w(){if((0,m.u4)(m.qY.NOTE_IMAGE_ASSET_DOWNLOADED,{comment_id:s.id,aspect_ratio:null==c?void 0:c.aspectRatio,source:"note-image-asset",interaction:"click"}),y)try{await navigator.share(y)}catch(e){}}return(0,r.Y)(Y.Cs,{onClick:w,href:b?void 0:f,children:(0,r.FD)(Y.OK,{size:h,aspectRatio:u/h,children:[!(0,k.Fr)()&&p&&(0,r.Y)(Y.lh,{onClick:w,width:u}),(0,r.Y)(Y.BB,{img:p})]})})}function E(e){var t,n,i;let{comment:a}=e,[o,l]=(0,u.useState)("stories"),[s,c]=(0,u.useState)("orange"),d=((e,t)=>{let{result:n,error:i}=(0,f.st)({pathname:"/api/v1/note/assets/c-".concat(e.id),query:{aspectRatio:t},deps:[e.id,t],auto:!0});return(0,u.useMemo)(()=>i?[]:n,[n,i])})(a,o),p=null==d?void 0:d.find(e=>e.aspectRatio===o&&e.variant===s),g=null!=(i=null==(n=a.attachments)||null==(t=n.find(e=>"image"===e.type))?void 0:t.imageUrl)?i:a.photo_url;return(0,r.Y)(h.Q,{children:(0,r.FD)(x,{children:[(0,r.Y)(y.az,{className:_.header,children:(0,r.Y)(F,{aspectRatio:o,setAspectRatio:l})}),(0,r.Y)(y.Ye,{justifyContent:"center",padding:12,children:(0,r.Y)(A,{aspectRatio:o,comment:a,imageShareAsset:p})}),(0,r.Y)(I,{selectedVariant:s,setSelectedVariant:c,photoUrl:g})]})})}function I(e){let{selectedVariant:t,setSelectedVariant:n,photoUrl:i}=e;return(0,r.Y)(y.fI,{gap:8,justifyContent:"center",children:w.ix.map(e=>(0,r.Y)(U,{variant:e,setSelectedVariant:n,isSelected:t===e,photoUrl:i},e))})}function U(e){let{variant:t,setSelectedVariant:n,isSelected:o,photoUrl:c}=e,d=(0,b.kE)({variant:t,width:32,height:32,backgroundImageSrc:c});return(0,r.FD)(y.az,{width:32,height:32,radius:"sm",cursor:"pointer",overflow:"hidden",sizing:"border-box",position:"relative",onClick:function(){n(t)},className:l()(_.swatchContainer,o&&_.selected),children:[(0,r.Y)(y.az,{className:_.checkIconContainer,children:o&&(0,r.Y)(s.A,{size:24})}),"css"===d.type?(0,r.Y)(y.az,{height:32,width:32,sizing:"border-box",style:d.style}):(0,r.Y)(p.o,{src:d.src,maxWidth:32,imageProps:(0,a._)((0,i._)({},d.imgProps),{height:32})})]})}let x=(0,y.I4)({display:"flex",direction:"column",alignItems:"center",overflow:"hidden",paddingBottom:20});function F(e){let{aspectRatio:t,setAspectRatio:n}=e;return(0,r.Y)(y.fI,{gap:8,borderBottom:"detail",padding:16,justifyContent:"center",children:w.yo.map(e=>(0,r.Y)(y.$n,{size:"sm",priority:t===e?"primary-mono":"secondary",onClick:()=>n(e),leading:"grid"===e?(0,r.Y)(c.A,{size:20}):(0,r.Y)(d.A,{size:20}),children:"grid"===e?"Grid":"Stories"},e))})}},93355:function(e,t,n){n.d(t,{Y:()=>l});var i=n(17402),a=n(95641),r=n(68349),o=n(98949);function l(e){let[t,n]=(0,i.useState)(""),[l,s]=(0,i.useState)(""),[c,d]=(0,i.useState)({}),[u,h]=(0,i.useState)(!1);(0,i.useEffect)(()=>{(0,o.Fr)()&&navigator.share&&navigator.canShare(c)&&h(!0)},[c]),(0,i.useEffect)(()=>{!async function(){n("");let t=e.imageUrl;if((0,r.NN)(e.imageUrl,()=>{n(t),s(e.imageDownloadUrl)}),(0,o.Fr)()){var i,a;let n=await fetch(e.imageUrlSameOrigin||t),r=["instagram","instagram-stories"].includes(null!=(i=e.shareApp)?i:"");d({title:r?void 0:e.shareTitle,text:r?void 0:null!=(a=e.shareText)?a:void 0,files:[new File([await n.blob()],"image.png",{type:"image/png"})],url:r?void 0:e.shareUrl})}}()},[e.imageDownloadUrl,e.imageUrl,e.shareApp,e.shareText,e.shareTitle,e.shareUrl]);let{refetch:p}=(0,a.E)({method:"post",pathname:"/api/v1/press_kit/notification",body:{title:e.shareText,imageUrl:e.imageUrl,shareApp:e.shareApp},deps:[e.shareText,e.imageUrl,e.shareApp]});return{img:t,imgDownload:l,sendPushNotification:(0,i.useCallback)(async()=>{let e=await p();return!(e instanceof Error)&&e.success},[p]),shareData:c,useNativeShare:u}}},95641:function(e,t,n){n.d(t,{E:()=>s});var i=n(69277),a=n(32641),r=n(15734),o=n.n(r),l=n(12501);function s(e){var{auto:t,initialResult:n,deps:r}=e,s=(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:c,method:d="get"}=(0,i._)({},s,n),u=o()(d.toUpperCase(),r);l&&u.query(l),c&&u.send(c),t.addEventListener("abort",()=>{u.abort()});let h=await u;if(t.aborted)return;let p=h.error;if(p)throw p;return h.body},r||[],{auto:t,initialResult:n})}},38093:function(e,t,n){n.d(t,{Q:()=>Y,Z:()=>y});var i=n(69277),a=n(4006),r=n(32485),o=n.n(r),l=n(42216),s=n(17402),c=n(84605),d=n(94729),u=n(89490),h=n(8149),p=n(76977),g=n(20500),m=n(63136),f=n(24311);function y(e){let{email:t,redirect:n,forPub:r,islandMagicSignin:o,onIsAttemptingLoginChange:c}=e,[u,p]=(0,s.useState)(""),[g,m]=(0,s.useState)(!1),[f,y]=(0,s.useState)(!1),[Y,S]=(0,s.useState)(!1),k=async()=>{m(!0),c&&c(!0);try{let[e]=await Promise.all([(0,d.x6)("/api/v1/email-otp-login/complete",{method:"POST",json:{code:u,email:t,redirect:n,for_pub:r,island_magic_signin:o}}),new Promise(e=>setTimeout(e,250))]);window.location.href=e.redirect}catch(e){e instanceof d.fk&&"login_guard_challenge"===e.body.type&&S(!0),m(!1),c&&c(!1),y(!0),p("")}};return t?(0,a.FD)(w,{children:[(0,a.Y)(l.wE,{autoFocus:!0,maxLength:6,pattern:l.UO,onChange:e=>{p(e),e.length&&y(!1)},onComplete:k,value:u,render:e=>{let{slots:t}=e;return(0,a.Y)(C,{children:t.map((e,t)=>(0,a.Y)(b,(0,i._)({disabled:g},e),t))})}}),(0,a.Y)(h.N,{open:!!f,children:(0,a.Y)(v,{suspiciousLogin:Y})})]}):null}function Y(e){let{onComplete:t,error:n,isLoading:r}=e,[o,d]=(0,s.useState)(""),{iString:u}=(0,c.GO)();return(0,a.FD)(w,{children:[(0,a.Y)(l.wE,{autoFocus:!0,maxLength:6,pattern:l.UO,onChange:e=>{d(e)},onComplete:e=>{r||t(e)},value:o,disabled:r,render:e=>{let{slots:t}=e;return(0,a.Y)(C,{children:t.map((e,t)=>(0,a.Y)(b,(0,i._)({disabled:r},e),t))})}}),n&&(0,a.Y)(g.yn,{style:{textAlign:"center"},children:u("You entered an incorrect code. Please try again.")})]})}function b(e){let{char:t,isActive:n,disabled:i}=e;return(0,a.Y)(p.fI,{justifyContent:"center",alignItems:"center",width:36,height:40,className:o()(f.A.input,n&&f.A.focus,i&&f.A.disabled),children:(0,a.Y)(m.EY.B2,{textAlign:"center",children:t||""})})}function v(e){let{suspiciousLogin:t}=e,{iString:n}=(0,c.GO)(),i=n(t?"Please check your email for instructions to complete signing in.":"You entered an incorrect code. Please try again.");return(0,a.Y)(g.yn,{style:{textAlign:"center"},children:i})}let w=(0,u.I4)({display:"flex",direction:"column",alignItems:"center",gap:8}),C=(0,u.I4)({display:"flex",direction:"row",justifyContent:"center",alignItems:"center",gap:8})}}]);