!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@c1df24e"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ea17e531-4156-43ea-b85d-c807247aa4bf",e._sentryDebugIdIdentifier="sentry-dbid-ea17e531-4156-43ea-b85d-c807247aa4bf")}catch(e){}}();"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["60113"],{38476:function(e,t,n){n.d(t,{A:()=>r});let r={shimmer:"shimmer-DF054A",shimmerAnimation:"shimmerAnimation-dmgPXN",transition:"transition-Na2iYv",from:"from-LIO3hL",to:"to-rGgfVf",icon:"icon-kVFYHC",errorIcon:"errorIcon-yltUsD",toastContainer:"toastContainer-s9kdmI"}},72285:function(e,t,n){n.d(t,{A:()=>r});let r={avatarButton:"avatarButton-lZBlGB",dropdownBadge:"dropdownBadge-CARUw5"}},52673:function(e,t,n){n.d(t,{A:()=>r});let r={chevron:"chevron-_e2GYQ"}},19611:function(e,t,n){n.d(t,{A:()=>r});let r={signInAppUpsell:"signInAppUpsell-v2qe5g",isDesktop:"isDesktop-gGuBzo",appDownloadButton:"appDownloadButton-l8ORmM",qrContainer:"qrContainer-I8AYt6",qrCode:"qrCode-xsX_9k"}},6986:function(e,t,n){n.d(t,{A:()=>r});let r={badge:"badge-jGMz0j",dot:"dot-dFwIaI",singleElement:"singleElement-ve4D6v",fillIcon:"fillIcon-hub55b",empty:"empty-w6FjPW",shape_circle:"shape_circle-Q9w9_R",shapeCircle:"shape_circle-Q9w9_R",shape_square:"shape_square-O2PxpD",shapeSquare:"shape_square-O2PxpD","placement_top-left":"placement_top-left-dsosXN",placementTopLeft:"placement_top-left-dsosXN","placement_top-right":"placement_top-right-CTrC80",placementTopRight:"placement_top-right-CTrC80","placement_bottom-left":"placement_bottom-left-JFLMtf",placementBottomLeft:"placement_bottom-left-JFLMtf","placement_bottom-right":"placement_bottom-right-hoG7Xz",placementBottomRight:"placement_bottom-right-hoG7Xz"}},60938:function(e,t,n){n.d(t,{A:()=>r});let r={tab:"tab-eCtYfd"}},90017:function(e,t,n){n.d(t,{A:()=>r});let r={root:"root-IyF5Yz",list:"list-UVnyqE",highlight:"highlight-rZ7aQJ"}},96670:function(e,t,n){n.d(t,{A:()=>r});let r={mobileContainer:"mobileContainer-VYHM_K",imageContainer:"imageContainer-Xqytjt",hRule:"hRule-h3Z3UF",assetButtons:"assetButtons-qLcYTo",aspectRatioButton:"aspectRatioButton-x1zjUA",aspectRatioSelected:"aspectRatioSelected-FTsOFP",aspectRatioSelectedIcon:"aspectRatioSelectedIcon-VNG8Se"}},57423:function(e,t,n){n.d(t,{A:()=>r});let r={avatarLink:"avatarLink-M6ZJnW",inlineComposer:"inlineComposer-v8PLSi",disabled:"disabled-YAsoUi",mobileInlineComposer:"mobileInlineComposer-jKgh_1",isDragging:"isDragging-TcoucF",floatingComposer:"floatingComposer-np5rUF",inputSpacer:"inputSpacer-x19EDg",wordCountIndicator:"wordCountIndicator-KkYqEv",exceded:"exceded-x1z6ce",composerModal:"composerModal-q2ZgZt",setupProfileModalContent:"setupProfileModalContent-IhiQBI",dropdownIcon:"dropdownIcon-HzL2Jt",dropdownMenu:"dropdownMenu-RAjGgB",pubRow:"pubRow-ZqkbZG",pubName:"pubName-DndaDy",linkImage:"linkImage-VNRJEM"}},95755:function(e,t,n){n.d(t,{A:()=>r});let r={modalBody:"modalBody-yrSvJm",captcha:"captcha-awCBm5"}},74055:function(e,t,n){n.d(t,{A:()=>r});let r={streamList:"streamList-OmTUej"}},11934:function(e,t,n){n.d(t,{q:()=>h});var r=n(4006),i=n(32485),o=n.n(i),a=n(48309),l=n(17402),s=n(84605),c=n(57820),d=n(98949);let u="fullSize-W6Pwju",p="image-ZSouY2",h=e=>{let{img:t,imgDownload:n,shareData:i,useNativeShare:h,onClick:m}=e,{iString:g}=(0,s.GO)(),f=(0,l.useRef)(null),C=(0,l.useRef)(null),[_,v]=(0,l.useState)(!1),[Y,y]=(0,l.useState)({right:0,bottom:0});(0,l.useEffect)(()=>{var e,t;let n=null==(e=f.current)?void 0:e.getBoundingClientRect(),r=null==(t=C.current)?void 0:t.getBoundingClientRect();n&&r&&y({right:r.right-n.right,bottom:r.bottom-n.bottom})},[f,C,t]);let S=(0,l.useCallback)(async e=>{if(null==m||m(),h&&i)try{await navigator.share(i)}catch(e){}else{var t;let n=null==(t=f.current)?void 0:t.getBoundingClientRect();if(n){let t=e.clientX,r=e.clientY;(tn.right||rn.bottom)&&e.preventDefault()}}},[m,h,i]);return(0,r.Y)("a",{onClick:S,href:h?void 0:n,download:!0,className:o()("link-HgTAJz",_&&"linkHovered-rnE2Gn",u),target:"_blank",children:(0,r.FD)("div",{ref:C,className:o()("root-gpHBEU",u),children:[!(0,d.Fr)()&&t&&(0,r.Y)("div",{className:"download-aYXb5J",style:Y,children:(0,r.Y)(a.A,{size:24})}),!t&&(0,r.Y)("div",{className:o()(p,"imageLoading-BULJ5E"),children:(0,r.Y)(c.y$,{"aria-label":g("Loading")})}),t&&(0,r.Y)("img",{ref:f,src:t,alt:g("Download Image"),className:o()(u,p),onMouseEnter:()=>{v(!0)},onMouseLeave:()=>{v(!1)}})]})})}},76199:function(e,t,n){n.d(t,{ZD:()=>b,lY:()=>D});var r=n(4006),i=n(35426),o=n(32485),a=n.n(o),l=n(45773),s=n(48697),c=n(94796),d=n(17402),u=n(89333),p=n(33764),h=n(84605),m=n(86500),g=n(74049),f=n(35369),C=n(76977),_=n(63136),v=n(2481),Y=n(39318),y=n(53168),S=n(38476);let w=()=>(0,r.Y)(C.Ye,{radius:"full",className:S.A.shimmer,style:{height:"var(--size-6)",width:"100%"}}),E=(0,d.createContext)({addMediaUpload:e=>{let{}=e;throw Error("Adding a download requires a DownloadProvider.")},markAsDownloaded:()=>{throw Error("Marking as downloaded requires a DownloadProvider.")},hasBeenDownloaded:()=>{throw Error("Checking download status requires a DownloadProvider.")}}),A=e=>{var t;let{context:n,download:{mediaUpload:i,title:o,thumbnailUrl:y,source:E},pub:A,onRemoveItem:b}=e,{markAsDownloaded:R,hasBeenDownloaded:I}=D(),{iString:k}=(0,h.GO)(),{mediaUpload:O,downloadUrl:T}=(0,u.Dw)(i.id),N=(0,v.NP)(),P=(null==O?void 0:O.state)==="error",x="downloads";(0,d.useEffect)(()=>{T&&O&&!I(i.id)&&((0,g.P)(O,o),R(i.id),(0,m.u4)(m.qY.MEDIA_CLIP_DOWNLOAD_COMPLETED,{video_upload_id:i.id,is_post_editor:!1,type:E,surface:x}))},[i.id,T,O,I,R,E,o]);let F=(0,d.useCallback)(e=>{e.preventDefault(),(0,m.u4)(m.qY.MEDIA_CLIP_BUTTON_CLICKED,{button:"share_to_notes",source:"download_toast",surface:x});let t="publisher"===n?"".concat(k("Subscribe to get the full video when it's released."),"\n"):"";N.open({initialText:"".concat(t),videoUploadId:i.id,onCompose:e=>{(0,m.u4)(m.qY.MEDIA_CLIP_SHARED,{destination:"notes",note_id:e.id,video_upload_id:i.id,is_post_editor:"publisher"===n,surface:x})}})},[N,n,k,i.id,A]);return(0,r.FD)(C.Ye,{gap:16,children:[(0,r.Y)("div",{children:(0,r.FD)(C.Ye,{position:"relative",children:[(0,r.Y)(p.o,{src:null!=(t=null!=y?y:(0,Y.Pzx)(i))?t:"",maxWidth:40,radius:"xs",imageProps:{height:Math.round(40),smartCrop:!0}}),T&&(0,r.Y)(C.pT,{bg:"white",radius:"full",width:20,height:20,position:"absolute",alignItems:"center",justifyContent:"center",className:S.A.icon,children:(0,r.Y)(l.A,{stroke:"black",strokeWidth:2,size:14})}),P&&(0,r.Y)(C.pT,{radius:"full",width:20,height:20,position:"absolute",alignItems:"center",justifyContent:"center",className:a()(S.A.icon,S.A.errorIcon),children:(0,r.Y)(s.A,{stroke:"white",strokeWidth:2,size:14})})]})}),(0,r.FD)(C.I1,{gap:8,children:[(0,r.FD)(C.Ye,{gap:12,children:[(0,r.FD)(C.Ye,{style:{width:"250px"},alignItems:"center",gap:8,children:[(0,r.FD)(C.I1,{flex:"grow",children:[(0,r.Y)(_.EY.B4,{color:"white",weight:"semibold",style:{overflowWrap:"anywhere"},children:o}),T?(0,r.Y)(_.EY.B4,{color:"white",children:k("Complete")}):(0,r.FD)(_.EY.B4,{color:"white",children:[k("Downloading clip"),"…"]}),P&&(0,r.Y)(_.EY.B4,{color:"error",weight:"semibold",style:{overflowWrap:"anywhere"},children:k("Download failed")})]}),T&&(0,r.Y)(f.$n,{leading:(0,r.Y)(c.A,{size:16}),priority:"primary",size:"sm",onClick:F,children:k("Share")})]}),(0,r.Y)(C.Ye,{cursor:"pointer",onClick:e=>{e.stopPropagation(),b()},children:(0,r.Y)(s.A,{stroke:"gray"})})]}),T||P?null:(0,r.Y)(w,{})]})]})};function b(e){let{children:t,pub:n,context:o}=e,[a,l]=(0,d.useState)([]),[s,c]=(0,d.useState)(new Set);return(0,r.FD)(E.Provider,{value:{addMediaUpload:e=>{l(t=>[...t,e])},markAsDownloaded:e=>{c(t=>{let n=new Set(t);return n.add(e),n})},hasBeenDownloaded:e=>s.has(e)},children:[t,!!a.length&&(0,r.Y)("div",{className:S.A.toastContainer,style:{zIndex:y.GJ},children:(0,r.Y)(i.e,{show:!0,appear:!0,enter:S.A.transition,enterFrom:S.A.from,enterTo:S.A.to,leave:S.A.transition,leaveFrom:S.A.to,leaveTo:S.A.from,children:(0,r.Y)(C.I1,{style:{backgroundColor:"#232525"},radius:"md",padding:16,gap:8,children:a.map((e,t)=>(0,r.Y)(A,{context:o,download:e,pub:n,onRemoveItem:()=>l(a.filter(t=>{let{mediaUpload:n}=t;return n.id!==e.mediaUpload.id}))},"".concat(t,"_").concat(e.mediaUpload.id)))})})})]})}function D(){return(0,d.useContext)(E)}},31452:function(e,t,n){n.d(t,{N:()=>a});var r=n(99851),i=n(69277),o=n(41873);class a extends o.A{trackMedia(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={content_type:"livestream",entity_type:"livestream",primary_entity_type:"livestream",entity_key:String(this.props.liveStreamId),primary_entity_key:String(this.props.liveStreamId)};super.trackMedia(e,(0,i._)({},t,n))}constructor(...e){super(...e),(0,r._)(this,"_skipJoin",!1),(0,r._)(this,"getBaseVideoSrc",e=>{let t="/api/v1/live_stream/".concat(this.props.liveStreamId),n=new URLSearchParams;return e&&n.append("type",e),n.append("src","true"),(this.props.noJoin||this._skipJoin)&&n.append("noJoin","true"),this._skipJoin=!0,this.props.portrait&&n.append("portrait","true"),"".concat(t,"?").concat(n.toString())}),(0,r._)(this,"onPreviewClick",e=>{var t;!this.props.isReplay&&this.player&&this.player.duration&&this.player.duration>1&&!isNaN(this.player.duration)&&(null==(t=this.player)?void 0:t.paused)&&(this.player.currentTime=this.player.duration-1),this.player&&this.player.paused&&(this.player.playbackRate=1),super.onPreviewClick(e)}),(0,r._)(this,"refreshVideoSrc",()=>{n.e("9234").then(n.bind(n,40137)).then(e=>{if(this._initHlsjsWrapped(e.default),this.setState({autoPlay:!1,previewHidden:!0,failedAutoplay:!1}),this.player){let e=()=>{if(this.player){var e;this.player.muted=null!=(e=this.props.startMuted)&&e,this.player.play().catch(()=>{this.player&&(this.player.muted=!0,this.player.play().catch(()=>{}))})}};if(this.player.readyState>=3)e();else{let t=()=>{var n;null==(n=this.player)||n.removeEventListener("canplay",t),e()};this.player.addEventListener("canplay",t)}}})})}}o.A},21481:function(e,t,n){n.d(t,{Q:()=>f});var r=n(79785),i=n(4006),o=n(11934),a=n(1250),l=n(84605),s=n(93355),c=n(86500),d=n(3843),u=n(39318);function p(){let e=(0,r._)([""," has reached $10,000 in annual revenue"]);return p=function(){return e},e}function h(){let e=(0,r._)([""," has reached $1,000 in annual revenue"]);return h=function(){return e},e}function m(){let e=(0,r._)([""," has reached 100 subscribers"]);return m=function(){return e},e}function g(){let e=(0,r._)([""," has reached 1,000 subscribers"]);return g=function(){return e},e}n(6966);let f=e=>{let t,{pub:n,style:r,milestone:f}=e,{iString:C,iTemplate:_}=(0,l.GO)(),v=(0,a.OA)();switch(f){case d.Fh.ARR10K:t=_(p(),n.name);break;case d.Fh.ARR1K:t=_(h(),n.name);break;case d.ai.List100:t=_(m(),n.name);break;case d.ai.List1K:t=_(g(),n.name)}let{img:Y,imgDownload:y,shareData:S,useNativeShare:w}=(0,s.Y)({shareTitle:C("Share this milestone"),shareText:t,shareUrl:(0,u.$_T)(n),imageDownloadUrl:(0,u.ed9)(n,f,r,"".concat(f).concat(r.aspectRatio?" - ".concat(r.aspectRatio):"")),imageUrl:(0,u.ed9)(n,f,r,void 0),imageUrlSameOrigin:(0,u.T86)(n,f,r,{useRootDomain:null==v?void 0:v.isSubstack})});return(0,i.Y)(o.q,{img:Y,imgDownload:y,shareData:S,useNativeShare:w,onClick:()=>{(0,c.u4)(c.qY.MILESTONE_MEDIA_ASSETS_IMAGE_DOWNLOADED,{milestone:f,aspectRatio:r.aspectRatio,source:"image"})}})}},43110:function(e,t,n){n.d(t,{L:()=>u});var r=n(4006),i=n(75107),o=n(17402),a=n(8853),l=n(89490),s=n(8149),c=n(76977),d=n(45859);function u(e){var t;let{item:n,depth:p=0}=e,[h,m]=(0,o.useState)(!1);if(!n.subItems||0===n.subItems.length)return null;let g=p>0?(0,r.Y)(l.az,{style:{width:12*p,flexShrink:0}}):null;return(0,r.FD)(c.VP,{children:[(0,r.Y)(d.Dr,{onClick:e=>{e.preventDefault(),e.stopPropagation(),m(!h)},leading:g,trailing:(0,r.Y)(i.A,{size:16,style:{transform:h?"rotate(0deg)":"rotate(-90deg)",transition:"transform 0.2s ease"}}),children:n.label}),(0,r.Y)(s.N,{open:h,children:(0,r.Y)(c.VP,{gap:2,children:null==(t=n.subItems)?void 0:t.map(e=>{var t;if(e.subItems&&e.subItems.length>0)return(0,r.Y)(u,{item:e,depth:p+1},e.label);let n=e.logoUrl,i=(0,r.Y)(l.az,{style:{width:(p+1)*12,flexShrink:0}});return(0,r.Y)(d.Dr,{href:e.href,native:e.isNative,rel:e.noFollow?"nofollow":void 0,onClick:e.onClick,leading:n?(0,r.FD)(r.FK,{children:[i,(0,r.Y)(a.c,{height:24,radius:"xs",src:n,width:24})]}):i,children:e.label},null!=(t=e.slug)?t:e.label)})})})]})}},58475:function(e,t,n){n.d(t,{G:()=>a,Z:()=>l});var r=n(4006),i=n(17402);let o=(0,i.createContext)(null);function a(e){let{root:t,children:n}=e,a=(0,i.useRef)(t);return(0,r.FD)(o.Provider,{value:a,children:[n,!t&&(0,r.Y)("div",{ref:a})]})}function l(e){let{children:t}=e,n=(0,i.useContext)(o).current;return n?(0,i.createPortal)(t,n):null}},69141:function(e,t,n){n.d(t,{i:()=>d});var r=n(4006),i=n(11934),o=n(1250),a=n(84605),l=n(93355),s=n(86500),c=n(39318);n(34422);let d=e=>{let{pub:t,style:n}=e,{iString:d}=(0,a.GO)(),u=(0,o.OA)(),{img:p,imgDownload:h,shareData:m,useNativeShare:g}=(0,l.Y)({shareTitle:d("Share this publication"),shareText:t.hero_text,shareUrl:(0,c.$_T)(t),imageDownloadUrl:(0,c.gEL)(t,null,n,{fileToDownload:"Message".concat(n.aspectRatio?" - ".concat(n.aspectRatio):"")}),imageUrl:(0,c.gEL)(t,null,n),imageUrlSameOrigin:(0,c.Nlh)(t,n,{useRootDomain:null==u?void 0:u.isSubstack})});return(0,r.Y)(i.q,{img:p,imgDownload:h,shareData:m,useNativeShare:g,onClick:()=>{(0,s.u4)(s.qY.PUBLICATION_MEDIA_ASSETS_IMAGE_DOWNLOADED,{aspectRatio:n.aspectRatio,source:"image"})}})}},77578:function(e,t,n){n.d(t,{C1:()=>h,Hg:()=>m,cK:()=>g,jK:()=>f});var r=n(4006),i=n(32485),o=n.n(i),a=n(45773),l=n(78834),s=n(70511),c=n(84605),d=n(35369),u=n(98949),p=n(19667);let h=["stories","instagram","square"],m=e=>{let{isSelected:t,value:n,onClick:i,coverImageUrl:l,themeVariables:s}=e,c=s.web_bg_color||s.cover_bg_color,u=s.print_on_web_bg_color||s.cover_print_primary||"#1a1a1a";return"accent"===n?(c=s.background_pop_color||s.background_pop,u=s.print_on_pop):"image"===n?(u="#ffffff",c="rgba(0,0,0,0.5)"):"black&white"===n&&(u="#404040",c="#ffffff"),(0,r.FD)(d.Nm,{width:28,height:28,style:{backgroundColor:c},flex:"auto",radius:"sm",overflow:"hidden",alignItems:"center",justifyContent:"center",sizing:"border-box",className:o()(p.A.customizeAssetButton,p.A.themeButton,t&&p.A.selected,"image"===n&&p.A.image),onClick:e=>{e.preventDefault(),i()},tabIndex:0,children:["image"===n&&(0,r.Y)("div",{className:p.A.imageBg,style:{backgroundImage:"url(".concat(l,")")}}),(0,r.Y)("div",{className:o()(p.A.inner,"image"===n&&p.A.image),children:t&&(0,r.Y)(a.A,{stroke:u,size:16,strokeWidth:2.5})})]})},g=e=>{let{isSelected:t,value:n,onClick:i}=e,o=function(e){let{iString:t}=(0,c.GO)(),n=(0,u.Fr)({checkFirst4:!0}),r={instagram:t("Instagram"),square:t("Square"),stories:t("Vertical")};return(n?{square:"1:1",instagram:"4:5",stories:"9:16"}:r)[e]}(n);return(0,r.Y)(d.$n,{size:"sm",priority:t?"primary-mono":"secondary",onClick:i,leading:"square"===n?(0,r.Y)(l.A,{size:20}):(0,r.Y)(s.A,{size:20}),children:o})},f=e=>{let{isSelected:t,label:n,onClick:i}=e;return(0,r.Y)(d.$n,{size:"sm",priority:t?"primary-mono":"secondary",onClick:i,children:n})}},2886:function(e,t,n){n.d(t,{b7:()=>u,zL:()=>d});var r=n(4006),i=n(11934),o=n(1250),a=n(84605),l=n(93355),s=n(86500),c=n(39318);n(25593);let d=e=>{let{pub:t,user:n,note:d,style:u}=e,{iString:p}=(0,a.GO)(),h=(0,o.OA)(),{img:m,imgDownload:g,shareData:f,useNativeShare:C}=(0,l.Y)({shareTitle:p("Share this message"),shareText:(null==d?void 0:d.note)||"",shareUrl:(0,c.$_T)(t),imageDownloadUrl:(0,c.pJR)(t,n,u,{fileToDownload:"Message".concat(u.aspectRatio?" - ".concat(u.aspectRatio):"")}),imageUrl:(0,c.pJR)(t,n,u),imageUrlSameOrigin:(0,c._cT)(t,n,u,{useRootDomain:null==h?void 0:h.isSubstack})});return(0,r.Y)(i.q,{img:m,imgDownload:g,shareData:f,useNativeShare:C,onClick:()=>{(0,s.u4)(s.qY.SUBSCRIPTION_NOTE_MEDIA_ASSETS_IMAGE_DOWNLOADED,{note_from_user_id:n.id,aspectRatio:u.aspectRatio,source:"image"})}})},u=e=>{let{pub:t,user:n,note:d,style:u}=e,{iString:p}=(0,a.GO)(),h=(0,o.OA)(),{img:m,imgDownload:g,shareData:f,useNativeShare:C}=(0,l.Y)({shareTitle:p("Share this message"),shareText:(null==d?void 0:d.note)||"",shareUrl:(0,c.$_T)(t),imageDownloadUrl:(0,c.H_d)(t,n,u,{fileToDownload:"Message".concat(u.aspectRatio?" - ".concat(u.aspectRatio):"")}),imageUrl:(0,c.H_d)(t,n,u),imageUrlSameOrigin:(0,c.qw6)(t,n,u,{useRootDomain:null==h?void 0:h.isSubstack})});return(0,r.Y)(i.q,{img:m,imgDownload:g,shareData:f,useNativeShare:C,onClick:()=>{(0,s.u4)(s.qY.PLEDGE_NOTE_MEDIA_ASSETS_IMAGE_DOWNLOADED,{note_from_user_id:n.id,aspectRatio:u.aspectRatio,source:"image"})}})}},51487:function(e,t,n){n.d(t,{A:()=>s});var r=n(69277),i=n(70408),o=n(32641),a=n(4006),l=n(97731);let s=e=>{var{color:t="white"}=e,n=(0,o._)(e,["color"]);return(0,a.Y)(l.A,(0,i._)((0,r._)({},n),{name:"ActivityIconLiveStream",svgParams:{height:24,width:24,fill:t,stroke:"none"},children:(0,a.Y)("path",{d:"M2.09033 11.7192C2.09033 10.479 2.31006 9.30713 2.74951 8.20361C3.18896 7.09521 3.81396 6.11865 4.62451 5.27393C4.77588 5.10791 4.94678 5.02734 5.13721 5.03223C5.33252 5.03711 5.49365 5.11035 5.62061 5.25195C5.74756 5.38867 5.80127 5.5498 5.78174 5.73535C5.76221 5.91602 5.6792 6.08447 5.53271 6.24072C4.84912 6.9585 4.32422 7.78857 3.95801 8.73096C3.59668 9.66846 3.41602 10.6646 3.41602 11.7192C3.41602 12.7739 3.59668 13.7725 3.95801 14.7148C4.32422 15.6523 4.84912 16.4824 5.53271 17.2051C5.6792 17.3564 5.76221 17.5225 5.78174 17.7031C5.80127 17.8887 5.74756 18.0474 5.62061 18.1792C5.49365 18.3257 5.33252 18.3989 5.13721 18.3989C4.94678 18.4038 4.77588 18.3257 4.62451 18.1646C3.81396 17.3198 3.18896 16.3433 2.74951 15.2349C2.31006 14.1265 2.09033 12.9546 2.09033 11.7192ZM4.79297 11.7192C4.79297 10.8403 4.94434 10.0005 5.24707 9.19971C5.5498 8.39893 5.98438 7.69092 6.55078 7.07568C6.70215 6.90967 6.87793 6.82422 7.07812 6.81934C7.27832 6.81445 7.44434 6.89014 7.57617 7.04639C7.70312 7.19287 7.75439 7.354 7.72998 7.52979C7.71045 7.70557 7.625 7.87402 7.47363 8.03516C7.03418 8.5332 6.69727 9.09717 6.46289 9.72705C6.22852 10.3521 6.11133 11.0161 6.11133 11.7192C6.11133 12.4224 6.22852 13.0889 6.46289 13.7188C6.69727 14.3438 7.03418 14.9053 7.47363 15.4033C7.625 15.5645 7.71045 15.7329 7.72998 15.9087C7.75439 16.0845 7.70312 16.2456 7.57617 16.3921C7.44434 16.5483 7.27832 16.624 7.07812 16.6191C6.87793 16.6143 6.70215 16.5264 6.55078 16.3555C5.98438 15.7402 5.5498 15.0347 5.24707 14.2388C4.94434 13.438 4.79297 12.5981 4.79297 11.7192ZM7.48828 11.7192C7.48828 11.2212 7.56885 10.7427 7.72998 10.2837C7.89111 9.81982 8.12061 9.39746 8.41846 9.0166C8.56006 8.83594 8.7334 8.74316 8.93848 8.73828C9.14844 8.72852 9.32178 8.8042 9.4585 8.96533C9.59033 9.10205 9.6416 9.25586 9.6123 9.42676C9.58301 9.59277 9.50488 9.76611 9.37793 9.94678C9.19238 10.1909 9.05078 10.4644 8.95312 10.7671C8.86035 11.0649 8.81396 11.3823 8.81396 11.7192C8.81396 12.0562 8.86035 12.376 8.95312 12.6787C9.05078 12.9766 9.19238 13.2451 9.37793 13.4844C9.50488 13.6699 9.58301 13.8481 9.6123 14.019C9.6416 14.1851 9.59033 14.3364 9.4585 14.4731C9.32178 14.6343 9.14844 14.7124 8.93848 14.7075C8.7334 14.6978 8.56006 14.6001 8.41846 14.4146C8.12061 14.0386 7.89111 13.6211 7.72998 13.1621C7.56885 12.6982 7.48828 12.2173 7.48828 11.7192ZM16.5117 11.7192C16.5117 12.2173 16.4312 12.6982 16.27 13.1621C16.1089 13.6211 15.8794 14.0386 15.5815 14.4146C15.4351 14.6001 15.2593 14.6978 15.0542 14.7075C14.8491 14.7124 14.6782 14.6343 14.5415 14.4731C14.4097 14.3364 14.3584 14.1851 14.3877 14.019C14.417 13.8481 14.4951 13.6699 14.6221 13.4844C14.8076 13.2451 14.9468 12.9766 15.0396 12.6787C15.1372 12.376 15.186 12.0562 15.186 11.7192C15.186 11.3823 15.1372 11.0649 15.0396 10.7671C14.9468 10.4644 14.8076 10.1909 14.6221 9.94678C14.4951 9.76611 14.417 9.59277 14.3877 9.42676C14.3584 9.25586 14.4097 9.10205 14.5415 8.96533C14.6782 8.8042 14.8491 8.72852 15.0542 8.73828C15.2593 8.74316 15.4351 8.83594 15.5815 9.0166C15.8794 9.39746 16.1089 9.81982 16.27 10.2837C16.4312 10.7427 16.5117 11.2212 16.5117 11.7192ZM19.207 11.7192C19.207 12.5981 19.0557 13.438 18.7529 14.2388C18.4502 15.0347 18.0156 15.7402 17.4492 16.3555C17.2979 16.5264 17.1221 16.6143 16.9219 16.6191C16.7217 16.624 16.5557 16.5483 16.4238 16.3921C16.2969 16.2456 16.2432 16.0845 16.2627 15.9087C16.2871 15.7329 16.3726 15.5645 16.519 15.4033C16.9634 14.9053 17.3027 14.3438 17.5371 13.7188C17.7715 13.0889 17.8887 12.4224 17.8887 11.7192C17.8887 11.0161 17.7715 10.3521 17.5371 9.72705C17.3027 9.09717 16.9634 8.5332 16.519 8.03516C16.3726 7.87402 16.2871 7.70557 16.2627 7.52979C16.2432 7.354 16.2969 7.19287 16.4238 7.04639C16.5557 6.89014 16.7217 6.81445 16.9219 6.81934C17.1221 6.82422 17.2979 6.90967 17.4492 7.07568C18.0156 7.69092 18.4502 8.39893 18.7529 9.19971C19.0557 10.0005 19.207 10.8403 19.207 11.7192ZM21.9097 11.7192C21.9097 12.9546 21.6875 14.1265 21.2432 15.2349C20.8037 16.3433 20.1787 17.3198 19.3682 18.1646C19.2217 18.3257 19.0508 18.4038 18.8555 18.3989C18.665 18.3989 18.5063 18.3257 18.3794 18.1792C18.2524 18.0474 18.1987 17.8887 18.2183 17.7031C18.2378 17.5225 18.3208 17.3564 18.4673 17.2051C19.1509 16.4824 19.6733 15.6523 20.0347 14.7148C20.4009 13.7725 20.584 12.7739 20.584 11.7192C20.584 10.6646 20.4009 9.66846 20.0347 8.73096C19.6733 7.78857 19.1509 6.9585 18.4673 6.24072C18.3208 6.08447 18.2378 5.91602 18.2183 5.73535C18.1987 5.5498 18.2524 5.38867 18.3794 5.25195C18.5063 5.11035 18.665 5.03711 18.8555 5.03223C19.0508 5.02734 19.2217 5.10791 19.3682 5.27393C20.1787 6.11865 20.8037 7.09521 21.2432 8.20361C21.6875 9.30713 21.9097 10.479 21.9097 11.7192ZM10.5645 11.7339C10.5645 11.4751 10.6304 11.2358 10.7622 11.0161C10.894 10.7964 11.0674 10.6206 11.2822 10.4888C11.502 10.3521 11.7461 10.2837 12.0146 10.2837C12.4053 10.2837 12.7373 10.4253 13.0107 10.7085C13.2891 10.9868 13.4282 11.3237 13.4282 11.7192C13.4282 11.978 13.3623 12.2148 13.2305 12.4297C13.1035 12.6445 12.9326 12.8179 12.7178 12.9497C12.5029 13.0767 12.2686 13.1401 12.0146 13.1401C11.751 13.1401 11.5093 13.0767 11.2896 12.9497C11.0747 12.8179 10.8989 12.647 10.7622 12.437C10.6304 12.2222 10.5645 11.9878 10.5645 11.7339Z"})}))}},40691:function(e,t,n){n.d(t,{Zn:()=>l,hS:()=>s});var r=n(4006),i=n(17402),o=n(16993);let a=(0,i.createContext)({openModal:()=>{},closeModal:()=>{}});function l(e){let{children:t}=e,[n,l]=(0,i.useState)(!1),[s,c]=(0,i.useState)({width:540,children:null}),d=()=>{l(!1)};return(0,r.FD)(a.Provider,{value:{openModal:e=>{c(e),l(!0)},closeModal:d},children:[(0,r.Y)(o.aF,{isOpen:n,onClose:d,width:s.width,children:s?s.children:null}),t]})}function s(){return(0,i.useContext)(a)}a.displayName="ModalContext"},8515:function(e,t,n){n.d(t,{V:()=>l});var r=n(4006),i=n(64997),o=n(76977),a=n(66511);function l(e){let{text:t}=e;return(0,r.Y)(a.m_,{text:t,children:(0,r.Y)(o.ov,{cursor:"pointer",width:16,height:16,children:(0,r.Y)(i.A,{size:14,stroke:"var(--color-fg-secondary)"})})})}},31354:function(e,t,n){n.d(t,{O:()=>l,j:()=>a});var r=n(4006),i=n(17402);let o=(0,i.createContext)({});function a(e){let{entityKey:t,children:n}=e;return(0,r.Y)(o.Provider,{value:{entityKey:t},children:n})}function l(){return(0,i.useContext)(o).entityKey}},78479:function(e,t,n){n.d(t,{DP:()=>T,_3:()=>J,sc:()=>X});var r=n(69277),i=n(70408),o=n(4006),a=n(32485),l=n.n(a),s=n(83673),c=n.n(s),d=n(69308),u=n(87332),p=n(17402),h=n(38305),m=n(96790),g=n(2675),f=n(93341),C=n(39520),_=n(62076),v=n(56804),Y=n(89490),y=n(76977),S=n(63136),w=n(83629),E=n(5126),A=n(95951),b=n(18947),D=n(82776),R=n(26620);let I="quote_preferences",k={name:"DarkMuted",alignment:"left"},O=(0,p.createContext)({preferredTheme:k,setPreferredTheme:()=>{}});function T(e){var t,n,a;let{attachment:l,readOnly:s,onClick:c,onSavePostClick:d,onThemeChange:u,isPermalink:h,isComposing:m,isRestack:g,noRadius:C,lineClamp:_="dynamic",fillHeight:v}=e,{preferredTheme:Y,setPreferredTheme:S}=J(),{postSelection:w,post:A,publication:b,postSelectionTheme:D}=l,[I,O]=(0,p.useState)(null!=D?D:m?Y:k),T=w.text.length<100,x=null!=(t=A.coverImagePalette)?t:null,F=e=>{let{name:t,alignment:n}=e,r={name:null!=t?t:I.name,alignment:null!=n?n:I.alignment};S(r),O(r),null==u||u(r)},B=$(I.name,{size:{width:520},palette:x,coverImage:null!=(n=A.cover_image)?n:void 0}),q=Object.keys(E.D7.image).includes(I.name),U=Object.keys(E.D7.basic).includes(I.name),z="blurredImage"===I.name,H="tintedImageVibrant"===I.name||"tintedImageMuted"===I.name,j=U?"1.0":.6;return(0,o.FD)(y.I1,{gap:4,paddingTop:g?4:void 0,flex:v?"grow":void 0,children:[(0,o.Y)(N,{readOnly:s,onClick:c,publication:b,post:A,postSelection:w,className:U?"":R.A.themed,isRestack:g,noRadius:C,fillHeight:v,children:(0,o.Y)(P,{text:w.text,isShort:T,isImage:q,isBasic:U,publication:b,post:A,onSavePostClick:d,palette:x,alignment:I.alignment,isPermalink:h,isComposing:m,isRestack:g,lineClamp:_,fillHeight:v,children:q?H?(0,o.Y)(L,{style:B||void 0,palette:x,themeName:I.name}):(0,o.Y)(M,{style:B||void 0,className:z?R.A.blurred:void 0}):(0,o.Y)(f.i,{style:(0,i._)((0,r._)({},B),{"--backdrop-opacity":"".concat(j)})})})}),m&&(0,o.Y)(G,{palette:x,onColorSelect:e=>F({name:e}),onAlignmentSelect:e=>F({alignment:e}),selectedColorKey:I.name,coverImage:null!=(a=A.cover_image)?a:void 0,alignment:I.alignment})]})}function N(e){let{readOnly:t,onClick:n,publication:r,post:i,postSelection:a,children:s,className:c,isRestack:d,noRadius:u,fillHeight:p}=e,h=t?void 0:(0,b.wu)(r,i,{feedViewer:!1,urlParams:{selection:a.id}});return(0,o.Y)(y.I1,{className:l()(R.A.container,c),as:t?"div":"a",position:"relative",onClick:e=>{n&&n(),w.Z&&!t&&(0,v.o)(e,(0,b.wu)(r,i,{noBase:!0,feedViewer:!0,urlParams:{selection:a.id}}))},href:h,draggable:!1,showFocus:!0,animate:!0,radius:u?void 0:d?"sm":"md",overflow:"hidden",flex:p?"grow":void 0,children:s})}function P(e){let{text:t,isShort:n,isImage:r,isBasic:i,palette:a,publication:s,post:c,onSavePostClick:d,alignment:u,children:p,isPermalink:h,isComposing:m,isRestack:g,lineClamp:f,fillHeight:C}=e;return(0,o.FD)(y.I1,{padding:20,zIndex:1,className:l()(R.A.header,h&&R.A.permalink,g&&R.A.restack),justifyContent:"space-between",gap:24,flex:C?"grow":void 0,children:[p,(0,o.Y)(F,{text:t,isShort:n,isImage:r,isVibrant:!i,alignment:u,lineClamp:f}),(0,o.Y)(B,{publication:s,post:c,onSavePostClick:d,isVibrant:!i,palette:a,isComposing:m})]})}let x=[{minLines:12,truncateTo:8},{minLines:16,truncateTo:12}];function F(e){let{text:t,isShort:n,isImage:r,isVibrant:i,alignment:a="left",lineClamp:s}=e,[c,d]=(0,p.useState)(!1),u="dynamic"===s&&!c,{truncatedText:h,measureRef:g,lineCount:f}=(0,C.L)({text:t,truncationRules:u?x:[],ellipsesText:"... See more"}),_=t!==h&&!c,v=l()(R.A.text,n&&R.A.short,r&&R.A.imageText,4===s&&R.A["lineClamp-4"],6===s&&R.A["lineClamp-6"]);return(0,o.FD)(y.I1,{gap:12,justifyContent:"center"===a?"center":"start",alignItems:"center"===a?"center":"start",flex:"grow",children:[(0,o.Y)(m.A,{color:i?"var(--color-utility-white)":"var(--color-fg-tertiary)"}),(0,o.FD)(Y.az,{position:"relative",children:[(0,o.Y)(S.EY,{font:"serif",color:i?"vibrance-primary":"primary",className:v,align:a,children:_?(0,o.FD)(o.FK,{children:[(0,D.formatEllipsis)(h,"... "),(0,o.Y)(S.EY,{translated:!0,as:"span",font:"serif",color:i?"vibrance-secondary":"secondary",weight:"medium",cursor:"pointer",onClick:e=>{f&&f<=16&&(e.preventDefault(),e.stopPropagation(),d(!0))},children:"See more"})]}):t}),u&&(0,o.Y)("div",{ref:g,className:v,style:{visibility:"hidden",position:"absolute",width:"100%",fontFamily:"var(--font-family-serif)",textAlign:"center"===a?"center":"left"}})]})]})}function B(e){var t;let{publication:n,post:r,palette:i,onSavePostClick:a,isVibrant:l,isComposing:s}=e,c=0===(t=r).publishedBylines.length?null:(0,o.Y)(h.K,{array:t.publishedBylines,limit:3,formatter:e=>e.name}),d=null!=c?c:n.name;return(0,o.FD)(y.Ye,{gap:8,alignItems:"center",minWidth:0,height:20,children:[(0,o.Y)(S.EY.B4,{weight:"regular",color:l?"vibrance-secondary":"secondary",ellipsis:!0,nowrap:!0,flex:"grow",children:d}),!s&&a&&(0,o.Y)(g.xr,{post:r,palette:i&&l?i:null,onSavePostClick:a,className:R.A.saveButton,forceVibrant:l})]})}function M(e){let{style:t,className:n}=e;return(0,o.Y)(f.i,{className:R.A.faded,children:(0,o.Y)(Y.az,{style:t,className:l()(R.A.imageBackdrop,n)})})}function L(e){let{style:t,className:n,palette:r,themeName:i}=e,a=(0,g.Uo)(r||null,"tintedImageVibrant"===i?"DarkVibrant":"DarkMuted");return(0,o.FD)(f.i,{className:R.A.faded,children:[(0,o.Y)(Y.az,{style:t,className:l()(R.A.imageBackdrop,R.A.tinted,n)}),(0,o.Y)(Y.az,{style:a,className:R.A.tint})]})}function G(e){let{palette:t,selectedColorKey:n,coverImage:r,alignment:i,onColorSelect:a,onAlignmentSelect:l}=e;return(0,o.FD)(y.Ye,{justifyContent:"space-between",alignItems:"center",bg:"primary",cursor:"default",onClick:e=>e.stopPropagation(),gap:20,paddingTop:8,paddingBottom:16,height:28,children:[(0,o.Y)(q,{palette:t,onColorSelect:a,selectedColorKey:n,coverImage:r}),(0,o.Y)(U,{alignment:i,onAlignmentSelect:l})]})}function q(e){let{palette:t,onColorSelect:n,selectedColorKey:r,coverImage:i}=e,a=(0,E.kn)({coverImage:i,palette:null!=t?t:void 0}),l=c()(a.map(e=>{let n=$(e,{size:{width:26,height:28},palette:t,coverImage:i});return n?{key:e,style:n}:null}));return(0,o.Y)(z,{children:l.map(e=>{let{key:i,style:a}=e;return(0,o.Y)(H,{swatchKey:i,style:a,isSelected:r===i,onClick:e=>{e.preventDefault(),e.stopPropagation(),n(i)},palette:t})})})}function U(e){let{alignment:t,onAlignmentSelect:n}=e,r=A.zr;return(0,o.Y)(z,{children:r.map(e=>(0,o.Y)(V,{alignment:e,onClick:()=>n(e),isSelected:t===e}))})}function z(e){let{children:t}=e;return(0,o.Y)(y.Ye,{gap:8,className:R.A.swatchesContainer,children:t})}function H(e){let{swatchKey:t,style:n,palette:r,isSelected:i,onClick:a}=e;return t in E.D7.image?(0,o.Y)(j,{swatchKey:t,style:n,onClick:a,isSelected:i,palette:r}):(0,o.Y)(W,{swatchKey:t,style:n,onClick:a,isSelected:i})}function j(e){let{swatchKey:t,style:n,onClick:r,isSelected:i,palette:a}=e,s="blurredImage"===t,c="tintedImageVibrant"===t||"tintedImageMuted"===t,d=(0,g.Uo)(a||null,"tintedImageVibrant"===t?"DarkVibrant":"DarkMuted");return(0,o.FD)(K,{isSelected:i,children:[(0,o.Y)(Y.az,{onClick:r,width:28,height:28,title:t,flex:"auto",className:l()(R.A.swatch,i&&R.A.selected,s&&R.A.blurred,c&&R.A.tinted),style:n},t),c&&(0,o.Y)(Y.az,{style:d,className:R.A.tint})]})}function W(e){var t;let{swatchKey:n,style:r,onClick:i,isSelected:a}=e;return(0,o.Y)(K,{isSelected:a,children:(0,o.Y)(Y.az,{onClick:i,width:28,height:28,title:(t=n,"Theme ".concat(t)),style:r},n)})}function V(e){var t;let{alignment:n,onClick:r,isSelected:i}=e,a=i?"var(--color-fg-primary)":"var(--color-fg-secondary)";return(0,o.Y)(K,{isSelected:i,className:R.A.alignmentSwatchContainer,children:(0,o.Y)(y.pT,{onClick:r,title:(t=n,"Align ".concat(t)),children:"left"===n?(0,o.Y)(d.A,{stroke:a,size:16}):(0,o.Y)(u.A,{stroke:a,size:16})},n)})}function K(e){let{isSelected:t,children:n,className:r}=e;return(0,o.Y)(y.pT,{width:28,height:28,radius:"sm",outline:"detail",flex:"auto",cursor:"pointer",overflow:"hidden",sizing:"border-box",position:"relative",alignItems:"center",justifyContent:"center",animate:!0,className:l()(R.A.swatchContainer,t&&R.A.selected,r),tabIndex:0,children:n})}function $(e,t){let{size:n,palette:r,coverImage:i}=t;if(e in E.D7.basic)return{background:E.D7.basic[e]};if(e in E.D7.custom)return{background:"linear-gradient(180deg, ".concat(E.D7.custom[e],", ").concat(E.D7.custom[e],"), var(--color-dark-bg-primary)")};if(e in E.D7.image){if(!i)return;return{backgroundImage:(0,_.k)(i,n),backgroundSize:"cover",backgroundPosition:"center"}}return(0,g.Uo)(r||null,e)}function J(){let e=(0,p.useContext)(O);if(!e)throw Error("useQuotePreferences must be used within QuotePreferencesProvider");return e}function X(e){let{children:t}=e,[n,i]=(0,p.useState)(function(){if("undefined"==typeof localStorage)return k;try{let e=localStorage.getItem(I);if(!e)return k;return(0,r._)({},k,JSON.parse(e))}catch(e){return console.error("Error reading quote preferredTheme:",e),k}}()),a=(0,p.useCallback)(e=>{i(t=>{let n=(0,r._)({},t,e);try{localStorage.setItem(I,JSON.stringify(n))}catch(e){console.error("Storage error:",e)}return n})},[]);return(0,o.Y)(O.Provider,{value:{preferredTheme:n,setPreferredTheme:a},children:t})}},55200:function(e,t,n){n.d(t,{l:()=>i});var r=n(39318);function i(e,t){return(null==e?void 0:e.profile_set_up_at)?(0,r.gYq)(e,t):(0,r.W$o)((null==t?void 0:t.utm_source)?{utm_source:t.utm_source}:void 0)}},76110:function(e,t,n){n.d(t,{a7:()=>C});var r=n(4006),i=n(32485),o=n.n(i),a=n(47963),l=n(86500),s=n(56804),c=n(76977),d=n(63136),u=n(39318),p=n(98949),h=n(57324),m=n(19611);let g=h._9.appMarketing,f=h.fL.signInPage;function C(e){let{abTestingId:t}=e,n=(0,p.aR)()?"ios":(0,p.m0)()?"android":"desktop",i="desktop"===n?180:120;return(0,r.Y)(c.pT,{padding:20,paddingTop:32,alignItems:"center",justifyContent:"center",children:(0,r.FD)(c.Ye,{radius:"lg",border:"detail",className:o()(m.A.signInAppUpsell,{[m.A.isDesktop]:"desktop"===n}),paddingX:20,paddingTop:20,gap:20,shadow:"lg",cursor:"pointer",onClick:e=>{(0,l.u4)(l.qY.SIGN_IN_APP_UPSELL_CLICKED,{position:"sign-in-page"}),(0,s.o)(e,(0,u.wHz)({utm_campaign:g,utm_content:f,utm_source:h.VU.upsell}),{native:!0,newTab:!0})},children:[(0,r.FD)(c.I1,{justifyContent:"space-between",flex:"grow",paddingBottom:20,gap:8,children:[(0,r.FD)(c.I1,{gap:8,children:[(0,r.Y)(d.EY.H3,{weight:"heavy",children:"Stay signed in"}),(0,r.Y)(d.EY.B4,{color:"secondary",children:"Download the Substack app for ".concat("ios"===n?"iOS":"android"===n?"Android":"Android or iOS")})]}),"desktop"===n?(0,r.Y)(_,{abTestingId:t}):(0,r.Y)(Y,{type:n})]}),(0,r.Y)(c.pT,{alignItems:"end",children:(0,r.Y)("img",{style:{maxWidth:i},src:(0,u.dJ9)("/img/app_page/highlight-6-ios-v2.png",2*i)})})]})})}function _(e){let{abTestingId:t}=e;return(0,r.FD)(c.I1,{gap:16,alignItems:"center",children:[(0,r.Y)(v,{abTestingId:t}),(0,r.FD)(c.Ye,{gap:8,children:[(0,r.Y)(Y,{type:"ios"}),(0,r.Y)(Y,{type:"android"})]})]})}function v(e){let{abTestingId:t}=e;return(0,r.Y)(c.pT,{border:"detail",radius:"lg",className:m.A.qrContainer,children:(0,r.Y)(c.pT,{className:m.A.qrCode,padding:8,children:(0,r.Y)(a.hj,{abTestingId:t,width:160,height:160,utm_campaign:g,utm_content:f,utm_source:h.VU.qr})})})}function Y(e){let{type:t}=e;return(0,r.Y)(c.pT,{style:{minWidth:135},radius:"sm",overflowX:"hidden",overflowY:"hidden",className:m.A.appDownloadButton,as:"a",href:(0,u.wHz)({utm_campaign:g,utm_content:f,utm_source:h.VU.badge,force:"android"===t?"android":"ios"}),onClick:e=>e.stopPropagation(),children:(0,r.Y)("img",{className:"app-upsell",src:(0,u.dJ9)("android"===t?"/img/app_page/google-play.png":"/img/app_page/app-store.png",320),height:40})})}},12387:function(e,t,n){n.d(t,{F:()=>p});var r=n(4006),i=n(32485),o=n.n(i),a=n(48697),l=n(89490),s=n(35369),c=n(76977),d=n(63136),u=n(74460);let p=e=>{let{title:t,description:n,Icon:i,onClick:o,onDismiss:a,theme:l="default",flex:s="auto"}=e;return(0,r.FD)(_,{theme:l,flex:s,onClick:o,children:[i&&(0,r.Y)(h,{Icon:i}),(0,r.FD)(v,{children:[t&&(0,r.Y)(m,{theme:l,children:t}),n&&(0,r.Y)(g,{theme:l,children:n})]}),a&&(0,r.Y)(f,{onClick:a})]})},h=e=>{let{Icon:t}=e;return(0,r.Y)(C,{children:(0,r.Y)(t,{size:18,className:u.A.icon})})},m=e=>{let{children:t,theme:n}=e;return(0,r.Y)(d.EY.B4,{weight:"medium",color:"default"===n?"primary":n,className:u.A.title,children:t})},g=e=>{let{children:t,theme:n}=e;return(0,r.Y)(d.EY.B4,{weight:"regular",color:"default"===n?"secondary":n,className:u.A.description,children:t})},f=e=>{let{onClick:t}=e;return(0,r.Y)(C,{children:(0,r.Y)(s.K0,{priority:"quaternary",onClick:e=>{e.stopPropagation(),t()},size:"xs",className:u.A.dismiss,children:(0,r.Y)(a.A,{size:18})})})},C=(0,l.I4)({display:"flex",alignItems:"center",justifyContent:"center",width:20,height:20}),_=e=>{let{theme:t,children:n,flex:i,onClick:a}=e;return(0,r.Y)(c.fI,{flex:i,gap:12,paddingX:16,paddingY:12,radius:"sm",className:o()(u.A.alert,u.A["theme_".concat(t)]),onClick:a,pressable:a?"lg":void 0,cursor:a?"pointer":void 0,children:n})},v=(0,l.I4)({display:"flex",direction:"column",flex:"grow",alignItems:"start"})},91401:function(e,t,n){n.d(t,{_:()=>P});var r=n(4006),i=n(35426),o=n(38390),a=n(89490);let l="transition-w_bxsw",s="from-z8IAhO",c="to-tJ4gLS";function d(e){let{onClose:t,disableCloseOnBackdropClick:n}=e;return(0,r.Y)(o.hJ,{forceMount:!0,className:"backdrop-XhnYC7",onClick:()=>{n||t()}})}let u=e=>{let{children:t}=e;return(0,r.Y)(i.e.Child,{enter:l,enterFrom:s,enterTo:c,leave:l,leaveFrom:c,leaveTo:s,children:t})};var p=n(20347),h=n(26230),m=n(69277),g=n(76977),f=n(12601);let C={paddingTop:20,paddingBottom:20};var _=n(84843);let v={paddingTop:20,paddingBottom:20},Y={flex:"1",justifyContent:"center"};var y=n(32485),S=n.n(y),w=n(17402),E=n(11510);let A=(0,w.forwardRef)((e,t)=>{let{children:n,className:i,width:a,initialFocus:l,disableCloseOnBackdropClick:s=!1,testId:c,style:d}=e,u=(0,E.Iu)();return(0,r.Y)(o.UC,{forceMount:!0,ref:t,"data-testid":c,className:S()(i,"panel-kkbipN",u&&"mobile-_09kdk"),style:(0,m._)({width:u?void 0:a},d),onOpenAutoFocus:e=>{(null==l?void 0:l.current)&&(e.preventDefault(),l.current.focus())},onCloseAutoFocus:e=>{e.preventDefault()},onPointerDownOutside:e=>{e.preventDefault()},onEscapeKeyDown:e=>{s&&e.preventDefault()},children:n})});A.displayName="DrawerPanel";let b="transition-yXnIcD",D="from-ohdinI",R="to-pJrLpA",I=e=>{let{children:t}=e;return(0,r.Y)(i.e.Child,{as:w.Fragment,enter:b,enterFrom:D,enterTo:R,leave:b,leaveFrom:R,leaveTo:D,children:t})};var k=n(90460),O=n(10996),T=n(53168);function N(e){let{children:t}=e;return(0,r.Y)(a.az,{className:"layout-oewxMQ",style:{zIndex:T.Up},children:t})}let P=e=>{let{isOpen:t,onClose:n=()=>void 0,children:a,testId:l="drawer",className:s,width:c=440,disableCloseOnBackdropClick:p=!1,initialFocus:h,style:m}=e;return(0,k.h)(t),(0,r.Y)(o.bL,{open:t,onOpenChange:e=>{e||null==n||n()},children:(0,r.Y)(o.ZL,{forceMount:!0,children:(0,r.Y)(i.e.Root,{show:t,children:(0,r.FD)(N,{children:[(0,r.Y)(u,{children:(0,r.Y)(d,{onClose:n,disableCloseOnBackdropClick:p})}),(0,r.Y)(O.e$,{children:(0,r.Y)(I,{children:(0,r.Y)(A,{width:c,className:s,initialFocus:h,disableCloseOnBackdropClick:p,testId:l,style:m,children:a})})})]})})})})};P.Header=e=>{let{onClose:t,showClose:n=!0,title:i,description:o,showDivider:a=!1}=e,l=a?_.P0:_.UG;return(0,r.Y)(l,{style:(0,m._)({},v),children:(0,r.FD)(g.fI,{children:[(0,r.FD)(_.fS,{style:(0,m._)({},Y),children:[i&&(0,r.Y)(_.$q,{text:i,isInsideDialog:!1}),o&&(0,r.Y)(_.ph,{text:o,isInsideDialog:!1})]}),n&&t&&(0,r.Y)(_.J,{onClose:t,position:"relative"})]})})},P.Body=function(e){var t=(0,p._)({},(0,h._)(e));return(0,r.Y)(g.VP,(0,m._)({flex:"grow",overflow:"auto",padding:20},t))},P.Footer=e=>{let{primaryButton:t,secondaryButton:n,showDivider:i,direction:o="row"}=e,a="column"===o,l=!!n||!!t,s=i?a?f.X_:f.RY:a?f.MM:f.It,c=a?f.iF:f.Y9,d=[n,t].filter(Boolean);return(0,r.Y)(s,{style:(0,m._)({},C),children:l&&(0,r.Y)(c,{children:d})})}},86465:function(e,t,n){n.d(t,{I:()=>o});var r=n(4006),i=n(20500);let o=e=>{let{errors:t}=e;return t?(0,r.Y)(r.FK,{children:t.map(e=>(0,r.Y)(i.yn,{children:e},e))}):null}},39841:function(e,t,n){n.d(t,{s:()=>s});var r=n(4006),i=n(51290),o=n(35369),a=n(17028),l=n(60938);function s(e){let{tab:t,children:n,value:a}=e;return(0,r.Y)(i.l9,{asChild:!0,value:a,children:(0,r.FD)(o.Nm,{className:l.A.tab,display:"flex",flex:"grow",alignItems:"center",justifyContent:"center",position:"relative",sizing:"border-box",radius:"xs",resetCss:!0,minHeight:40,paddingTop:2,paddingX:16,gap:6,showFocus:!0,animate:!0,userSelect:"none",children:[t.leading,(0,r.Y)(c,{children:n}),t.trailing]})})}let c=e=>{let{children:t}=e;return(0,r.Y)(a.EY.B4,{as:"span",weight:"semibold",size:14,ellipsis:!0,animate:!0,children:t})}},414:function(e,t,n){n.d(t,{r:()=>u});var r=n(4006),i=n(51290),o=n(17402),a=n(84605),l=n(17028),s=n(39841),c=n(71518),d=n(90017);function u(e){let{tabs:t,value:n,onChange:l,ariaLabel:u}=e,{iString:h}=(0,a.GO)(),m=(0,o.useRef)(null),g=(0,o.useRef)(null);return(0,o.useEffect)(()=>(0,c.x)({parentRef:m,highlightRef:g}),[n,t]),(0,r.Y)(i.bL,{value:n,onValueChange:e=>{l(e)},className:d.A.root,children:(0,r.FD)(i.B8,{ref:m,"aria-label":null!=u?u:"".concat(h("Tabs")),className:d.A.list,children:[t.map(e=>(0,r.Y)(s.s,{tab:e,value:e.value,children:e.label},e.value)),(0,r.Y)(p,{ref:g})]})})}let p=(0,l.I4)({position:"absolute",className:d.A.highlight})},52298:function(e,t,n){n.d(t,{F:()=>a});var r=n(4006),i=n(51290),o=n(35369);function a(e){let{tab:t,flex:n="auto",onClick:a}=e,{leading:l,trailing:s,value:c,label:d}=t;return(0,r.Y)(i.l9,{asChild:!0,value:c,children:(0,r.Y)(o.$n,{className:"segment-j4TeZ4",leading:l,trailing:s,priority:"quaternary",size:"sm",flex:n,onClick:a,children:d})})}},71518:function(e,t,n){n.d(t,{x:()=>o});var r=n(38221),i=n.n(r);function o(e){let{parentRef:t,highlightRef:n}=e,r=()=>{let e=n.current,r=t.current;if(!r||!e)return;let i=r.querySelector('[data-state="active"]');if(!i)return;let o=i.getBoundingClientRect(),a=r.getBoundingClientRect(),l=parseInt(window.getComputedStyle(r).paddingLeft),s=o.left-a.left-l+r.scrollLeft;requestAnimationFrame(()=>{e.style.setProperty("--highlight-width","".concat(o.width,"px")),e.style.setProperty("--highlight-x","".concat(s,"px"))})};r();let o=t.current,a=new ResizeObserver(i()(r,200));return o&&(a.observe(o),o.addEventListener("scroll",r,{passive:!0})),()=>{a.disconnect(),o&&o.removeEventListener("scroll",r)}}},75990:function(e,t,n){n.d(t,{D:()=>s});var r=n(4006),i=n(17402),o=n(93355),a=n(62870),l=n(98949);function s(e){let{pub:t,post:n,style:s,source:c,size:d,hoverOverlay:u=!0}=e,{img:p,imgDownload:h,shareData:m,useNativeShare:g}=(0,o.Y)((0,a.wj)({pub:t,post:n,style:s})),f=(0,i.useCallback)(async()=>{await (0,a.f3)({post_id:n.id,type:"post_asset",aspect_ratio:s.aspectRatio,source:c,shareData:g?m:void 0,eventName:"WRITER_MEDIA_ASSETS_IMAGE_DOWNLOADED"})},[n.id,s.aspectRatio,c,g,m]);return(0,r.Y)(a.Cs,{onClick:f,href:g?void 0:h,children:(0,r.FD)(a.OK,{size:d,children:[!(0,l.Fr)()&&p&&u&&(0,r.Y)(a.lh,{onClick:f}),(0,r.Y)(a.BB,{img:p})]})})}},2824:function(e,t,n){n.d(t,{a:()=>h});var r=n(4006),i=n(67078),o=n(84605),a=n(46271),l=n(12501),s=n(35369),c=n(16993),d=n(84843),u=n(49807),p=n(57324);function h(e){let{isOpen:t,onClose:n,requirement:h,writerId:m}=e,g=(0,a.Jd)(),{iString:f}=(0,o.GO)(),{result:C}=(0,l.st)({pathname:"/api/v1/user/".concat(m,"/primary-publication"),deps:[m],auto:!0}),_=f("free_subscriber"===h?"Subscribers only":"Paid subscribers only"),v=f("free_subscriber"===h?"To join the conversation, become a subscriber.":"To join the conversation, become a paying subscriber.");return(0,r.FD)(c.aF,{isOpen:t,onClose:n,children:[(0,r.Y)(c.rQ,{alignItems:"center",title:_,description:v,icon:(0,r.Y)(d.qx,{icon:(0,r.Y)(i.A,{})})}),(0,r.Y)(c.q1,{}),(0,r.Y)(c.jl,{direction:"column",primaryButton:C?(0,r.Y)(s.$n,{priority:"primary",rounded:!0,href:(0,u.eV6)(C,{user:g,addBase:!0,params:{utm_source:p.VU.feedCommentReplyRestriction}}),children:f("free_subscriber"===h?"Subscribe":"Upgrade")}):void 0,secondaryButton:(0,r.Y)(s.$n,{priority:"secondary",rounded:!0,onClick:n,children:f(C?"Cancel":"Ok")})})]})}},81870:function(e,t,n){n.d(t,{C:()=>c});var r=n(4006),i=n(43954),o=n(84605),a=n(35369),l=n(16993),s=n(84843);function c(e){let{isOpen:t,onClose:n}=e,{iString:c}=(0,o.GO)();return(0,r.FD)(l.aF,{isOpen:t,onClose:n,children:[(0,r.Y)(l.rQ,{alignItems:"center",title:c("Confirm your email address"),description:c("Please confirm your email address before posting a note."),icon:(0,r.Y)(s.qx,{icon:(0,r.Y)(i.A,{})})}),(0,r.Y)(l.q1,{}),(0,r.Y)(l.jl,{direction:"column",primaryButton:(0,r.Y)(a.$n,{priority:"primary",rounded:!0,onClick:n,children:c("Ok")}),secondaryButton:(0,r.Y)(a.$n,{priority:"secondary",href:"/settings",children:c("Resend confirmation email")})})]})}},50630:function(e,t,n){n.d(t,{W:()=>a,r:()=>l});var r=n(4006),i=n(17402);let o=(0,i.createContext)(null);function a(e){let{children:t}=e,[n,a]=(0,i.useState)("email"),[l,s]=(0,i.useState)(""),[c,d]=(0,i.useState)(!1),[u,p]=(0,i.useState)(null);return(0,r.Y)(o.Provider,{value:{mode:n,email:l,verificationCodeEnabled:c,onboardingRedirect:u,setMode:e=>{"magic-link"!==e&&d(!1),a(e)},setEmail:s,setVerificationCodeEnabled:d,setOnboardingRedirect:p},children:t})}function l(){let e=(0,i.useContext)(o);if(!e)throw Error("useSignIn must be used within an SignInProvider");return e}},83842:function(e,t,n){n.d(t,{j:()=>f});var r=n(79785),i=n(4006),o=n(43954),a=n(84605),l=n(59922),s=n(38093),c=n(17028),d=n(16993),u=n(84843),p=n(50630),h=n(62088);function m(){let e=(0,r._)(["We've sent an email to ",". Click the magic link or enter the code below:"]);return m=function(){return e},e}function g(){let e=(0,r._)(["We've sent an email to ",". Click the magic link inside to continue."]);return g=function(){return e},e}let f=e=>{let{noCloseButton:t,noExit:n,onCancel:r,onSuccess:o}=e;return(0,i.FD)(i.FK,{children:[(0,i.Y)(C,{noCloseButton:!t||n,onCancel:r}),(0,i.Y)(_,{onSuccess:o}),(0,i.Y)(v,{})]})},C=e=>{let{noCloseButton:t,onCancel:n}=e,{iString:r,iTemplate:l}=(0,a.GO)(),{verificationCodeEnabled:s,email:c}=(0,p.r)();return(0,i.Y)(u.rQ,{title:r("Check your email to continue"),onClose:t?void 0:n,icon:(0,i.Y)(u.qx,{icon:(0,i.Y)(o.A,{size:20})}),alignItems:"center",description:l(s?m():g(),null!=c?c:"your email address")})};function _(e){let{onSuccess:t}=e,{verificationCodeEnabled:n,email:r,onboardingRedirect:o}=(0,p.r)();return(0,l.A)(()=>{fetch("/api/v1/am_i_logged_in").then(async e=>{(await e.json()).loggedIn&&t()})},5e3),n?(0,i.Y)(d.cw,{children:(0,i.Y)(s.Z,{email:r,redirect:o||document.location.href})}):(0,i.Y)(d.q1,{})}let v=()=>{let{iString:e}=(0,a.GO)(),{setMode:t}=(0,p.r)();return(0,i.Y)(h.dt,{children:(0,i.FD)(i.FK,{children:[e("Didn't get the email? "),(0,i.Y)(c.Yq,{color:"substack",decoration:"hover-underline",onClick:()=>t("email"),cursor:"pointer",children:e("Try again")})]})})}},23358:function(e,t,n){n.d(t,{_:()=>f});var r=n(4006),i=n(84605),o=n(43294),a=n(94729),l=n(12501),s=n(68349),c=n(17028),d=n(85329),u=n(20500),p=n(16993),h=n(50630),m=n(62088),g=n(95755);let f=e=>{let{overrideTitle:t,noCloseButton:n,onCancel:i,onSignup:o,onUserCreated:a,redirectOverride:l}=e;return(0,r.FD)(r.FK,{children:[(0,r.Y)(m.$P,{overrideTitle:t,noCloseButton:n,onCancel:i,onSignup:o}),(0,r.Y)(C,{onUserCreated:a,redirectOverride:l})]})};function C(e){let{onUserCreated:t,redirectOverride:n}=e,{iString:m}=(0,i.GO)(),{setMode:f,setEmail:C,setVerificationCodeEnabled:_,setOnboardingRedirect:v,email:Y}=(0,h.r)(),y=(0,o.X)(),S=(0,l.st)({pathname:"/api/v1/email-login",method:"POST"});return(0,r.FD)("form",{onSubmit:e=>{if(e.preventDefault(),S.isLoading)return;let r=e.currentTarget.email.value;S.refetch({json:{email:r,redirect:n||location.pathname,can_create_user:!0}}).then(e=>{if(!(e instanceof a.fk)){if(!(e instanceof Error)&&"optional"===e.verification_code){_(!0),C(r),v(e.onboarding_redirect||null),f("magic-link");return}if(!(e instanceof Error)&&e.user){if(t)return void t(e.user);window.location.reload()}C(r),f("magic-link")}})},children:[(0,r.Y)(p.cw,{className:g.A.modalBody,children:(0,r.FD)(c.VP,{gap:16,children:[(0,r.Y)(d.j,{name:"email",placeholder:m("Your email"),autoComplete:"email",ref:y,autoFocus:!0,defaultValue:Y}),S.error&&(0,r.Y)(u.yn,{children:(0,s.uX)(S.error)})]})}),(0,r.Y)(p.jl,{direction:"column",primaryButton:(0,r.Y)(c.$n,{priority:"primary",type:"submit",loading:S.isLoading,children:m("Continue")}),secondaryButton:(0,r.Y)(c.$n,{priority:"secondary-outline",onClick:()=>{var e;C((null==(e=y.current)?void 0:e.value)||""),f("password")},children:m("Sign in with password")}),buttonDivider:(0,r.Y)(c.vj,{})})]})}},82804:function(e,t,n){n.d(t,{Q:()=>m});var r=n(4006),i=n(67078),o=n(84605),a=n(94729),l=n(12501),s=n(38093),c=n(17028),d=n(16993),u=n(84843),p=n(50630),h=n(62088);let m=e=>{let{onSuccess:t}=e;return(0,r.FD)(r.FK,{children:[(0,r.Y)(g,{}),(0,r.Y)(f,{onSuccess:t}),(0,r.Y)(C,{})]})},g=()=>{let{iString:e}=(0,o.GO)();return(0,r.Y)(u.rQ,{title:e("Enter the code from your authenticator app"),description:e("This helps us make sure it's really you."),icon:(0,r.Y)(u.qx,{icon:(0,r.Y)(i.A,{size:20})}),alignItems:"center"})};function f(e){let{onSuccess:t}=e,n=(0,l.st)({pathname:"/api/v1/mfa-login",method:"Post"});return(0,r.Y)(d.cw,{children:(0,r.Y)(c.VP,{gap:16,children:(0,r.Y)(s.Q,{onComplete:e=>{n.isLoading||n.refetch({json:{code:e}}).then(e=>{e instanceof a.fk||t()})},error:n.error,isLoading:n.isLoading})})})}let C=()=>{let{iString:e}=(0,o.GO)(),{setMode:t}=(0,p.r)();return(0,r.Y)(h.dt,{children:(0,r.FD)(r.FK,{children:[e("Made a mistake? "),(0,r.Y)(c.Yq,{color:"substack",decoration:"hover-underline",onClick:()=>t("email"),cursor:"pointer",children:e("Start over")})]})})}},60689:function(e,t,n){n.d(t,{d:()=>b});var r=n(4006),i=n(17402),o=n(42250),a=n(84605),l=n(43294),s=n(94729),c=n(12501),d=n(68349),u=n(17028),p=n(85329),h=n(20500),m=n(16993),g=n(69277),f=n(70408),C=n(32641),_=n(93540),v=n(3160),Y=n(79661),y=n(48625);let S=(0,i.forwardRef)((e,t)=>{var{disabled:n}=e,o=(0,C._)(e,["disabled"]);let{iString:l}=(0,a.GO)(),[s,c]=(0,i.useState)(!1);return(0,r.Y)(Y.pd,(0,f._)((0,g._)({},o),{ref:t,disabled:n,type:s?"text":"password",trailing:(0,r.Y)(y.f,{size:"xs",priority:"quaternary","aria-label":l(s?"Hide password":"Show password"),pressed:s,onPressedChange:c,disabled:n,onMouseDown:e=>e.preventDefault(),children:e=>{let{pressed:t}=e;return t?(0,r.Y)(_.A,{size:16}):(0,r.Y)(v.A,{size:16})}})}))});var w=n(50630),E=n(62088),A=n(95755);let b=e=>{let{overrideTitle:t,noCloseButton:n,noExit:i,onCancel:o,onSignup:a,onSuccess:l}=e;return(0,r.FD)(r.FK,{children:[(0,r.Y)(E.$P,{overrideTitle:t,noCloseButton:n||i,onCancel:o,onSignup:a}),(0,r.Y)(D,{onSuccess:l})]})};function D(e){let{onSuccess:t}=e,{iString:n}=(0,a.GO)(),{email:g,setEmail:f,setMode:C}=(0,w.r)(),_=(0,c.st)({pathname:"/api/v1/login",method:"post"}),v=(0,i.useRef)(),Y=(0,l.X)(),y=(0,l.X)(),E=async e=>{if(e.preventDefault(),_.isLoading)return;let n=Object.fromEntries(Array.from(e.currentTarget.elements).filter(e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement).map(e=>[e.name,e.value]));v.current&&(n.captcha_response=v.current.getResponse());let r=await _.refetch({json:n});r instanceof Error||(r.mfa_required?C("mfa"):t())};return(0,r.FD)(r.FK,{children:[_.error instanceof s.fk&&401===_.error.response.status&&(0,r.Y)(o.A,{ref:v}),(0,r.FD)("form",{onSubmit:E,children:[(0,r.Y)(m.cw,{className:A.A.modalBody,children:(0,r.FD)(u.VP,{gap:8,children:[(0,r.Y)(p.j,{name:"email",placeholder:n("Your email"),autoComplete:"email",ref:y,defaultValue:g,autoFocus:!0}),(0,r.Y)(S,{name:"password",placeholder:n("Your password"),ref:Y}),_.error&&(0,r.Y)(h.yn,{children:(0,d.uX)(_.error)})]})}),(0,r.Y)(m.jl,{direction:"column",primaryButton:(0,r.Y)(u.$n,{priority:"primary",type:"submit",loading:_.isLoading,children:n("Continue")}),secondaryButton:(0,r.Y)(u.$n,{priority:"secondary-outline",onClick:()=>{var e;f((null==(e=y.current)?void 0:e.value)||""),C("email")},children:n("Sign in with email")}),buttonDivider:(0,r.Y)(u.vj,{})})]})]})}},22238:function(e,t,n){n.d(t,{Q:()=>E});var r=n(79785),i=n(4006),o=n(33167),a=n(54718),l=n(82853),s=n(32708),c=n(84605),d=n(46271),u=n(94729),p=n(68349),h=n(35369),m=n(17028),g=n(45859),f=n(78526),C=n(16291),_=n(92636),v=n(49807);function Y(){let e=(0,r._)(["Today at ",""]);return Y=function(){return e},e}function y(){let e=(0,r._)(["Tomorrow at ",""]);return y=function(){return e},e}function S(){let e=(0,r._)([""," at ",""]);return S=function(){return e},e}function w(){let e=(0,r._)([" \xb7 Scheduled by ",""]);return w=function(){return e},e}function E(e){var t,n;let{stream:r,onCancelStream:E}=e,{iString:A,iTemplate:b}=(0,c.GO)(),{user:D}=(0,d.ur)(),R=(0,f.L)(),{liveStream:I}=r,k=I.user_id!==(null==D?void 0:D.id),O=!I.is_rtmp&&!k&&!!I.scheduled_at&&15>=(0,C.A)(I.scheduled_at).diff((0,C.A)(),"minutes"),T=(null==(t=r.pub)?void 0:t.subdomain)||(null==D||null==(n=D.primary_publication)?void 0:n.subdomain)||"",N=(0,_.$_)({subdomain:T}),P="".concat(N,"/publish/home?action=setup-live-stream&stream_id=").concat(I.id),x=(0,v.Xrv)({liveStreamId:I.id}),F=(0,C.A)(),B=(0,C.A)(I.scheduled_at),M=B.format("h:mm A"),L=B.format("MMM D"),G="";I.scheduled_at&&(G=B.isSame(F,"day")?b(Y(),M):B.isSame(F.add(1,"day"),"day")?b(y(),M):b(S(),L,M));let q=()=>{(0,p.V2)(I.is_rtmp?P:x,{local_navigation:!1})},U=async()=>{try{await (0,u.x6)("/api/v1/live_stream/".concat(I.id,"/cancel"),{method:"PUT"}),E(I.id)}catch(e){console.error("Error canceling stream:",e)}};return(0,i.FD)(m.Ye,{alignItems:"center",justifyContent:"space-between",gap:12,children:[(0,i.FD)(m.I1,{gap:4,flex:"grow",style:{minWidth:0},children:[(0,i.Y)(m.EY.B3,{fontWeight:"medium",ellipsis:!0,children:I.title}),(0,i.FD)(m.Ye,{alignItems:"center",gap:8,children:[(0,i.FD)(m.EY.B4,{color:"secondary",children:[G,k&&r.user.name&&b(w(),r.user.name)]}),I.is_rtmp&&(0,i.Y)(m.pT,{bg:"accent-red",radius:"sm",paddingX:6,paddingY:2,style:{flexShrink:0},children:(0,i.Y)(m.EY.B5,{fontWeight:"medium",children:A("RTMP live video")})})]})]}),(0,i.FD)(m.Ye,{alignItems:"center",gap:8,style:{flexShrink:0},children:[O?(0,i.Y)(h.$n,{priority:"primary",onClick:()=>(0,p.V2)("".concat(N,"/publish/live-stream/").concat(I.id,"?startPractice=true")),children:A("Start live video")}):(0,i.FD)(i.FK,{children:[(0,i.Y)(m.pT,{display:{mobile:"none",desktop:"flex"},children:(0,i.Y)(h.$n,{priority:"secondary",onClick:q,children:A("View stream page")})}),(0,i.Y)(m.pT,{display:{mobile:"flex",desktop:"none"},children:(0,i.Y)(h.K0,{"aria-label":A("View stream page"),priority:"quaternary",size:"sm",onClick:q,children:(0,i.Y)(o.A,{size:20})})})]}),(0,i.FD)(g.W1,{trigger:(0,i.Y)(h.K0,{"aria-label":A("More options"),priority:"secondary",children:(0,i.Y)(a.A,{size:20})}),children:[(0,i.Y)(g.Dr,{onClick:()=>{R(x)},leading:(0,i.Y)(l.A,{}),children:A("Copy link")}),!k&&(0,i.Y)(g.H9,{children:(0,i.Y)(g.Dr,{priority:"destructive",onClick:U,leading:(0,i.Y)(s.A,{}),children:A("Cancel")})})]})]})]})}},91324:function(e,t,n){n.d(t,{i:()=>d,u:()=>c});var r=n(69277),i=n(70408),o=n(4006),a=n(17402),l=n(86500);let s=(0,a.createContext)({surface:null,platform:"web"});function c(e){let{children:t,trackingProps:n}=e,i=(0,a.useContext)(s),l=(0,a.useMemo)(()=>(0,r._)({},i,n),Object.values(n));return(0,o.Y)(s.Provider,{value:l,children:t})}function d(){let e=(0,a.useContext)(s);return(t,n)=>(0,l.u4)(t,(0,r._)((0,i._)((0,r._)({},e),{ui:"page"===e.surface?"activity-page":e.surface}),n))}},87370:function(e,t,n){n.d(t,{$:()=>p,b:()=>u});var r=n(69277),i=n(70408),o=n(32641),a=n(4006),l=n(17402),s=n(16993),c=n(21398);let d=(0,l.createContext)({open:()=>void 0});function u(e){var t;let{children:n}=e,[o,s]=(0,l.useState)(null),c=(0,l.useMemo)(()=>({open:e=>s(e)}),[]);return(0,a.FD)(d.Provider,{value:c,children:[n,(0,a.Y)(h,(0,i._)((0,r._)({},o),{source:null!=(t=null==o?void 0:o.source)?t:"substack",isOpen:!!o,onClose:()=>s(null)}))]})}function p(){return(0,l.useContext)(d)}function h(e){var{isOpen:t,onClose:l}=e,d=(0,o._)(e,["isOpen","onClose"]);return(0,a.Y)(s.aF,{isOpen:t,onClose:l,fullscreenMobile:!0,children:(0,a.Y)(c.Ic,(0,i._)((0,r._)({},d),{module:"@/frontend/reader2/chat/DmShareModal",onRequest:()=>n.e("23426").then(n.bind(n,21977)),resolve:e=>e.DmComposerModal,onClose:l}))})}},30042:function(e,t,n){n.d(t,{p:()=>r});function r(e){return"direct-message"===e?"people":"all"}},70486:function(e,t,n){n.d(t,{Pk:()=>d,Vn:()=>c,a8:()=>u,qe:()=>l,v$:()=>a,wA:()=>s});var r=n(69277),i=n(17402),o=n(76528);let a={user:null,inbox:{threadList:[],threads:new Map,filter:"all",resources:{all:{isLoading:!0,hasMore:!1},people:{isLoading:!0,hasMore:!1}}},users:new Map,profiles:new Map,communityPosts:new Map,communityComments:new Map,chats:new Map,comments:new Map,replies:new Map,conversations:new Map,publications:new Map,notes:new Map,editingPost:null},l=(0,i.createContext)(()=>Promise.resolve());function s(){return(0,i.useContext)(l)}let c=(0,i.createContext)(a);function d(){return(0,i.useContext)(c)}function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=s();return(0,o.OU)("/api/v1/messages/unread-count",e,(0,r._)({focusThrottleInterval:3e5,onSuccess(e){n&&n({type:"inbox-unread_count",payload:e})}},t))}},26095:function(e,t,n){n.d(t,{x:()=>r});function r(e){let t=0,n=()=>{let{visibilityState:n="visible"}=document,r=Date.now();"hidden"!==n&&r-t>2e3&&(e(),t=r)};return window.addEventListener("online",n),document.addEventListener("visibilitychange",n),window.addEventListener("focus",n),()=>{window.removeEventListener("online",n),document.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}},48239:function(e,t,n){n.d(t,{Gg:()=>l,Ur:()=>a,Xf:()=>c,zz:()=>d});var r=n(69277),i=n(70408),o=n(17402);function a(e){return{step:e,previousStepData:{},stepHistory:[]}}function l(e,t){switch(t.type){case"GO_TO_STEP":if(e.step===t.step)return e;return(0,i._)((0,r._)({},e),{step:t.step,stepHistory:[...e.stepHistory,e.step]});case"GO_BACK":{let t=e.stepHistory[e.stepHistory.length-1];if(!t)return e;return(0,i._)((0,r._)({},e),{step:t,stepHistory:e.stepHistory.slice(0,-1)})}case"SET_STEP_DATA":return(0,i._)((0,r._)({},e),{previousStepData:(0,i._)((0,r._)({},e.previousStepData),{[t.key]:t.data})});case"RESET":return a(t.initialStep);default:return e}}let s=(0,o.createContext)(null),c=s.Provider;function d(){let e=(0,o.useContext)(s);if(!e)throw Error("useOnboarding must be used within an OnboardingProvider");return e}},97522:function(e,t,n){n.d(t,{F:()=>T});var r=n(17402),i=n(46271),o=n(86500),a=n(12501),l=n(61437),s=n(48239),c=n(4006),d=n(42535),u=n(7196),p=n(99039),h=n(78856),m=n(65253),g=n(59849),f=n(31623),C=n(66886),_=n(21122),v=n(78394),Y=n(52943),y=n(23576),S=n(55556),w=n(34945),E=n(67749),A=n(59923),b=n(78979);let D={[b.dn.SIGNUP]:{render:()=>(0,c.Y)(E.n,{}),trackScreenShown:o.qY.READER_ONBOARDING_SIGNUP_STEP_SHOWN,allowReturn:!1},[b.dn.PUB_SIGNUP]:{render:()=>(0,c.Y)(S.U,{}),trackScreenShown:o.qY.READER_ONBOARDING_PUB_SIGNUP_STEP_SHOWN,allowReturn:!1},[b.dn.CATEGORIES]:{render:()=>(0,c.Y)(u.Z,{}),trackScreenShown:o.qY.READER_ONBOARDING_CATEGORIES_SCREEN_SHOWN,allowReturn:!0},[b.dn.CATEGORIES_SUGGESTIONS]:{render:()=>(0,c.Y)(A._,{}),trackScreenShown:o.qY.READER_ONBOARDING_SUGGESTIONS_SCREEN_SHOWN,allowReturn:!0},[b.dn.PROFILE]:{render:()=>(0,c.Y)(v.e,{}),trackScreenShown:o.qY.READER_ONBOARDING_PROFILE_SETUP_STARTED,allowReturn:!0},[b.dn.IMPORT_LIST]:{render:()=>(0,c.Y)(C.g,{}),trackScreenShown:o.qY.READER_ONBOARDING_IMPORT_LIST_STEP_SHOWN,allowReturn:!0},[b.dn.EMAILS_BOX]:{render:()=>(0,c.Y)(_._,{}),trackScreenShown:o.qY.READER_ONBOARDING_EMAIL_INPUTS_STEP_SHOWN,allowReturn:!0},[b.dn.RECOMMENDATIONS]:{render:()=>(0,c.Y)(w.h,{}),trackScreenShown:o.qY.READER_ONBOARDING_RECOMMENDATIONS_STEP_SHOWN,allowReturn:!0},[b.dn.CREATOR_CHOICE]:{render:()=>(0,c.Y)(h.E,{}),trackScreenShown:o.qY.READER_ONBOARDING_INTENT_STEP_SHOWN,allowReturn:!0},[b.dn.CREATOR_WELCOME]:{render:()=>(0,c.Y)(m.J,{}),trackScreenShown:o.qY.READER_ONBOARDING_CREATOR_WELCOME_STEP_SHOWN,allowReturn:!0},[b.dn.START_WRITING]:{render:()=>(0,c.Y)(y.a,{}),trackScreenShown:o.qY.READER_ONBOARDING_START_WRITING_STEP_STARTED,allowReturn:!0},[b.dn.CREATE_PUBLICATION]:{render:()=>(0,c.Y)(p.V,{}),trackScreenShown:o.qY.READER_ONBOARDING_CREATE_PUBLICATION_STEP_STARTED,allowReturn:!1},[b.dn.CREATE_PUBLICATION_SUCCESS]:{render:()=>(0,c.Y)(Y.V,{}),trackScreenShown:o.qY.READER_ONBOARDING_CREATE_PUBLICATION_SUCCESS_STEP_STARTED,allowReturn:!1},[b.dn.ERROR]:{render:()=>(0,c.Y)(f.z,{}),trackScreenShown:o.qY.READER_ONBOARDING_ERROR_STEP_SHOWN,allowReturn:!1},[b.dn.APP_UPSELL]:{render:()=>(0,c.Y)(d.v,{}),trackScreenShown:o.qY.READER_ONBOARDING_APP_UPSELL_SHOWN,allowReturn:!0},[b.dn.WELCOME]:{render:()=>(0,c.Y)(g.n,{}),trackScreenShown:o.qY.READER_ONBOARDING_WELCOME_STEP_STARTED,allowReturn:!0}};function R(e){let t=D[e];if(t)return t;console.error("Unknown onboarding step: ".concat(e,", falling back to WELCOME"));let n=D[b.dn.WELCOME];if(!n)throw Error("WELCOME step config is missing");return n}var I=n(39318),k=n(49807);let O=b.dn.CATEGORIES;function T(e){var t,n;let{isPage:c,isOpen:d,entry:u,pub:p=null,profile:h=null,initialStep:m,redirect:g,skipRedirectOnExit:f=!1,redirectAfterProfile:C,skipCategories:_,flowName:v=l.o.READER_DEFAULT,onClose:Y,onAfterClose:y,onBeforeClose:S}=e,{user:w}=(0,i.ur)(),E=g&&"/"!==g?g:null,{result:A}=(0,a.st)({pathname:"/api/v1/onboarding/status",auto:!!w&&d,deps:[null==w?void 0:w.id,d]}),D=null!=(t=null==A?void 0:A.hasEnoughInterests)&&t,T=null!=(n=null==A?void 0:A.hasEnoughSubscriptions)&&n,N=D||T,P=_||D,[x,F]=(0,r.useReducer)(s.Gg,null!=m?m:O,s.Ur),B=(0,r.useRef)(!1);(0,r.useEffect)(()=>{d&&(B.current=!1,F({type:"RESET",initialStep:null!=m?m:O}))},[d]),(0,r.useEffect)(()=>{if(d&&A&&!B.current&&!m&&N&&x.step===b.dn.CATEGORIES&&0===x.stepHistory.length){if(!P){B.current=!0;return}B.current=!0,T?F({type:"RESET",initialStep:(0,l.j)({flowName:v,event:{type:"CATEGORIES_SUGGESTIONS_COMPLETED"},context:{user:w,entry:u,hasPubContext:!!p,redirectAfterProfile:C,skipCategories:P,skipSuggestions:T}})}):F({type:"RESET",initialStep:b.dn.CATEGORIES_SUGGESTIONS})}},[d,A,N,P,T,x.step,x.stepHistory.length,m,v,w,u,p,C]);let{step:M}=x,L=!!w&&!m&&!A&&d,G=R(M),{trackScreenShown:q}=G,U=x.stepHistory[x.stepHistory.length-1];(0,r.useEffect)(()=>{d&&q&&(0,o.u4)(q,{entry:u})},[d,q,u]);let z=null==p?void 0:p.id,H=p?(0,I.$_T)(p):null,j=(0,r.useCallback)(()=>{(0,o.u4)(o.qY.READER_ONBOARDING_MODAL_OPENED,{entry:u,step:M,for_pub_id:z})},[u,M,z]),W=(0,r.useCallback)(()=>{(0,o.u4)(o.qY.READER_ONBOARDING_COMPLETED,{entry:u,step:M})},[u,M]),V=(0,r.useCallback)(()=>{S&&!1===S(w)||((0,o.u4)(o.qY.READER_ONBOARDING_MODAL_CLOSED,{entry:u,step:M}),(0,b.pq)(M)&&W(),null==Y||Y(),null==y||y())},[S,w,u,M,Y,y,W]),K=(0,r.useCallback)(e=>{if((0,o.u4)(o.qY.READER_ONBOARDING_STEP_CHANGED,{from_step:M,to_step:e,modal:!c}),e===b.dn.EXIT)if(f)V();else{W();let e=null!=E?E:H&&"reader2"===u?H:(0,k.oT5)();document.location.href=e}else setTimeout(()=>F({type:"GO_TO_STEP",step:e}),0)},[M,f,E,H,u,V,W,c]),$=(0,r.useCallback)(()=>{U&&((0,o.u4)(o.qY.READER_ONBOARDING_STEP_CHANGED,{from_step:M,to_step:U,modal:!c}),setTimeout(()=>F({type:"GO_BACK"}),0))},[M,U,c]),J=U&&R(U).allowReturn?$:void 0,X=(0,r.useCallback)(e=>{K((0,l.j)({flowName:v,event:e,context:{user:w,entry:u,hasPubContext:!!p,redirectAfterProfile:C,skipCategories:P,skipSuggestions:T}}))},[v,w,u,p,C,P,T,K]),Z=(0,r.useCallback)((e,t)=>{F({type:"SET_STEP_DATA",key:e,data:t})},[]),Q=(0,r.useCallback)(function(e){let{ignore:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};console.error("Error in reader onboarding ".concat(M," step: ").concat(e)),(0,o.u4)(o.qY.READER_ONBOARDING_ERROR,{step:M,entry:u,ignore:t}),t||K(b.dn.ERROR)},[M,u,K]),ee=x.stepHistory.length>0||c?void 0:V,et=(0,r.useMemo)(()=>({state:x,flowName:v,transition:X,closeFromHeader:ee,user:w,entry:u,pub:p,profile:h,goBack:J,setStepData:Z,handleError:Q,close:V,trackSuccessfulCompletion:W}),[x,v,X,ee,w,u,p,h,J,Z,Q,V,W]);return{stepConfig:G,contextValue:et,handleOpen:j,handleClose:V,isLoadingSkipStatus:L}}},90354:function(e,t,n){n.d(t,{Y:()=>s,f:()=>l});var r=n(50963);let i=["newsletter","substack"],o=["substack"];function a(e){var t;return null!=(t=null==e?void 0:e.trim().replace(/\s+/g," ").replace(/['’]/g,"'").toLowerCase())?t:""}function l(e,t){let n=a(t);return!!n&&(function(e){let t=a(e),n=a((0,r.$k)(e)),l=new Set;if(!t)return l;for(let e of(l.add(t),i))l.add("".concat(t,"'s ").concat(e));if(n&&n!==t)for(let e of o)l.add("".concat(n,"'s ").concat(e));return l})(e).has(n)}function s(e,t){return!a(t)||l(e,t)}}}]);