!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@aef81dd"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="75f63793-e61d-401d-9c5d-0c7a61062ea6",e._sentryDebugIdIdentifier="sentry-dbid-75f63793-e61d-401d-9c5d-0c7a61062ea6")}catch(e){}}();"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["99488"],{50587:function(){},16044:function(e,t,n){n.d(t,{A:()=>o});let o={blockContainer:"blockContainer-sGUymL",blockTitleContainer:"blockTitleContainer-_ayaxc",blockTitle:"blockTitle-p5J1JM",blockSubTitle:"blockSubTitle-b49Pjc",inlineContainer:"inlineContainer-pdOZS_",inlineText:"inlineText-mmZJjI"}},77441:function(e,t,n){n(4006),n(17402),n(15734),n(82519),n(84605),n(86500),n(35369),n(76977),n(45859),n(50874)},21258:function(e,t,n){n.d(t,{K:()=>y});var o=n(69277),r=n(70408),u=n(4006),c=n(38314),a=n(30111),i=n(32485),s=n.n(i),l=n(17402),d=n(82519),f=n(68104),p=n(65915),m=n(24914),h=n(12815),b=n(17028),g=n(97684),_=n(24311);function y(e){let{options:t,value:n,onChange:i,placeholder:y,max:T,disabled:S,onCreate:C,isCreateOptionValid:w,openOnFocus:k}=e,L=null!=T&&n.length>=T,{inputValue:x,trimmedInputValue:D,filteredOptions:B,handleInputChange:R,showCreateOption:A,noResults:U,processSelectionValue:E}=(0,h.B)({options:t,onCreate:C,isCreateOptionValid:w,hasReachedMax:L}),{refs:I,floatingStyles:O,context:G}=(0,c.we)(m.Oo),H=(0,c.iQ)(G),{getReferenceProps:W,getFloatingProps:N}=(0,c.bv)([H]),Y=(0,l.useRef)(null),K=(0,l.useRef)(null),j=new Map(t.map(e=>[e.value,e.label])),q=new Set(n),F=n.length>0,M=e=>{let t=""===x&&n.length>0;"Backspace"===e.key&&t&&(e.preventDefault(),i(n.slice(0,-1)))},J=async e=>{null!=T&&e.length>T||E(e[e.length-1],t=>{null!==t&&i(e.filter(e=>!(0,m.gn)(e)))})};return(0,u.Y)(a.G,{multiple:!0,value:n,onChange:J,disabled:S,children:e=>{let{open:t}=e;return(0,u.FD)(b.fI,{position:"relative",children:[(0,u.FD)(b.fI,(0,r._)((0,o._)({ref:I.setReference},W()),{flex:"grow",alignItems:"center",className:s()(g.A.inputBox,_.A.input,_.A.inputText,F&&g.A.hasChips,S&&g.A.disabled),onClick:()=>{var e;null==(e=Y.current)||e.focus()},children:[n.map(e=>(0,u.Y)(v,{children:(0,u.Y)(p.v,{onClick:()=>{var t;i(n.filter(t=>e!==t)),null==(t=Y.current)||t.focus()},trailing:(0,u.Y)(f.A,{color:"var(--color-fg-tertiary)"}),disabled:S,children:j.get(e)})},String(e))),(0,u.Y)(a.G.Input,{ref:Y,autoComplete:"off",className:s()("pencraft",g.A.input,S&&g.A.disabled),onChange:R,onKeyDown:M,onFocus:k?()=>{var e;t||null==(e=K.current)||e.click()}:void 0,value:x,placeholder:F?void 0:y}),(0,u.Y)(a.G.Button,{ref:K,className:g.A.button,children:e=>{let{disabled:t}=e;return(0,u.Y)(d.A,{color:t?"var(--color-fg-tertiary)":void 0})}})]})),t&&(0,u.FD)(a.G.Options,(0,r._)((0,o._)({ref:I.setFloating,style:O},N()),{static:!0,className:s()(g.A.options,U&&g.A.empty),children:[B.slice(0,m.DT).map(e=>{let t=L&&!q.has(e.value),n=q.has(e.value);return(0,u.Y)(m.jO,{option:e,isDisabled:t,isSelected:n},String(e.value))}),A&&(0,u.Y)(m.vS,{inputString:D})]}))]})}})}let v=(0,b.I4)({display:"flex",alignItems:"center",maxHeight:20})},59167:function(e,t,n){n.d(t,{h:()=>u});var o=n(16291);function r(e){var t;let n=[e.is_primary,(null==(t=e.publication)?void 0:t.author_id)===e.user_id,"admin"===e.role,"contributor"===e.role].map(e=>e?"0":"1").join("");return"".concat(n,"-").concat((0,o.A)(e.created_at).valueOf())}function u(e){return e.slice(0).sort((e,t)=>r(e)>r(t)?1:-1)}},10591:function(e,t,n){n.d(t,{F$:()=>L,HT:()=>A,I:()=>k,Je:()=>U,Lo:()=>E,_C:()=>v,dL:()=>C,fq:()=>R,iu:()=>D,oG:()=>T,pb:()=>w,uP:()=>S,vm:()=>x,vq:()=>B});var o=n(79785),r=n(98111),u=n(4016),c=n(39318),a=n(49807),i=n(82776),s=n(57324),l=n(33333),d=n(4518);function f(){let e=(0,o._)(["Start writing today. Use the button below to create a Substack of your own"]);return f=function(){return e},e}function p(){let e=(0,o._)(["Share ",""]);return p=function(){return e},e}function m(){let e=(0,o._)(["Get ","% off a group subscription"]);return m=function(){return e},e}function h(){let e=(0,o._)(["Get a group subscription"]);return h=function(){return e},e}function b(){let e=(0,o._)(["Give a gift subscription"]);return b=function(){return e},e}function g(){let e=(0,o._)(["","! Subscribe for free to receive new posts and support my work."]);return g=function(){return e},e}function _(){let e=(0,o._)(["",". To receive new posts and support my work, consider becoming a free or paid subscriber."]);return _=function(){return e},e}function y(){let e=(0,o._)(["","! This post is public so feel free to share it."]);return y=function(){return e},e}function v(e){let{i18nFactory:t}=e;return e=>(n,o)=>{let{iString:u}=t({pub:e});if(!n.schema.nodes.button)return console.error("Button node type not found in schema"),!1;if(!(0,d.c)(n,n.schema.nodes.button))return!1;let c={url:"".concat(r.T.CHECKOUT_URL,"&donate=true"),text:u("Donate Subscriptions")};return o&&o((0,l.DL)(n,n.schema.nodes.button.create(c))),!0}}function T(e){let{i18nFactory:t}=e;return e=>(n,o)=>{let{iString:u}=t({pub:e});if(!n.schema.nodes.button)return console.error("Button node type not found in schema"),!1;if(!(0,d.c)(n,n.schema.nodes.button))return!1;let c={url:"".concat(r.T.LEADERBOARD_URL,"&utm_source=").concat(s.VU.post),text:u("Refer a friend")};return o&&o((0,l.DL)(n,n.schema.nodes.button.create(c))),!0}}function S(e){let{i18nFactory:t}=e;return e=>{let{writerReferralCode:n,publication:o,postId:r}=e;return(e,u)=>{let{iString:a,iTemplate:i}=t({pub:o});if(!e.schema.nodes.button)return console.error("Button node type not found in schema"),!1;if(!e.schema.nodes.captionedWriterReferralButton)return console.error("captionedWriterReferralButton node type not found in schema"),!1;if(!e.schema.nodes.ctaCaption)return console.error("ctaCaption node type not found in schema"),!1;if(!(0,d.c)(e,e.schema.nodes.button))return!1;let p=i(f()),m={url:"".concat((0,c.gWk)(n||""),"?utm_source=").concat(s.VU.substack,"&utm_context=").concat(s.rw.post,"&utm_content=").concat(r,"&utm_campaign=").concat(s._9.writerReferralButton),text:a("Start a Substack")},h=e.schema.nodes.captionedWriterReferralButton.create(m,e.schema.nodes.ctaCaption.create(null,[e.schema.text(p)]));return u&&u((0,l.DL)(e,h)),!0}}}function C(e){let{i18nFactory:t}=e;return e=>(n,o)=>{let{iString:u}=t({pub:e});if(!n.schema.nodes.button)return console.error("Button node type not found in schema"),!1;if(!(0,d.c)(n,n.schema.nodes.button))return!1;let c={url:r.T.HALF_MAGIC_COMMENTS_URL,text:u("Leave a comment")};return o&&o((0,l.DL)(n,n.schema.nodes.button.create(c))),!0}}function w(e){let{trackReaderSurveyLinkedInPost:t}=e;return(e,n,o)=>(r,u)=>{if(t({editorVersion:"1",surveyId:n.id}),!r.schema.nodes.button)return console.error("Button node type not found in schema"),!1;if(!(0,d.c)(r,r.schema.nodes.button))return!1;let c={url:"".concat((0,a.gAK)(e,n.id)),text:o};return u&&u((0,l.DL)(r,r.schema.nodes.button.create(c))),!0}}function k(e){let{i18nFactory:t}=e;return e=>(n,o)=>{let{iString:u}=t({pub:e});if(!n.schema.nodes.button)return console.error("Button node type not found in schema"),!1;if(!(0,d.c)(n,n.schema.nodes.button))return!1;let c={url:r.T.SHARE_URL,text:u("Share")};return o&&o((0,l.DL)(n,n.schema.nodes.button.create(c))),!0}}function L(e){let{i18nFactory:t}=e;return e=>(n,o)=>{let{iTemplate:u}=t({pub:e});if(!n.schema.nodes.button)return console.error("Button node type not found in schema"),!1;if(!(0,d.c)(n,n.schema.nodes.button))return!1;let c={url:r.T.SHARE_PUB_URL,text:u(p(),e.name)};return o&&o((0,l.DL)(n,n.schema.nodes.button.create(c))),!0}}function x(e){let{i18nFactory:t}=e;return e=>{let{couponPub:n,scrollParent:o,parentClass:r,get_coupons:u,insert_coupon:a,SelectField:i,openPrompt:s,closePrompt:l,getNetworkErrorMessage:f}=e;return(e,p,m)=>{let{iString:h}=t({pub:n});if(!e.schema.nodes.button)return console.error("Button node type not found in schema"),!1;if(!(0,d.c)(e,e.schema.nodes.button))return!1;let b={parentClass:r,root:o?document.querySelector(".".concat(o)):null==m?void 0:m.dom.parentNode,scrollParent:o,offsetTop:10},g=Object.assign({title:h("Loading..."),no_buttons:!0,language:n.language},b);return s(g),u().then(t=>{l(g);let o=t.map(e=>{var t;return{label:null!=(t=e.name)?t:"",value:e}}).concat([{label:h("Create new offer"),value:{create_new:!0}}]),r={coupon:new i({label:h("Select offer..."),required:!0,options:o,onChange:e=>{e&&"create_new"in e&&e.create_new&&(l(u),window.open("".concat((0,c.$_T)(n),"/publish/offers"),"_blank"))}})},u=Object.assign({title:h("Special Offer"),fields:r,language:null==n?void 0:n.language,onSubmit:t=>{let{coupon:n}=t;m?a({coupon:n,state:e,dispatch:m.dispatch,schema:e.schema}):console.warn("no EditorView, cannot insert coupon")},onClose:()=>{m?m.focus():console.warn("no EditorView, cannot focus in get_coupon")}},b);s(u)}).catch(e=>{l(g),alert(f(e))}),!1}}}function D(e){let{i18nFactory:t}=e;return e=>{let{scrollParent:n,parentClass:o,TextField:c,openPrompt:a,publication:i}=e;return(e,s,f)=>{let{iString:p}=t({pub:i});if(!e.schema.nodes.button)return console.error("Button node type not found in schema"),!1;if(!(0,d.c)(e,e.schema.nodes.button))return!1;let m={parentClass:o,title:p("Create a button"),root:n?document.querySelector(".".concat(n)):null==f?void 0:f.dom.parentNode,scrollParent:n,offsetTop:10,language:null==i?void 0:i.language,fields:{text:new c({label:p("Enter text..."),required:!0,clean:e=>(e||"").trim(),validate:e=>{if(e.length>40)return p("Too long")}}),href:new c({label:p("Enter URL..."),required:!0,clean:e=>(e||"").trim(),validate:e=>{if(!/^%%.*%%$/.test(e)){try{let t=new URL(e);if(["http:","https:","mailto:"].includes(t.protocol))return}catch(e){}return p("Invalid URL")}}})}};return m.onSubmit=t=>{let n=t.href;if((0,u.lu)({pub:i})){let[e,t]=n.split("#"),o=e.includes("?")?"&":"?",u=[n.includes("utm_source")?"":"utm_source=custom_button",n.includes("utm_medium")?"":"utm_medium=".concat(r.T.SEND_MEDIUM),n.includes("utm_campaign")?"":"utm_campaign=".concat(r.T.POST_ID)].filter(Boolean).join("&"),c=u?"".concat(o).concat(u):"";n="".concat(e).concat(c).concat(t?"#".concat(t):"")}let o={url:n,text:t.text};if(!e.schema.nodes.button)return console.error("Button node type not found in schema"),!1;s&&f&&f.dispatch((0,l.DL)(e,e.schema.nodes.button.create(o)))},m.onClose=()=>{null==f||f.focus()},a(m),!0}}}function B(e){let{i18nFactory:t}=e;return e=>{let{publication:n}=e;return(e,o)=>{let{iTemplate:u}=t({pub:n});if(!e.schema.nodes.button)return console.error("Button node type not found in schema"),!1;if(!(0,d.c)(e,e.schema.nodes.button))return!1;let c=n.default_group_coupon,a={url:"".concat(r.T.CHECKOUT_URL,"group=true").concat(c?"&coupon=".concat(c):""),text:(0,i.getSubscriptionSentenceWithCustomWords)(n,()=>{var e;return c&&n.default_group_coupon_percent_off?u(m(),null!=(e=n.default_group_coupon_percent_off.split(".")[0])?e:""):u(h())},e=>c&&n.default_group_coupon_percent_off?"Get ".concat(n.default_group_coupon_percent_off.split(".")[0],"% off a group ").concat(e.subscription):"Get a group ".concat(e.subscription))};return o&&o((0,l.DL)(e,e.schema.nodes.button.create(a))),!0}}}function R(e){let{i18nFactory:t}=e;return e=>(n,o)=>{let{iTemplate:u}=t({pub:e});if(!n.schema.nodes.button)return console.error("Button node type not found in schema"),!1;if(!(0,d.c)(n,n.schema.nodes.button))return!1;let c={url:"".concat(r.T.CHECKOUT_URL,"&gift=true"),text:(0,i.getSubscriptionSentenceWithCustomWords)(e,()=>u(b()),e=>"Give a gift ".concat(e.subscription))};return o&&o((0,l.DL)(n,n.schema.nodes.button.create(c))),!0}}function A(){return e=>(t,n)=>{if(!t.schema.nodes.button)return console.error("Button node type not found in schema"),!1;if(!(0,d.c)(t,t.schema.nodes.button))return!1;let o={url:r.T.CHECKOUT_URL,text:(0,i.getSubscribeText)(e,{now:!0}),language:e.language};return n&&n((0,l.DL)(t,t.schema.nodes.button.create(o))),!0}}function U(e){let{i18nFactory:t}=e;return e=>(n,o)=>{let{iTemplate:u}=t({pub:e});if(!n.schema.nodes.button)return console.error("Button node type not found in schema"),!1;if(!n.schema.nodes.subscribeWidget)return console.error("subscribeWidget node type not found in schema"),!1;if(!n.schema.nodes.ctaCaption)return console.error("ctaCaption node type not found in schema"),!1;if(!(0,d.c)(n,n.schema.nodes.button))return!1;let c="enabled"!==e.payments_state?u(g(),e.author_name===e.name?"Thanks for reading":"Thanks for reading ".concat(e.name)):u(_(),e.author_name===e.name?"This Substack is reader-supported":"".concat(e.name," is a reader-supported publication")),a={url:r.T.CHECKOUT_URL,text:(0,i.getSubscribeText)(e),language:e.language},s=n.schema.nodes.subscribeWidget.create(a,[n.schema.nodes.ctaCaption.create(null,[n.schema.text(c)])]);return o&&o((0,l.DL)(n,s)),!0}}function E(e){let{i18nFactory:t}=e;return e=>(n,o)=>{let{iString:u,iTemplate:c}=t({pub:e});if(!n.schema.nodes.button)return console.error("Button node type not found in schema"),!1;if(!n.schema.nodes.captionedShareButton)return console.error("captionedShareButton node type not found in schema"),!1;if(!n.schema.nodes.ctaCaption)return console.error("ctaCaption node type not found in schema"),!1;if(!(0,d.c)(n,n.schema.nodes.button))return!1;let a=c(y(),e.author_name===e.name?"Thanks for reading":"Thanks for reading ".concat(e.name)),i={url:r.T.SHARE_URL,text:u("Share")},s=n.schema.nodes.captionedShareButton.create(i,n.schema.nodes.ctaCaption.create(null,[n.schema.text(a)]));return o&&o((0,l.DL)(n,s)),!0}}},10933:function(e,t,n){n.d(t,{kI:()=>u});var o=n(33333);let r=e=>!(0,o.cy)(e.doc.toJSON(),e=>"paywall"===e.type),u=e=>(t,n)=>{if(!r(t))return!1;let{schema:o,tr:u}=t,a=o.nodes.paywall.create();return 1===u.selection.anchor?c(e)(t,n):(u.insert(u.selection.anchor,a),n&&(n(u),e()),!0)},c=e=>(t,n)=>{if(!r(t))return!1;let{schema:o,tr:u}=t,c=o.nodes.paywall.create(),a=0,i=0;for(;a<10&&i<3;){let e=t.doc.resolve(a).nodeAfter;if(!e)break;a+=e.nodeSize,i++}return u.insert(a,c),n&&(n(u),e()),!0}}}]);