"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["3543"],{93666:function(t,e,i){i.d(e,{Z:()=>u,p:()=>m});var o=i(27412),s=i(7409),n=i(99282),r=i(16584),l=i(6400),a=i(94184),h=i.n(a),d=i(71375),c=i(98914),p=i(15771);class u extends l.Component{componentDidMount(){document.addEventListener("keydown",this.onDocumentKeyDown),this.props.openByDefault&&this.openImmediately()}componentWillUnmount(){document.removeEventListener("keydown",this.onDocumentKeyDown),this._timeout&&clearTimeout(this._timeout)}openImmediately(t){t&&(this._callback=t);let e=document.getElementsByTagName("html")[0];e&&!(0,c.pv)(e,"modal-in")&&(0,c.cn)(e,"modal-in"),this.setState({display:!0,open:!0})}async open(t){t&&(this._callback=t);let e=document.getElementsByTagName("html")[0];e&&!(0,c.pv)(e,"modal-in")&&(0,c.cn)(e,"modal-in"),this.onBeforeOpen(),this.props.onBeforeOpen&&this.props.onBeforeOpen(),await new Promise(t=>{this.setState({display:!0},()=>{this._timeout&&clearTimeout(this._timeout);let e=setTimeout(()=>{this.setState({open:!0},()=>{this.onOpen(),this.props.onOpen&&this.props.onOpen(),t()})},50);this._timeout=e})})}async close(t){this.isOpen()&&!1!==this.onBeforeClose(t)&&(!this.props.onBeforeClose||!1!==this.props.onBeforeClose(t))&&((0,c.IV)(document.getElementsByTagName("html")[0],"modal-in"),await new Promise(e=>{this.setState({open:!1},()=>{let i=setTimeout(()=>{this.setState({display:!1},()=>{this.onClose(t),this.props.onClose&&this.props.onClose(t),this._callback&&this._callback(t),e()})},750);this._timeout=i})}))}isOpen(){return this.state.open}onClickOuter(t){var e,i;t.stopPropagation(),null===(e=(i=this.props).onClick)||void 0===e||e.call(i,t),!this.props.noExit&&!this.props.noExitOnClick&&this.popup&&(this.noFullscreen||window.innerWidth>540)&&t.target&&this.container&&this.close()}onClickInner(t){var e,i;t.stopPropagation(),null===(e=(i=this.props).onClick)||void 0===e||e.call(i,t)}render(t,e){let i=this.state.open?"in":"out",o=!1===this.state.display?"gone":"",l="structured"===this.props.variant,a=!this.state.open;return(0,r.tZ)("div",{className:h()("modal typography",i,o,this.props.className,this.getClassName(),{"has-close-pill":this.props.closePill,"structured-modal":l,popup:this.popup}),inert:a,onClick:t=>this.onClickOuter(t),"data-testid":this.props.testID,role:"dialog",style:this.props.zIndex?{zIndex:this.props.zIndex}:{},children:(0,r.tZ)("div",{className:"modal-table",children:(0,r.tZ)("div",{className:"modal-row",children:(0,r.tZ)("div",{ref:this.assignContent,className:h()("modal-cell modal-content",{"no-fullscreen":this.noFullscreen}),children:(0,r.BX)("div",(0,n._)((0,s._)({className:h()({container:!l}),ref:this.assignContainer,onClick:t=>this.onClickInner(t)},this.props.trackInputsID&&{"data-track-inputs":this.props.trackInputsID}),{children:[!this.props.noExit&&(!this.props.noCloseButton||(0,c.K1)())&&(l?(0,r.tZ)("div",{className:"structured-modal__close-button",children:(0,r.tZ)(p.hU,{"data-testid":"close-modal",priority:"tertiary",onClick:()=>this.close(),children:(0,r.tZ)(d.Z,{size:20,color:"secondary"})})}):(0,r.tZ)(p.hU,{"data-testid":"close-modal",priority:"tertiary",className:h()("modal-btn modal-exit-btn no-margin",{"button btn btn-secondary btn-pill icon-only":this.props.closePill}),onClick:()=>this.close(),children:(0,r.tZ)(d.Z,{size:20,color:"secondary"})})),l?(0,r.BX)("div",{className:"structured-modal__wrapper",children:[(0,r.tZ)("div",{className:"structured-modal__header",children:this.props.modalTitle?(0,r.tZ)("h3",{children:this.props.modalTitle}):(0,r.tZ)("h3",{children:"\xa0"})}),(0,r.tZ)("div",{className:"structured-modal__body",children:(0,r.tZ)("div",{className:"container",children:this.renderChildren(this.props,this.state)})}),this.props.modalFooter&&(0,r.tZ)("div",{className:"structured-modal__footer",children:this.props.modalFooter})]}):this.renderChildren(this.props,this.state)]}))})})})})}getClassName(){}onBeforeOpen(){}onOpen(t){}onBeforeClose(t){}onClose(t){}renderChildren(t,e){let{children:i}=t;return i}constructor(t,e){super(t,e),(0,o._)(this,"popup",void 0),(0,o._)(this,"_timeout",void 0),(0,o._)(this,"_callback",void 0),(0,o._)(this,"content",void 0),(0,o._)(this,"container",void 0),(0,o._)(this,"assignContent",t=>{this.content=t}),(0,o._)(this,"assignContainer",t=>{this.container=t}),(0,o._)(this,"noFullscreen",void 0),(0,o._)(this,"state",void 0),(0,o._)(this,"onDocumentKeyDown",t=>{"Escape"!==t.key||this.props.noExit||(0,c.$Z)(this.base)||this.close()}),this.open=this.open.bind(this),this.close=this.close.bind(this),this.popup=!1,this.state={open:!1,display:!1,callback:null}}}class m extends u{constructor(t,e){super(t,e),this.popup=!0}}},56649:function(t,e,i){i.d(e,{D:()=>n});var o=i(16584),s=i(58175);let n=t=>{let{errors:e}=t;return e?(0,o.tZ)(o.HY,{children:e.map(t=>(0,o.tZ)(s.xv.B4,{color:"error",children:t},t))}):null}},82876:function(t,e,i){i.d(e,{g:()=>C});var o=i(16584),s=i(98661),n=i(94184),r=i.n(n),l=i(27412),a=i(6400),h=i(14293),d=i.n(h),c=i(60807),p=i(98914);let u={portalWrapper:"portalWrapper-bzvNNv",contentWrapper:"contentWrapper-Ej3nCx",contentWrapperShown:"contentWrapperShown-aSNUOg"};class m extends a.Component{onMouseEnter(){if(!this.props.disabled){if(this.closePid&&clearTimeout(this.closePid),this.setState({attachCard:!0}),0===this.props.delay){this.setIsShown(!0);return}"undefined"!=typeof window&&(this.hoverPid=window.setTimeout(()=>{this.setIsShown(!0),this.hoverPid=null},this.props.delay))}}onMouseLeave(){this.hoverPid&&clearTimeout(this.hoverPid),"undefined"!=typeof window&&(this.closePid=window.setTimeout(()=>{this.setIsShown(!1)},100))}setIsShown(t){this.setState({isOpen:t,attachCard:t})}onClick(t){t.stopPropagation()}render(t,e){var i,n,l,a;let{content:h,preferPositionLeft:c,className:m,children:v}=t,{attachCard:f,isOpen:y}=e,g={},C=!1;if(f&&(null===(i=this.wrapperRef)||void 0===i?void 0:i.current)){let{top:t,left:e}=this.wrapperRef.current.getBoundingClientRect(),{height:i,width:o}=null!==(l=null===(n=this.cardRef.current)||void 0===n?void 0:n.getBoundingClientRect())&&void 0!==l?l:{};g=(C=c&&!d()(o)&&e-o>0)?{top:d()(i)?NaN:t-8-i,left:d()(o)?NaN:e-o-8,"max-width":300}:{top:d()(i)?NaN:t-8-i,"max-width":300,left:e}}return(0,o.BX)("div",{className:r()(u.portalWrapper,m),onMouseEnter:()=>this.onMouseEnter(),onMouseLeave:()=>this.onMouseLeave(),onClick:t=>this.onClick(t),ref:this.wrapperRef,children:["function"==typeof v?v({}):v,f&&(0,s.createPortal)((0,o.tZ)("div",{className:r()(u.contentWrapper,{[null!==(a=u.contentWrapperShown)&&void 0!==a?a:"undefined"]:y,"animate-opacity":!(0,p.G6)(),"position-left":C}),ref:this.cardRef,style:g,onMouseEnter:()=>this.onMouseEnter(),onMouseLeave:()=>this.onMouseLeave(),children:h}),document.body)]})}constructor(t,e){super(t,e),(0,l._)(this,"cardRef",void 0),(0,l._)(this,"hoverPid",void 0),(0,l._)(this,"closePid",void 0),(0,l._)(this,"wrapperRef",void 0),this.cardRef=(0,a.createRef)(),this.state={isOpen:!1},this.hoverPid=null,this.closePid=null,this.wrapperRef=(0,a.createRef)()}}(0,l._)(m,"defaultProps",{delay:100}),(0,l._)(m,"contextType",c.St);let v=t=>{let{content:e}=t;return(0,o.tZ)(m,{content:e,children:(0,o.tZ)("div",{className:"learnMoreChip-xHgw90",children:"?"})})};var f=i(19081),y=i(56649),g=i(58175);let C=(0,s.forwardRef)((t,e)=>{let{action:i,children:s,className:n,errors:l,helpText:a,details:h,label:d,paddingBottom:c,paddingTop:p,flex:u,wrapWithLabel:m,disabled:C,compact:w}=t,_=w?2:8;return(0,o.BX)(f.tu,{ref:e,alignItems:"stretch",className:n,gap:_,paddingBottom:c,paddingTop:p,disabled:C,flex:u,children:[(0,o.BX)(f.tu,{alignItems:"stretch",gap:_,as:m?"label":"div",children:[d&&(0,o.BX)(f.gq,{gap:_,alignItems:"center",children:[(0,o.tZ)(g.xv.B4,{weight:"semibold",as:m?"div":"label",color:"primary",children:d}),a&&(0,o.tZ)(v,{content:a}),i&&(0,o.tZ)(f.gq,{flex:"grow",justifyContent:"end",children:i})]}),s&&(0,o.tZ)("div",{className:r()({"has-error":l}),children:s})]}),h&&!Array.isArray(h)&&(0,o.tZ)(g.xv.B5,{color:"secondary",children:h}),h&&Array.isArray(h)&&h.length>0&&(0,o.tZ)(f.tu,{gap:4,children:h.map(t=>(0,o.tZ)(g.xv.B5,{color:"secondary",children:t}))}),(0,o.tZ)(y.D,{errors:l})]})})},22498:function(t,e,i){i.d(e,{aT:()=>l,cb:()=>n,je:()=>s});var o=i(62092);function s(t,e){let{nodeTypes:i,reverse:o=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r(t,e,{nodeTypes:i,reverse:o})}function n(t,e){let{nodeTypes:i,reverse:o=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r(t,e,{nodeTypes:i,reverse:o})}function r(t,e){var i;let{nodeTypes:s,reverse:n=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(!t)return;s&&!Array.isArray(s)&&(s=[s]);let h=!1;if("type"in t&&t.type&&(s?"string"==typeof t.type&&s.includes(t.type)?h=!0:"string"!=typeof t.type&&"name"in t.type&&s.includes(t.type.name)&&(h=!0):h=!0),"type"in t&&h){let i=e(t,a);if(!1===i||i===l)return i}let d=[];if((0,o.f5)(t))Array.isArray(t.content)&&(d=t.content);else if((null===(i=t.content)||void 0===i?void 0:i.childCount)&&t.content.childCount>0)for(let e=0;e