!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};t.SENTRY_RELEASE={id:"substack@538433c"};var e=(new t.Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="88b3427e-b8de-4c53-bc81-c1a9760d9ed8",t._sentryDebugIdIdentifier="sentry-dbid-88b3427e-b8de-4c53-bc81-c1a9760d9ed8")}catch(t){}}();"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["79472"],{84985:function(t,e,n){n.d(e,{A:()=>i});let i={visitedSurfacesIFrame:"visitedSurfacesIFrame-yy8AJL"}},96917:function(t,e,n){n.d(e,{A:()=>p});var i=n(69277),o=n(70408),a=n(4006),r=n(17402),d=n(86500),l=n(17186),u=n(68349),s=n(39318),c=n(49807);let m="".concat(c.Pmx,"/fedcm/config.json");(0,c.Ewe)(),(0,s.a7q)();var h=n(41086);let g="domain-redirect-time";class p extends r.Component{componentDidMount(){(0,u.qm)("triedSigningIn");let t="undefined"!=typeof window&&window.location.pathname.endsWith("/listen");(this.loadedWithLikelyLoggedInParam()||t)&&!this.shouldBlockLoginRedirect()?this.attemptLoginRedirect({source:"param"}):(this.useFedCm()&&this.initiateFedCmFlow(),this.useIframe()&&window.addEventListener("message",t=>this.handleFrameMessage(t)))}useFedCm(){var t;return!!(null==(t=this.state.pub)?void 0:t.custom_domain)&&!this.state.user&&"undefined"!=typeof window&&"IdentityCredential"in window}async initiateFedCmFlow(){let t=await navigator.credentials.get({identity:{providers:[{configURL:m,clientId:"substack_custom_domain"}]}});(null==t?void 0:t.token)==="redirect-to-login"&&this.attemptLoginRedirect({source:"fedcm"})}shouldBlockLoginRedirect(){var t;let e=parseInt((0,l.xm)(g,0));return this.state.block_auto_login||!(null==(t=this.state.pub)?void 0:t.custom_domain)||this.state.user||"undefined"==typeof window||Date.now()-e<=864e5||this.state.triedSigningIn}handleFrameMessage(t){var e,n,i;if((null==(e=t.data)?void 0:e.type)!=="frame-state")return;let o=!this.shouldBlockLoginRedirect()&&(null==(n=t.data)?void 0:n.loggedInAtSubstack);(0,d.u4)(d.qY.FRAME_MESSAGE_HANDLED,{loggedInAtSubstack:null==(i=t.data)?void 0:i.loggedInAtSubstack,loggedInAtCustomDomain:!!this.state.user,attemptRedirect:o}),o&&this.attemptLoginRedirect({source:"cookie"})}attemptLoginRedirect(){var t;let{source:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,d.u4)(d.qY.CUSTOM_DOMAIN_LOGIN_REDIRECT_ATTEMPTED,{fromParam:"param"===e,source:e}),(0,l.X3)(g,"".concat(Date.now()));let n=(0,s.RY1)({useOriginalUrl:!0});this.props.initialData.hide_intro_popup&&(n=(0,s.oRR)(n,{hide_intro_popup:!0})),location.href=(0,s.a7q)({for_pub:null==(t=this.state.pub)?void 0:t.subdomain,justTrying:!0,redirect:n})}loadedWithLikelyLoggedInParam(){return"undefined"!=typeof window&&window._preloads.original_url&&!!(0,h.y)(window._preloads.original_url,"lli")}useIframe(){var t,e,n;return!("undefined"==typeof window||this.loadedWithLikelyLoggedInParam()||!(null==(t=this.state.pub)?void 0:t.custom_domain)||(0,s.P1Q)(null==(n=window)||null==(e=n.location)?void 0:e.href))}render(){return this.useIframe()?(0,a.Y)("iframe",{src:"".concat((0,s.Ewe)(),"/channel-frame"),className:"channel-frame",width:"0",height:"0"}):null}constructor(t,e){var n;super(t,e),this.state=(0,o._)((0,i._)({},t.initialData),{triedSigningIn:null!=(n=(0,h.y)("triedSigningIn"))?n:void 0})}}},24777:function(t,e,n){n.d(e,{A:()=>h,d:()=>m});var i=n(69277),o=n(70408),a=n(32641),r=n(4006),d=n(39651),l=n(32485),u=n.n(l);n(17402);var s=n(84605),c=n(77700);function m(t){var{size:e="md",theme:n="accent",onChange:l}=t,m=(0,a._)(t,["size","theme","onChange"]);let{iString:h}=(0,s.GO)();return(0,r.Y)(d.bL,(0,o._)((0,i._)({onCheckedChange:l,"aria-label":m["aria-label"]||h("Toggle setting"),className:u()(c.A.root,c.A[e],c.A["theme_".concat(n)])},m),{children:(0,r.Y)(d.zi,{className:u()(c.A.thumb,c.A[e])})}))}let h=m},67734:function(t,e,n){n.d(e,{id:()=>i,oW:()=>o}),n(90128),n(16291),n(82776);let i=(t,e)=>{let n;if(e&&e!==t.currency){var i,o,a;if(!(null==(i=t.currency_options)?void 0:i[e]))return;n=null!=(a=null==(o=t.currency_options[e])?void 0:o.unit_amount)?a:null}else n="object"in t&&"price"===t.object?t.unit_amount:t.amount;return null!=n?n:0},o=(t,e)=>{var n;return e&&e!==t.currency?null==(n=t.metadata.minimum_local)?void 0:n[e]:t.metadata.minimum}},47851:function(t,e,n){n.d(e,{mn:()=>i});let i={comp_one_month:"1 month comp",comp_three_months:"3 month comp",comp_six_months:"6 month comp",comp_nine_months:"9 month comp",comp_twelve_months:"12 month comp",custom:"Custom"}},46058:function(t,e,n){n.d(e,{D0:()=>u,Ji:()=>d,VL:()=>l,cp:()=>s,pI:()=>a,w3:()=>r});var i=n(92636),o=n(49807);function a(t,e){let n=r(t,e);return n||((null==e?void 0:e.darkMode)?s:u)}function r(t){let{preferAuthorPhoto:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e&&(null==t?void 0:t.author_photo_url)&&(0,o.dJ9)(t.author_photo_url)?(0,o.dJ9)(t.author_photo_url):(null==t?void 0:t.photo_url)&&(0,o.dJ9)(t.photo_url)?(0,o.dJ9)(t.photo_url):(null==t?void 0:t.id)!=null?d(t.id):null}function d(t){return"".concat((0,i.Ew)(),"/img/avatars/").concat(["purple","yellow","orange","green","black"][t%5],".png")}function l(t){return t.startsWith("".concat((0,i.Ew)(),"/img/avatars/"))}let u="".concat((0,i.Ew)(),"/img/avatars/default-light.png"),s="".concat((0,i.Ew)(),"/img/avatars/default-dark.png")}}]);