1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,997796,30083,e=>{"use strict";var t=e.i(95187);let r=(0,t.createServerReference)("407b72ba4adb1243a58f60444f049c8a5200044c4d",t.callServer,void 0,t.findSourceMapURL,"changeMembershipToFree");e.s(["changeMembershipToFree",0,r],997796);let n=(0,t.createServerReference)("40e3ad8178d5e60b6f6aa3a947171af1384c8a16e1",t.callServer,void 0,t.findSourceMapURL,"changeMembership");e.s(["changeMembership",0,n],30083)},701544,860832,920855,e=>{"use strict";var t=e.i(95187);let r=(0,t.createServerReference)("60ba300cd5c6a75e9d2cded3110a3f25771007ccbb",t.callServer,void 0,t.findSourceMapURL,"requestAuthEmailToken");e.s(["requestAuthEmailToken",0,r],701544);let n=(0,t.createServerReference)("70fa35ca005329d35661cebd35b7c2d38e67072c03",t.callServer,void 0,t.findSourceMapURL,"confirmEmailAuthToken");e.s(["confirmEmailAuthToken",0,n],860832);let i=(0,t.createServerReference)("60825453447f51919cc5b6601150989ed38151495b",t.callServer,void 0,t.findSourceMapURL,"loginWithEmailToken");e.s(["loginWithEmailToken",0,i],920855)},72864,e=>{"use strict";var t=e.i(95187);let r=(0,t.createServerReference)("702326e88cc74c7105be6e0a71974a2c498d17b161",t.callServer,void 0,t.findSourceMapURL,"subscribeToPublication");e.s(["subscribeToPublication",0,r])},687258,e=>{"use strict";var t=e.i(95187);let r=(0,t.createServerReference)("00e9f8773b1a166b64aa2cb2e3fa20ade9a922d333",t.callServer,void 0,t.findSourceMapURL,"getViewerOwnedPublications");e.s(["getViewerOwnedPublications",0,r])},519848,e=>{"use strict";var t=e.i(95187);let r=(0,t.createServerReference)("7c8a54b0893288abe888f1c7bbca87a86b153cb555",t.callServer,void 0,t.findSourceMapURL,"confirmPublicationEmailSubscription");e.s(["confirmPublicationEmailSubscription",0,r])},906695,e=>{"use strict";var t=e.i(95187);let r=(0,t.createServerReference)("70f31cc1328eab878bcbc94a8e6b24c519874ff001",t.callServer,void 0,t.findSourceMapURL,"requestPublicationEmailSubscription");e.s(["requestPublicationEmailSubscription",0,r])},855476,e=>{"use strict";e.s(["PubListing",()=>u]);var t=e.i(843476),r=e.i(500932),n=e.i(620196),i=e.i(634622),a=e.i(368408),l=e.i(850952),o=e.i(970827),s=e.i(124670),c=e.i(794900);let u=e=>{let u,d,m,p,h,f,b,g,x,y,v,C,w=(0,r.c)(50),j=e.record,S=(0,l.usePubTheme)(j),k=j?.theme?.backgroundImage?.image?.ref?(0,s.blobRefToSrc)(j?.theme?.backgroundImage?.image?.ref,new n.AtUri(e.uri).host):null,N=j?.theme?.backgroundImage?.repeat,_=j?.theme?.backgroundImage?.width||500;if(!j)return null;w[0]!==e.uri||w[1]!==j.icon?(u=j.icon?(0,s.blobRefToSrc)(j.icon.ref,new n.AtUri(e.uri).host):void 0,w[0]=e.uri,w[1]=j.icon,w[2]=u):u=w[2];let P=u,R=`no-underline! flex flex-row gap-2 2 ${e.compact?"grow":""} 3 bg-bg-leaflet 4 border border-border-light rounded-lg 5 px-3 py-3 selected-outline 6 outline-transparent 7 hover:outline-accent-contrast hover:border-accent-contrast 8 relative overflow-hidden `,U=`url(${k})`,M=N?"repeat":"no-repeat",E=`${N?`${_}px`:"cover"}`;w[3]!==U||w[4]!==M||w[5]!==E?(d={backgroundImage:U,backgroundRepeat:M,backgroundSize:E},w[3]=U,w[4]=M,w[5]=E,w[6]=d):d=w[6],w[7]!==e.disableLinks||w[8]!==j.url?(m=!e.disableLinks&&(0,t.jsx)("a",{href:j.url,className:"absolute inset-0 z-[1]"}),w[7]=e.disableLinks,w[8]=j.url,w[9]=m):m=w[9];let L=`flex w-full flex-col justify-center text-center ${e.compact?"p-2 pb-3":"pt-4 pb-3 px-3"} rounded-lg relative ${e.constrainHeight?"sm:h-[200px] h-full":e.compact?"h-full":"h-fit"} ${j.theme?.showPageBackground?"bg-[rgba(var(--bg-page),var(--bg-page-alpha))] ":""} ${e.className}`;w[10]!==P||w[11]!==e.compact||w[12]!==e.constrainHeight||w[13]!==j.name?(p=e.compact?(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-center justify-center py-1 min-w-0",children:[(0,t.jsx)(i.PubIcon,{icon:P,pubName:j.name}),(0,t.jsx)("h4",{className:"truncate w-full min-w-0",children:j.name})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"mx-auto pb-1",children:(0,t.jsx)(i.PubIcon,{icon:P,pubName:j.name,large:!0})}),(0,t.jsx)("h4",{className:`${e.constrainHeight?"truncate":""} shrink-0 `,children:j.name})]}),w[10]=P,w[11]=e.compact,w[12]=e.constrainHeight,w[13]=j.name,w[14]=p):p=w[14],w[15]!==e.compact||w[16]!==e.constrainHeight||w[17]!==j.description?(h=j.description&&(0,t.jsx)("p",{className:`text-secondary ${e.compact?"line-clamp-3":e.constrainHeight?"line-clamp-1":""} min-h-[16px] text-sm overflow-hidden `,children:j.description}),w[15]=e.compact,w[16]=e.constrainHeight,w[17]=j.description,w[18]=h):h=w[18];let A=e.authorProfile?.handle;return w[19]!==A?(f=(0,t.jsx)("div",{className:"flex flex-row gap-2 items-center",children:A}),w[19]=A,w[20]=f):f=w[20],w[21]!==e.compact||w[22]!==e.documents_in_publications?(b=!e.compact&&e.documents_in_publications?.[0]?.documents?.sort_date&&(0,t.jsxs)("p",{children:["Updated"," ",(0,c.timeAgo)(e.documents_in_publications[0].documents.sort_date)]}),w[21]=e.compact,w[22]=e.documents_in_publications,w[23]=b):b=w[23],w[24]!==f||w[25]!==b?(g=(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center text-xs text-tertiary pt-1",children:[f,b]}),w[24]=f,w[25]=b,w[26]=g):g=w[26],w[27]!==e.compact||w[28]!==e.publication_newsletter_settings?.enabled||w[29]!==e.showSubscribeButton||w[30]!==e.subscribeSource||w[31]!==e.uri||w[32]!==j.description||w[33]!==j.name||w[34]!==j.url?(x=e.showSubscribeButton&&(0,t.jsx)("div",{className:`${e.compact?"mt-2":"mt-3"} max-w-sm mx-auto relative z-[2] w-fit`,children:(0,t.jsx)(a.SubscribeButton,{publicationUri:e.uri,publicationUrl:j.url,publicationName:j.name,publicationDescription:j.description,newsletterMode:e.publication_newsletter_settings?.enabled??!1,source:e.subscribeSource})}),w[27]=e.compact,w[28]=e.publication_newsletter_settings?.enabled,w[29]=e.showSubscribeButton,w[30]=e.subscribeSource,w[31]=e.uri,w[32]=j.description,w[33]=j.name,w[34]=j.url,w[35]=x):x=w[35],w[36]!==g||w[37]!==x||w[38]!==L||w[39]!==p||w[40]!==h?(y=(0,t.jsxs)("div",{className:L,children:[p,h,g,x]}),w[36]=g,w[37]=x,w[38]=L,w[39]=p,w[40]=h,w[41]=y):y=w[41],w[42]!==R||w[43]!==y||w[44]!==d||w[45]!==m?(v=(0,t.jsxs)("div",{className:R,style:d,children:[m,y]}),w[42]=R,w[43]=y,w[44]=d,w[45]=m,w[46]=v):v=w[46],w[47]!==v||w[48]!==S?(C=(0,t.jsx)(o.BaseThemeProvider,{...S,local:!0,children:v}),w[47]=v,w[48]=S,w[49]=C):C=w[49],C}},123838,e=>{"use strict";e.s(["encodeActionToSearchParam",0,function(e){return encodeURIComponent(JSON.stringify(e))}])},727378,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(274210),i=e.i(696659);let a=(0,r.forwardRef)((e,a)=>{let{id:l,icon:o,label:s,primary:c,secondary:u,active:d,labelOnMobile:m,subtext:p,className:h,...f}=e,b=(0,r.useContext)(n.SidebarContext),g=(0,r.useContext)(i.PopoverOpenContext);return(0,r.useEffect)(()=>
8{if(g)return b.setChildForceOpen(!0),()=>{b.setChildForceOpen(!1)}},[b,g]),(0,t.jsxs)("button",{...f,ref:a,className:` 9 actionButton relative shrink-0 10 h-fit 11 rounded-md border 12 py-0.5 px-1 13 flex gap-2 items-start justify-start 14 sm:w-full sm:max-w-full ${m?"w-full":"w-fit"} 15 outline-2 outline-transparent outline-offset-1 16 17 ${c?"bg-accent-1 border-accent-1 text-accent-2 sm:hover:outline-accent-contrast focus:outline-accent-1 font-bold":u?"border-accent-contrast sm:hover:outline-accent-contrast focus:outline-accent-1 text-accent-contrast hover:border-accent-contrast focus:border-accent-contrast font-bold":"border-transparent text-secondary sm:hover:border-border justify-start! max-w-full"} 18 ${d?"bg-bg-page! border-border-light!":""} 19 ${h} 20 `,children:[(0,t.jsx)("div",{className:`shrink-0 flex flex-row gap-0.5 ${!c&&!u&&"text-secondary sm:text-tertiary"}`,children:o}),(0,t.jsxs)("div",{className:`w-fill flex flex-col ${p&&"leading-snug"} sm:max-w-full min-w-0 mr-1 ${b.open?"block":m?"sm:hidden block":"hidden"}`,children:[(0,t.jsx)("div",{className:"truncate text-left",children:s}),p&&(0,t.jsx)("div",{className:`text-xs ${u?"text-accent-contrast":"text-tertiary"} font-normal text-left`,children:p})]})]})});a.displayName="ActionButton",e.s(["ActionButton",0,a])},634622,e=>{"use strict";e.s(["PubIcon",()=>v,"PubListEmptyContent",()=>y,"PubListEmptyIllo",()=>C,"PublicationButtons",()=>g]);var t=e.i(843476),r=e.i(271645),n=e.i(500932),i=e.i(806398),a=e.i(885718),l=e.i(250209),o=e.i(620196),s=e.i(727378),c=e.i(314192),u=e.i(899169),d=e.i(124670),m=e.i(69278),p=e.i(650470),h=e.i(671473),f=e.i(283599),b=e.i(31234);let g=e=>{let r,a,l,o,c,d,m,h,b,g,x,v=(0,n.c)(25),{identity:C}=(0,i.useIdentityData)(),_=!!C?.permission_token_on_homepage.find(w);v[0]===Symbol.for("react.memo_cache_sentinel")?(r={fallbackData:[]},v[0]=r):r=v[0];let{data:P}=(0,f.default)("leaflets",j,r),R=C?C.permission_token_on_homepage.length>0:P.filter(S).length>0;v[1]!==C?.publications?(a=C?.publications??[],v[1]=C?.publications,v[2]=a):a=v[2];let U=a;v[3]!==C?.contributor_publications?(l=C?.contributor_publications??[],v[3]=C?.contributor_publications,v[4]=l):l=v[4];let M=l;v[5]!==U?(o=new Set(U.map(k)),v[5]=U,v[6]=o):o=v[6];let E=o;if(v[7]!==M||v[8]!==U||v[9]!==E){let e;v[11]!==E?(e=e=>!E.has(e.uri),v[11]=E,v[12]=e):e=v[12],c=[...U,...M.filter(e)],v[7]=M,v[8]=U,v[9]=E,v[10]=c}else c=v[10];let L=c;if(!_&&R&&0===L.length){let e;return v[13]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(y,{}),v[13]=e):e=v[13],e}if(!_&&!R&&0===L.length)return null;v[14]===Symbol.for("react.memo_cache_sentinel")?(d=(0,t.jsx)("hr",{className:"border-border-light mt-2"}),v[14]=d):d=v[14];let A=`pubListWrapper w-full flex flex-col gap-1 -mt-1 sm:bg-transparent grow overflow-y-auto min-h-0 py-2 21 ${e.className}`;return v[15]===Symbol.for("react.memo_cache_sentinel")?(m=(0,t.jsx)("div",{className:"text-tertiary uppercase text-sm px-1",children:"PUBLICATIONS"}),v[15]=m):m=v[15],v[16]!==_?(h=_&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.SpeedyLink,{eager:!0,href:"/looseleafs",className:" hover:no-underline! ",children:(0,t.jsx)(s.ActionButton,{labelOnMobile:!0,label:"Looseleafs",icon:(0,t.jsx)(p.LooseLeafSmall,{})})}),(0,t.jsx)("hr",{className:"border-border-light border-dashed my-1"})]}),v[16]=_,v[17]=h):h=v[17],v[18]!==L?(b=L.map(N),v[18]=L,v[19]=b):b=v[19],v[20]===Symbol.for("react.memo_cache_sentinel")?(g=(0,t.jsx)(u.SpeedyLink,{href:"/lish/createPub",className:"pubListCreateNew no-underline!",children:(0,t.jsx)(s.ActionButton,{labelOnMobile:!0,icon:(0,t.jsx)("div",{className:"group-hover/new-pub:border-accent-contrast m-0.5 w-5 h-5 border-border border-2 border-dashed rounded-full"}),label:"New Publication",className:"text-tertiary!"})}),v[20]=g):g=v[20],v[21]!==A||v[22]!==h||v[23]!==b?(x=(0,t.jsxs)(t.Fragment,{children:[d,(0,t.jsxs)("div",{className:A,children:[m,h,b,g]})]}),v[21]=A,v[22]=h,v[23]=b,v[24]=x):x=v[24],x},x=e=>{let r,i,a,m,p,h,f,b,g,x,y,C,w,j,S=(0,n.c)(28),k=e.record;if(S[0]!==e){y=Symbol.for("react.early_return_sentinel");e:{if(!(m=(0,c.normalizePublicationRecord)(k))){y=void 0;break e}a=u.SpeedyLink,b=e.eager,g=`${(0,l.getBasePublicationURL)(e)}/dashboard`,x="hover:no-underline! ",i=s.ActionButton,h=!0,f=m.name,r=v,p=m.icon?(0,d.blobRefToSrc)(m.icon.ref,new o.AtUri(e.uri).host):void 0}S[0]=e,S[1]=r,S[2]=i,S[3]=a,S[4]=m,S[5]=p,S[6]=h,S[7]=f,S[8]=b,S[9]=g,S[10]=x,S[11]=y}else r=S[1],i=S[2],a=S[3],m=S[4],p=S[5],h=S[6],f=S[7],b=S[8],g=S[9],x=S[10],y=S[11];if(y!==Symbol.for("react.early_return_sentinel"))return y;S[12]!==r||S[13]!==m.name||S[14]!==p?(C=(0,t.jsx)(r,{icon:p,pubName:m.name}),S[12]=r,S[13]=m.name,S[14]=p,S[15]=C):C=S[15];let N=` ${e.className}`;return S[16]!==i||S[17]!==h||S[18]!==f||S[19]!==C||S[20]!==N?(w=(0,t.jsx)(i,{labelOnMobile:h,label:f,icon:C,className:N}),S[16]=i,S[17]=h,S[18]=f,S[19]=C,S[20]=N,S[21]=w):w=S[21],S[22]!==a||S[23]!==w||S[24]!==b||S[25]!==g||S[26]!==x?(j=(0,t.jsx)(a,{eager:b,href:g,className:x,children:w}),S[22]=a,S[23]=w,S[24]=b,S[25]=g,S[26]=x,S[27]=j):j=S[27],j},y=e=>{let r,a,l,o=(0,n.c)(4),{identity:s}=(0,i.useIdentityData)();return o[0]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("div",{className:"mx-auto pt-2 scale-90",children:(0,t.jsx)(C,{})}),a=(0,t.jsx)("div",{className:"pt-1 font-bold",children:"Publish on the Atmosphere"}),o[0]=r,o[1]=a):(r=o[0],a=o[1]),o[2]!==s?(l=(0,t.jsxs)("div",{className:"accent-container w-full rounded-md flex flex-col text-center justify-center p-2 pb-4 mt-2",children:[r,a,s&&s.atp_did?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"pb-3 text-secondary text-sm",children:"Start a new publication, newsletter, or blog on the Atmosphere!"}),(0,t.jsx)(u.SpeedyLink,{href:"lish/createPub",className:" hover:no-underline!",children:(0,t.jsx)(m.ButtonSecondary,{className:" mx-auto ",compact:!0,children:"Start a Publication!"})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"pb-3 text-secondary text-sm",children:"Start a new publication, newsletter, or blog on the Atmosphere!"}),(0,t.jsx)(h.LoginModal,{noEmailLogin:!0,asChild:!0,trigger:(0,t.jsxs)(m.ButtonPrimary,{compact:!0,className:"mx-auto text-sm!",children:[s?"Link to":"Log in with"," Atmosphere"]})})]})]}),o[2]=s,o[3]=l):l=o[3],l},v=e=>{let r,i=(0,n.c)(8),a=`${e.tiny?"w-4 h-4":e.small?"w-5 h-5":e.large?"w-12 h-12":e.xl?"w-20 h-20":"w-6 h-6"} rounded-full shrink-0`;return i[0]!==a||i[1]!==e.className||i[2]!==e.icon||i[3]!==e.large||i[4]!==e.pubName||i[5]!==e.tiny||i[6]!==e.xl?(r=e.icon?(0,t.jsx)("div",{className:`${a} ${e.className} relative overflow-hidden shrink-0`,children:(0,t.jsx)("img",{src:e.icon,alt:`${e.pubName?e.pubName:"publication"} icon`,loading:"lazy",fetchPriority:"low",className:"absolute inset-0 w-full h-full object-cover object-center"})}):(0,t.jsx)("div",{className:`${a} ${e.className} bg-accent-1 relative`,children:(0,t.jsx)("div",{className:`${e.tiny?"text-xs":e.large?"text-2xl":e.xl?"text-4xl":"text-sm"} font-bold absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-accent-2 shrink-0`,children:e.pubName?e.pubName.slice(0,1).toUpperCase():"P"})}),i[0]=a,i[1]=e.className,i[2]=e.icon,i[3]=e.large,i[4]=e.pubName,i[5]=e.tiny,i[6]=e.xl,i[7]=r):r=i[7],r},C=()=>{let e,r,i=(0,n.c)(2);return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsxs)("g",{clipPath:"url(#clip0_1288_1607)",children:[(0,t.jsx)("path",{d:"M38.6621 26.0839C42.9399 28.2494 44.7287 33.455 42.6545 37.8247C40.5473 42.2636 35.1643 42.2021 31.0309 38.7504C26.8976 35.2986 17.5208 36.7293 13.0951 34.6285C8.66952 32.5277 1.04647 23.5131 3.1536 19.0741C5.26079 14.6351 11.6868 11.9665 16.1124 14.0673C20.5381 16.1681 38.4564 25.9829 38.4564 25.9829L38.6621 26.0839Z",fill:a.theme.colors["bg-page"]}),(0,t.jsx)("path",{d:"M44.0793 31.0064C44.7178 30.7014 45.4832 30.9723 45.7882 31.6108L48.1886 36.6362C48.4936 37.2747 48.2236 38.0402 47.5851 38.3452C46.9466 38.6502 46.1811 38.3792 45.8761 37.7407L43.4757 32.7153C43.1708 32.0769 43.4409 31.3114 44.0793 31.0064ZM47.6769 29.396C48.1531 28.8729 48.9632 28.8351 49.4865 29.311L56.049 35.2827C56.5
21724 35.7589 56.6111 36.5689 56.1349 37.0923C55.6587 37.6156 54.8487 37.6534 54.3254 37.1772L47.7629 31.2065C47.2395 30.7303 47.2007 29.9194 47.6769 29.396ZM39.717 5.68116C42.0981 4.90017 44.5808 4.94473 46.7375 6.12647C49.3605 7.5638 50.8245 10.3133 51.1896 13.4243C51.5549 16.538 50.8421 20.109 49.0216 23.4312C47.2012 26.7534 44.5751 29.2764 41.7541 30.644C38.9355 32.0105 35.8302 32.2552 33.2072 30.8179C30.9031 29.5552 29.4864 27.1999 28.9464 24.6831C28.8301 24.2474 28.6926 23.8222 28.5343 23.3853C27.9734 24.0541 27.3971 24.5221 26.7863 24.7798C25.6169 25.2729 24.5945 24.8983 23.8361 24.3579C22.7923 23.614 21.7765 22.8095 20.9679 21.9312C20.1616 21.0553 19.5008 20.0411 19.2707 18.8745L19.2629 18.8345C19.1678 18.3542 19.054 17.7817 19.2599 16.8921C19.4384 16.1213 19.8478 15.1379 20.6183 13.6987C19.832 13.0689 19.5569 12.0994 19.592 11.1099C19.6232 10.2278 19.8849 9.24332 20.3722 8.35401C20.8366 7.50662 21.4472 6.74544 22.1593 6.22315C22.8689 5.70275 23.7789 5.35579 24.7511 5.57959C25.3946 5.72772 26.0287 5.9727 26.6593 6.16846C27.3433 5.97648 28.0776 5.95162 28.8185 6.16455C29.2306 6.28299 29.6269 6.46238 30.0373 6.58936C30.7081 6.79695 31.4724 6.98507 32.0539 7.01319C35.195 7.16504 36.6776 6.71358 39.6769 5.69385C39.6901 5.68936 39.7037 5.6851 39.717 5.68116ZM45.7111 7.99951C43.9938 7.05853 41.9923 7.16313 40.1877 7.77588C39.8344 7.90062 39.4783 8.04953 39.1222 8.22217C36.7445 9.37492 34.4283 11.5618 32.7961 14.5405C31.1639 17.5192 30.5672 20.6477 30.8752 23.272C30.9368 23.7972 31.0577 24.2812 31.1691 24.7886C31.6931 26.6779 32.7517 28.1338 34.2336 28.9458C36.091 29.9635 38.4422 29.877 40.8224 28.7231C43.2002 27.5704 45.5163 25.3836 47.1486 22.4048C48.7809 19.4259 49.3775 16.2968 49.0695 13.6724C48.7611 11.0452 47.5685 9.0173 45.7111 7.99951ZM49.9005 26.5269C50.1565 25.8672 50.8991 25.5395 51.5587 25.7954L54.547 26.9556C55.2066 27.2116 55.5333 27.9532 55.2775 28.6128C55.0216 29.2724 54.2799 29.6 53.6203 29.3442L50.632 28.1851C49.9724 27.9291 49.6448 27.1865 49.9005 26.5269ZM39.1652 9.26807C41.2542 8.13629 43.5696 7.82566 45.505 8.88623C47.0749 9.74653 48.0237 11.3117 48.4123 13.1314C48.5106 13.5926 48.2163 14.0465 47.755 14.145C47.2939 14.2433 46.8399 13.949 46.7414 13.4878C46.4268 12.0152 45.7071 10.9451 44.6837 10.3843C43.4283 9.69643 41.7566 9.8068 39.9787 10.77C39.5506 11.0019 39.123 11.2806 38.7023 11.603C40.0255 12.7843 41.0004 14.0292 41.5402 15.2642C42.1439 16.6456 42.2208 18.0723 41.5373 19.3198C40.8549 20.5651 39.5891 21.2565 38.1007 21.4917C36.7655 21.7027 35.1903 21.5621 33.4992 21.1011C33.4542 21.6278 33.4497 22.1372 33.4845 22.6216C33.6295 24.6386 34.4361 26.1074 35.6916 26.7954C36.9471 27.4832 38.6187 27.3719 40.3966 26.4087C42.1654 25.4504 43.9291 23.6955 45.217 21.3452C45.7016 20.4607 46.0801 19.562 46.3556 18.6772C46.496 18.227 46.9746 17.9755 47.425 18.1157C47.8752 18.256 48.1266 18.7347 47.9865 19.1851C47.6767 20.1801 47.2535 21.1839 46.715 22.1665C45.2929 24.7616 43.3083 26.7749 41.2101 27.9116C39.1212 29.0432 36.8056 29.354 34.8703 28.2935C32.9348 27.2329 31.9507 25.1135 31.7804 22.7437C31.6095 20.3635 32.2393 17.6083 33.6613 15.0132C35.0834 12.418 37.067 10.4048 39.1652 9.26807ZM22.297 15.0933C21.7014 16.2428 21.4438 16.9252 21.34 17.3735C21.2375 17.8161 21.2789 18.0251 21.3586 18.4282L21.3654 18.4614C21.4906 19.0963 21.8766 19.7651 22.5392 20.4849C23.1994 21.202 24.0755 21.9061 25.0754 22.6187C25.4732 22.9022 25.706 22.918 25.9572 22.812C26.2951 22.6693 26.8456 22.2264 27.5851 21.0552C27.0094 19.7746 26.4315 18.8074 26.0109 18.3853C25.5581 17.9307 24.9198 17.457 24.3625 17.0815C24.0174 16.8492 23.6334 16.6577 23.3009 16.4087C22.8302 16.056 22.5072 15.5915 22.297 15.0933ZM37.4191 12.7485C36.5848 13.607 35.8111 14.6442 35.1593 15.8335C34.5066 17.0247 34.0481 18.237 33.7736 19.4038C35.3748 19.8612 36.7608 19.9738 37.8341 19.8042C38.9745 19.624 39.6854 19.1451 40.0392 18.4995C40.4026 17.8364 40.4284 16.9858 39.9748 15.9478C39.5441 14.9626 38.6986 13.8621 37.4191 12.7485ZM34.2082 9.14893C33.8924 9.16621 33.5635 9.17537 33.2189 9.17627C33.1388 9.23151 33.0511 9.29794 32.9562 9.37647C32.6169 9.65722 32.2522 10.0395 31.8879 10.479C31.1588 11.3585 30.4955 12.3901 30.1144 13.0855C29.6886 13.8625 29.21 14.8403 28.8732 15.8257C28.5838 16.6724 28.4237 17.4545 28.4445 18.0923C28.6141 18.3652 28.7815 18.6595 28.9445 18.9683C29.2882
2117.1514 29.9462 15.2969 30.923 13.5142C31.8396 11.8415 32.9612 10.371 34.2082 9.14893ZM28.2306 8.22315C27.9953 8.13158 27.6238 8.07071 27.3918 8.1919C26.8031 8.49937 25.6057 9.41 25.0587 10.4204C24.7889 10.919 24.5664 11.6366 24.3986 12.355C24.273 12.8924 24.0375 13.5361 24.1984 14.0757C24.2869 14.3723 24.4121 14.5578 24.5441 14.6704C24.8879 14.8728 25.225 15.0872 25.5558 15.3101C25.9699 15.589 26.4729 15.9497 26.9435 16.3472C27.0299 15.9811 27.1376 15.6205 27.256 15.2739C27.6363 14.1611 28.164 13.0878 28.6154 12.2642C29.0414 11.4867 29.7649 10.3634 30.5724 9.38916C30.6783 9.26141 30.7871 9.1351 30.8976 9.01123C30.3592 8.90738 29.8338 8.76163 29.4064 8.6294C28.8588 8.45993 28.422 8.2968 28.2306 8.22315ZM24.2443 7.65479C24.0745 7.62582 23.8022 7.66603 23.422 7.94483C23.0226 8.23774 22.6009 8.7314 22.2453 9.38037C21.9128 9.98712 21.7449 10.6469 21.7257 11.1851C21.7078 11.6907 21.8192 11.8972 21.842 11.939C21.8441 11.9429 21.8456 11.9461 21.8459 11.9468L22.6076 12.5562C22.6451 12.3681 22.687 12.1695 22.7345 11.9663C22.9122 11.206 23.1764 10.3097 23.5568 9.60694C23.909 8.95632 24.4229 8.35989 24.9357 7.86866L24.2443 7.65479Z",fill:a.theme.colors["accent-1"]})]}),i[0]=e):e=i[0],i[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsxs)("svg",{width:"59",height:"44",viewBox:"0 0 59 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e,(0,t.jsx)("defs",{children:(0,t.jsx)("clipPath",{id:"clip0_1288_1607",children:(0,t.jsx)("rect",{width:"59",height:"44",fill:"white"})})})]}),i[1]=r):r=i[1],r};function w(e){return e.permission_tokens.leaflets_to_documents&&e.permission_tokens.leaflets_to_documents[0]?.document}function j(){return(0,b.getHomeDocs)()}function S(e){return!e.hidden}function k(e){return e.uri}function N(e,t){return(0,r.createElement)(x,{...e,key:e.uri,record:e.record,eager:t<6})}},645522,e=>{"use strict";var t=e.i(843476),r=e.i(500932);let n=e=>{let n,i,a=(0,r.c)(3);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("path",{d:"M11.9995 11.6042C12.2359 11.3531 12.6319 11.3406 12.8833 11.5768C13.1345 11.8133 13.1469 12.2102 12.9106 12.4616C10.9942 14.4996 8.48343 14.9669 5.82467 14.4899C5.48536 14.4287 5.25917 14.1047 5.31979 13.7653C5.38075 13.4255 5.7066 13.1985 6.04635 13.2594C8.41545 13.6844 10.4511 13.2509 11.9995 11.6042ZM7.40377 1.64517C7.57942 1.34822 7.96315 1.25 8.26022 1.42544C8.55725 1.60111 8.65554 1.98479 8.47995 2.28189L4.62155 8.80923C4.68119 8.84969 4.74613 8.89372 4.81686 8.93716C5.20557 9.17585 5.72696 9.42535 6.30123 9.51724C7.59938 9.72475 8.32429 9.55762 8.60495 9.41959C8.91451 9.26714 9.28927 9.39433 9.44186 9.70376C9.59429 10.0133 9.46707 10.3881 9.15768 10.5407C8.55667 10.8366 7.53939 10.9811 6.10397 10.7516C5.31168 10.6249 4.63266 10.2913 4.16256 10.0026C3.92499 9.85669 3.73326 9.71756 3.60006 9.61392C3.53354 9.56215 3.48092 9.51848 3.44381 9.48697C3.42534 9.47127 3.41058 9.45834 3.39987 9.44888C3.39453 9.44418 3.38953 9.44016 3.3862 9.43716C3.38469 9.43579 3.38337 9.43423 3.38229 9.43326L3.38034 9.43228V9.4313H3.37936C3.16132 9.23186 3.11298 8.90647 3.26315 8.65201L7.40377 1.64517ZM12.4995 2.25259C13.2777 2.19942 13.9584 2.87497 14.019 3.76138C14.0795 4.64775 13.4974 5.40938 12.7192 5.46255C11.941 5.51572 11.2612 4.84018 11.2006 3.95376C11.1401 3.06754 11.7215 2.306 12.4995 2.25259ZM2.08444 2.98501C2.35274 2.19505 3.03678 1.71257 3.61178 1.90787C4.18673 2.1032 4.43574 2.90212 4.16745 3.69205C3.89911 4.48193 3.21507 4.9635 2.6401 4.76822C2.06529 4.57291 1.81644 3.77476 2.08444 2.98501Z",fill:"currentColor"}),a[0]=n):n=a[0],a[1]!==e?(i=(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:n}),a[1]=e,a[2]=i):i=a[2],i};e.s(["Avatar",0,e=>{let i=(0,r.c)(10),a="tiny"===e.size?"w-4 h-4":"small"===e.size?"w-5 h-5":"medium"===e.size?"h-6 w-6":"large"===e.size?"w-8 h-8":"giant"===e.size?"h-16 w-16":"w-6 h-6";if(e.src){let r,n=`${a} relative rounded-full shrink-0 border border-border-light ${e.className}`,l=e.displayName?`${e.displayName}'s avatar`:"someone's avatar";return i[0]!==e.ariaHidden||i[1]!==e.src||i[2]!==n||i[3]!==l?(r=(0,t.jsx)("img",{className:n,src:e.src,"aria-hidden":e.ariaHidden,alt:l}),i[0]=e.ariaHidden,i[1]=e.src,i[2]=n,i[3]=l,i[4]=r):r=i[4],r}{let r,l,o=` relative bg-[var(--accent-light)] flex rounded-full shrink-0 border border-border-light place-items-center justify-center text-accent-1 ${a} ${e.className}`,s="tiny"===e.size?"scale-80":"small"===e.size?"scale-90":"";return i[5]!==s?(r=(0,t.jsx)(n,{className:s}),i[5]=s,i[6]=r):r=i[6],i[7]!==o||i[8]!==r?(l=(0,t.jsx)("div",{className:o,children:r}),i[7]=o,i[8]=r,i[9]=l):l=i[9],l}}],645522)},475307,509387,580357,104493,755223,e=>{"use strict";var t=e.i(843476),r=e.i(500932),n=e.i(271645),i=e.i(770703),a=e.i(620196),l=e.i(69278),o=e.i(788613),s=e.i(67180),c=e.i(793610),u=e.i(410275);let d=(0,i.default)(()=>e.A(140339).then(e=>e.BlueskyPostComposer),{loadableGenerated:{modules:[466842]},ssr:!1,loading:()=>(0,t.jsx)(o.DotLoader,{})});function m(){return null}e.s(["BskyPostSubmitButton",0,function(e){let n,i,a=(0,r.c)(6),c=e.posting||0===e.charCount||e.charCount>300;return a[0]!==e.posting?(n=e.posting?(0,t.jsx)(o.DotLoader,{}
21):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.BlueskyTiny,{})," Post"]}),a[0]=e.posting,a[1]=n):n=a[1],a[2]!==e.onClick||a[3]!==c||a[4]!==n?(i=(0,t.jsx)(l.ButtonPrimary,{className:"place-self-end",compact:!0,onClick:e.onClick,disabled:c,children:n}),a[2]=e.onClick,a[3]=c,a[4]=n,a[5]=i):i=a[5],i},"LazyBlueskyPostComposer",0,d,"useBskyPostSubmit",0,function(r){let i=(0,c.useToaster)(),l=(0,n.useRef)(null),[o,s]=(0,n.useState)(0),[d,m]=(0,n.useState)(!1),p=async n=>{var o;let s,c;if(!l.current||d)return;m(!0);let{editorStateToFacetedText:p}=await e.A(202404),[h,f]=p(l.current),b=await n(h,f);(m(!1),b.success)?(i({content:(o=b.uri,s=new a.AtUri(o),c=`https://bsky.app/profile/${s.host}/post/${s.rkey}`,(0,t.jsxs)("span",{children:["Shared to Bluesky!"," ",(0,t.jsx)("a",{href:c,target:"_blank",rel:"noreferrer",className:"underline text-accent-2!",children:"View it here."})]})),type:"success"}),r.onPosted()):i({content:(0,u.actionErrorContent)(b.error,"Hmm⦠Something went wrong. Try again!"),type:"error"})};return{editorStateRef:l,charCount:o,setCharCount:s,posting:d,post:p}}],475307),e.s(["usePrefetchedScreenshot",0,function(e,t){let i,a,l,o=(0,r.c)(6),s=(0,n.useRef)(null),[c,u]=(0,n.use
21State)(null);return o[0]!==t||o[1]!==e?(i=()=>{let r,n;if(t&&e)return r=!1,n=null,s.current=fetch(`/api/quote_screenshot?url=${encodeURIComponent(e)}`).then(async e=>{var t;if(!e.ok)return null;let i=await e.blob();return r||u(n=URL.createObjectURL(i)),t=i,new Promise((e,r)=>{let n=new FileReader;n.onload=()=>e(n.result.split(",")[1]),n.onerror=()=>r(n.error),n.readAsDataURL(t)})}).catch(m),()=>{r=!0,s.current=null,u(null),n&&URL.revokeObjectURL(n)}},a=[e,t],o[0]=t,o[1]=e,o[2]=i,o[3]=a):(i=o[2],a=o[3]),(0,n.useEffect)(i,a),o[4]!==c?(l={promiseRef:s,previewSrc:c},o[4]=c,o[5]=l):l=o[5],l}],509387);var p=e.i(95187);let h=(0,p.createServerReference)("4037a6ef99da1721769e7e7b60e6dc311b0f50c7b2",p.callServer,void 0,p.findSourceMapURL,"publishPublicationShareToBsky");e.s(["publishPublicationShareToBsky",0,h],580357);let f=(0,p.createServerReference)("40dae035046b1632d693aa9ee7a194618036b47632",p.callServer,void 0,p.findSourceMapURL,"addPublicationRecommendation");e.s(["addPublicationRecommendation",0,f],104493);var b=e.i(124670);e.s(["bskyPostEmbed",0,function(e){let t=e.publication;return{$type:"app.bsky.embed.external#view",external:{uri:e.url,title:e.title,description:e.description??"",...e.thumb?{thumb:e.thumb}:{},...e.thumbPending?{thumbPending:!0}:{},...t&&{createdAt:e.publishedAt,source:{uri:t.url,title:t.name,icon:t.icon&&e.pubOwnerDid?(0,b.blobRefToSrc)(t.icon.ref,e.pubOwnerDid):void 0},associatedRefs:[{uri:`at://${e.pubOwnerDid}/site.standard.document/preview`},{uri:`at://${e.pubOwnerDid}/site.standard.publication/preview`}]}}}}],755223)},998430,e=>{"use strict";var t=e.i(843476),r=e.i(500932),n=e.i(271645),i=e.i(178761),a=e.i(970827),l=e.i(784192);function o(e){return e.preventDefault()}function s(e){return e.stopPropagation()}function c(e){return e.stopPropagation()}e.s(["Combobox",0,e=>{let u,d,m,p,h,f,b,g,x,y,v,C,w,j,S=(0,r.c)(43),{results:k,onSelect:N,children:_,onOpenChange:P,highlighted:R,setHighlighted:U,searchValue:M,setSearchValue:E,showSearch:L,trigger:A,triggerClassName:T,className:I,resultsClassName:O,sideOffset:D,open:B,zIndex:$}=e,F=(0,n.useRef)(null),[H,W]=(0,n.useState)(!1),z=B??H;S[0]!==R||S[1]!==k||S[2]!==U?(u=()=>{R&&k.find(e=>e===R)||U(k[0]),1===k.length&&U(k[0])},d=[k,U,R],S[0]=R,S[1]=k,S[2]=U,S[3]=u,S[4]=d):(u=S[3],d=S[4]),(0,n.useEffect)(u,d),S[5]!==R||S[6]!==N||S[7]!==k||S[8]!==U?(m=()=>{let e=async e=>{let t=F.current?.dataset.side==="top",r=k.findIndex(e=>R&&e===R);(t?"ArrowUp"===e.key:"ArrowDown"===e.key)?U(k[r===k.length-1||void 0===r?0:r+1]):(t?"ArrowDown"===e.key:"ArrowUp"===e.key)?U(k[0===r||void 0===r||-1===r?k.length-1:r-1]):"Enter"===e.key&&(e.preventDefault(),N?.(),W(!1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},S[5]=R,S[6]=N,S[7]=k,S[8]=U,S[9]=m):m=S[9],S[10]!==R||S[11]!==k||S[12]!==U?(p=[R,U,k],S[10]=R,S[11]=k,S[12]=U,S[13]=p):p=S[13],(0,n.useEffect)(m,p),S[14]!==P?(h=e=>{W(e),P?.(e)},S[14]=P,S[15]=h):h=S[15];let G=`min-w-0 ${T}`;S[16]!==A?(f=(0,t.jsx)("div",{children:A}),S[16]=A,S[17]=f):f=S[17],S[18]!==G||S[19]!==f?(b=(0,t.jsx)(i.Trigger,{asChild:!0,className:G,children:f}),S[18]=G,S[19]=f,S[20]=b):b=S[20];let Z=D||16;S[21]!==$?(g=void 0!==$?{zIndex:$}:void 0,S[21]=$,S[22]=g):g=S[22];let V=` 22 commandMenuContent portalStyles group/cmd-menu 23 z-20 w-[264px] 24 flex data-[side=top]:items-end items-start 25 ${I} 26 `,q=`commandMenuResults w-full max-h-(--radix-popover-content-available-height) overflow-auto no-scrollbar flex flex-col group-data-[side=top]/cmd-menu:flex-col-reverse bg-bg-page gap-0.5 border border-border rounded-md shadow-md ${O??""}`;return S[23]!==M||S[24]!==E||S[25]!==L?(x=L&&E?(0,t.jsx)(l.Input,{autoFocus:!0,placeholder:"searchâ¦",className:`px-3 pb-1 pt-1 text-primary focus-within:outline-none! focus:outline-none! focus-visible:outline-none! appearance-none bg-bg-page border-border-light border-b group-data-[side=top]/cmd-menu:border-t group-data-[side=top]/cmd-menu:border-b-0 27 sticky group-data-[side=top]/cmd-menu:bottom-0 top-0`,value:M,onChange:e=>E(e.target.value),onClick:s,onPointerDown:c}):null,S[23]=M,S[24]=E,S[25]=L,S[26]=x):x=S[26],S[27]===Symbol.for("react.memo_cache_sentinel")?(y=(0,t.jsx)("div",{className:"space h-1
27w-full bg-transparent"}),S[27]=y):y=S[27],S[28]===Symbol.for("react.memo_cache_sentinel")?(v=(0,t.jsx)("div",{className:"space h-1 w-full bg-transparent"}),S[28]=v):v=S[28],S[29]!==_||S[30]!==q||S[31]!==x?(C=(0,t.jsx)(a.NestedCardThemeProvider,{children:(0,t.jsxs)("div",{className:q,children:[x,y,_,v]})}),S[29]=_,S[30]=q,S[31]=x,S[32]=C):C=S[32],S[33]!==g||S[34]!==V||S[35]!==C||S[36]!==Z?(w=(0,t.jsx)(i.Portal,{children:(0,t.jsx)(i.Content,{align:"start",sideOffset:Z,collisionPadding:16,ref:F,onOpenAutoFocus:o,style:g,className:V,children:C})}),S[33]=g,S[34]=V,S[35]=C,S[36]=Z,S[37]=w):w=S[37],S[38]!==z||S[39]!==w||S[40]!==h||S[41]!==b?(j=(0,t.jsxs)(i.Root,{open:z,onOpenChange:h,children:[b,w]}),S[38]=z,S[39]=w,S[40]=h,S[41]=b,S[42]=j):j=S[42],j},"ComboboxResult",0,e=>{let n,i,a,l,o=(0,r.c)(10),s=e.highlighted===e.result,c=`comboboxResult menuItem text-secondary font-normal! py-0.5! mx-1 ${e.className} ${s&&"bg-[var(--accent-light)]!"}`;return o[0]!==e?(n=()=>{e.setHighlighted(e.result)},i=t=>{t.preventDefault(),e.onSelect()},o[0]=e,o[1]=n,o[2]=i):(n=o[1],i=o[2]),o[3]!==e.children?(a=(0,t.jsx)("div",{className:"truncate flex items-center",children:e.children}),o[3]=e.children,o[4]=a):a=o[4],o[5]!==c||o[6]!==n||o[7]!==i||o[8]!==a?(l=(0,t.jsx)("button",{className:c,onMouseOver:n,onMouseDown:i,children:a}),o[5]=c,o[6]=n,o[7]=i,o[8]=a,o[9]=l):l=o[9],l}])},324270,263183,694777,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(620196),i=e.i(784192),a=e.i(998430),l=e.i(500932),o=e.i(593302),s=e.i(241665);function c(e){return{handle:e.handle,did:e.did,displayName:e.displayName,avatar:e.avatar}}var u=e.i(788613),d=e.i(645522),m=e.i(885718),p=e.i(899161);let h="border-accent-contrast outline-2 outline outline-accent-contrast outline-offset-1";e.s(["INPUT_HIGHLIGHT_CLASS",0,h],263183),e.s(["HandleSearchInput",0,e=>{let{handleValue:f,setHandleValue:b,suggestions:g,setSuggestions:x,dropdownOpen:y,setDropdownOpen:v,highlighted:C,setHighlighted:w}=function(){let e,t,n,i,a=(0,l.c)(10),[u,d]=(0,r.useState)("");a[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],a[0]=e):e=a[0];let[m,p]=(0,r.useState)(e),[h,f]=(0,r.useState)(!1),[b,g]=(0,r.useState)(void 0),x=(0,r.useRef)(0);return a[1]!==u?(t=async()=>{let e=u.trim().replace(/^@/,"");if(!e){p([]),f(!1);return}let t=x.current=x.current+1,r=new o.Agent("https://public.api.bsky.app");try{let n=await r.searchActorsTypeahead({q:e,limit:8});if(t!==x.current)return;let i=n.data.actors.map(c);p(i),f(i.length>0)}catch{p([]),f(!1)}},a[1]=u,a[2]=t):t=a[2],a[3]!==u?(n=[u],a[3]=u,a[4]=n):n=a[4],(0,s.useDebouncedEffect)(t,300,n),a[5]!==h||a[6]!==u||a[7]!==b||a[8]!==m?(i={handleValue:u,setHandleValue:d,suggestions:m,setSuggestions:p,dropdownOpen:h,setDropdownOpen:f,highlighted:b,setHighlighted:g},a[5]=h,a[6]=u,a[7]=b,a[8]=m,a[9]=i):i=a[9],i}(),j=(0,r.useRef)(null),S=async t=>{let r=t??f;if(!r)return;let i=g.find(e=>e.handle===r);if(e.validateHandle&&!i&&(r=r.trim().replace(/^@/,""),!(0,n.isValidHandle)(r))){let e=j.current?.querySelector("input");e?.setCustomValidity("Please enter a full handle, like name.bsky.social"),e?.reportValidity();return}b(r),v(!1),x([]),w(void 0),e.onChange?.(r),await e.onSubmit?.(r,i)&&b("")},k=g.map(e=>e.handle),N=void 0===e.leading?(0,t.jsx)(p.AtmosphereAccount,{}):e.leading;return(0,t.jsx)(a.Combobox,{open:y&&!e.loading,onOpenChange:e=>{e||(v(!1),w(void 0))},results:k,highlighted:C,setHighlighted:w,onSelect:()=>S(C),zIndex:60,sideOffset:4,triggerClassName:e.triggerClassName,className:"w-(--radix-popover-trigger-width)!",trigger:(0,t.jsxs)("div",{ref:j,className:`handleInput input-with-border relative py-0! flex items-center gap-2 w-full ${e.large&&"px-2!"} ${e.highlight?h:""} ${e.className}`,style:e.loading?{backgroundColor:m.theme.colors["border-light"],color:m.theme.colors.tertiary}:{backgroundColor:m.theme.colors["bg-page"],color:m.theme.colors.primary},children:[N&&(0,t.jsx)("div",{className:"text-tertiary text-center shrink-0 flex justify-end h-full items-center",children:N}),(0,t.jsx)(i.Input,{inputMode:"url",autoFocus:e.autoFocus,className:`appearance-none! grow outline-none! min-w-0 ${e.large?"py-1!":e.compact?"py-0!":"py-0.5"}`,placeholder:e.placeholder??"atmosphere.handle",size:0,value:f,onChange:t=>{t.currentTarget.setCustomValidity(""),b(t.target.value),e.onChange?.(t.target.value)},onFocus:e.onFocus,onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),S(C))},autoComplete:"off",disabled:e.loading}),e.renderAction?e.renderAction(()=>S(),f):e.loading?(0,t.jsx)(u.DotLoader,{}):e.onSubmit&&e.action?(0,t.jsx)("button",{type:"button",className:"shrink-0 whitespace-nowrap",onClick:e=>{e.stopPropagation(),S()},disabled:!f,children:e.action}):e.action]}),children:g.map(e=>(0,t.jsxs)(a.ComboboxResult,{result:e.handle,highlighted:C,setHighlighted:w,onSelect:()=>S(e.handle),className:" flex-row! gap-2! leading-snug text-sm",children:[(0,t.jsx)(d.Avatar,{src:e.avatar,displayName:e.displayName||e.handle,size:"medium",className:"mr-2"}),(0,t.jsxs)("div",{className:"flex flex-col min-w-0 flex-1 text-left",children:[(0,t.jsx)("div",{className:"truncate font-bold",children:e.displayName||e.handle}),e.displayName&&(0,t.jsxs)("div",{className:"text-tertiary text-xs italic truncate",children:["@",e.handle]})]})]},e.did))})}],324270);var f=e.i(618566),b=e.i(806398),g=e.i(69278),x=e.i(857592);e.s(["LinkIdentityModal",0,e=>{let n=(0,f.useRouter)(),[i,a]=(0,r.useState)(!1);return(0,t.jsx)(x.Modal,{open:e.open,onOpenChange:t=>{i||e.confirming||e.onOpenChange(t)}
27,className:"w-[400px] max-w-full",children:(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("h3",{className:"text-primary leading-tight",children:["You're signed in as"," ",(0,t.jsx)("span",{className:"font-bold",children:e.signedInAs})]}),(0,t.jsxs)("p",{className:"text-secondary leading-snug",children:["Do you want to link"," ",(0,t.jsx)("span",{className:"font-bold",children:e.linkingIdentity})," to this account?"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 justify-end pt-1",children:[(0,t.jsx)(g.ButtonSecondary,{disabled:i||e.confirming,onClick:async()=>{if(!i){a(!0);try{await fetch("/api/auth/logout")}finally{(0,b.clearIdentityData)(),n.refresh()}}},children:i?(0,t.jsx)(u.DotLoader,{}):"Log out"}),(0,t.jsx)(g.ButtonPrimary,{disabled:i||e.confirming,onClick:()=>{e.confirming||e.onConfirm()},children:e.confirming?(0,t.jsx)(u.DotLoader,{}):e.confirmButtonLabel})]})]})})}],694777)},67180,e=>{"use strict";var t=e.i(843476),r=e.i(500932);e.s(["BlueskyTiny",0,e=>{let n,i,a=(0,r.c)(3);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M111.8 62.2C170.2 105.9 233 194.7 256 242.4c23-47.6 85.8-136.4 144.2-180.2c42.1-31.6 110.3-56 110.3 21.8c0 15.5-8.9 130.5-14.1 149.2C478.2 298 412 314.6 353.1 304.5c102.9 17.5 129.1 75.5 72.5 133.5c-107.4 110.2-154.3-27.6-166.3-62.9l0 0c-1.7-4.9-2.6-7.8-3.3-7.8s-1.6 3-3.3 7.8l0 0c-12 35.3-59 173.1-166.3 62.9c-56.5-58-30.4-116 72.5-133.5C100 314.6 33.8 298 15.7 233.1C10.4 214.4 1.5 99.4 1.5 83.9c0-77.8 68.2-53.4 110.3-21.8z",fill:"currentColor"}),a[0]=n):n=a[0],a[1]!==e?(i=(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:n}),a[1]=e,a[2]=i):i=a[2],i}])},864460,e=>{"use strict";var t=e.i(843476),r=e.i(500932);e.s(["CheckTiny",0,e=>{let n,i,a=(0,r.c)(3);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.7921 2.03304C15.3262 2.4705 15.4045 3.25808 14.967 3.79213L6.7757 13.7921C6.55723 14.0588 6.2383 14.2235 5.89434 14.2471C5.55039 14.2707 5.21195 14.1512 4.95907 13.9169L1.15037 10.3874C0.644007 9.91821 0.613911 9.12732 1.08315 8.62096C1.55239 8.11459 2.34327 8.0845 2.84964 8.55374L5.68371 11.18L13.033 2.20794C13.4705 1.67388 14.258 1.59558 14.7921 2.03304Z",fill:"currentColor"}),a[0]=n):n=a[0],a[1]!==e?(i=(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:n}),a[1]=e,a[2]=i):i=a[2],i}])},4876,e=>{"use strict";var t=e.i(843476),r=e.i(500932);e.s(["GoToArrow",0,e=>{let n,i,a=(0,r.c)(3);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("path",{d:"M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0ZM8.75781 2.69629C8.46492 2.4034 7.98918 2.4034 7.69629 2.69629C7.4034 2.98918 7.4034 3.46492 7.69629 3.75781L11.1895 7.25H3C2.58579 7.25 2.25 7.58579 2.25 8C2.25 8.41421 2.58579 8.75 3 8.75H11.1895L7.69629 12.2422C7.4034 12.5351 7.4034 13.0108 7.69629 13.3037C7.98918 13.5966 8.46492 13.5966 8.75781 13.3037L13.5303 8.53027C13.8232 8.23738 13.8232 7.76262 13.5303 7.46973L8.75781 2.69629Z",fill:"currentColor"}),a[0]=n):n=a[0],a[1]!==e?(i=(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:n}),a[1]=e,a[2]=i):i=a[2],i}])},650470,e=>{"use strict";var t=e.i(843476),r=e.i(500932);e.s(["LooseLeafSmall",0,e=>{let n,i,a=(0,r.c)(3);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("path",{d:"M16.5339 4.65788L21.9958 5.24186C22.4035 5.28543 22.7014 5.6481 22.6638 6.05632C22.5159 7.65303 22.3525 9.87767 22.0925 11.9186C21.9621 12.9418 21.805 13.9374 21.6091 14.8034C21.4166 15.6542 21.1733 16.442 20.8454 17.0104C20.1989 18.131 19.0036 18.9569 17.9958 19.4782C17.4793 19.7453 16.9792 19.9495 16.569 20.0827C16.3649 20.1489 16.1724 20.2013 16.0046 20.234C15.8969 20.255 15.7254 20.2816 15.5495 20.2682C15.5466 20.2681 15.5423 20.2684 15.5378 20.2682C15.527 20.2678 15.5112 20.267 15.4919 20.2663C15.4526 20.2647 15.3959 20.2623 15.3239 20.2584C15.1788 20.2506 14.9699 20.2366 14.7116 20.2145C14.1954 20.1703 13.4757 20.0909 12.6598 19.9489C11.0477 19.6681 8.97633 19.1301 7.36198 18.0807C6.70824 17.6557 5.95381 17.064 5.21842 16.4469C5.09798 16.5214 4.97261 16.591 4.81803 16.6706C4.28341 16.9455 3.71779 17.0389 3.17935 16.9137C2.64094 16.7885 2.20091 16.4608 1.89126 16.0231C1.28226 15.1618 1.16463 13.8852 1.5729 12.5514L1.60708 12.4606C1.7005 12.255 1.88295 12.1001 2.10513 12.0436C2.35906 11.9792 2.62917 12.0524 2.81607 12.236L2.82486 12.2448C2.8309 12.2507 2.84033 12.2596 2.8522 12.2712C2.87664 12.295 2.91343 12.3309 2.9606 12.3766C3.05513 12.4682 3.19281 12.6016 3.3649 12.7653C3.70953 13.0931 4.19153 13.5443 4.73795 14.0378C5.84211 15.0349 7.17372 16.1691 8.17937 16.8229C9.53761 17.7059 11.3696 18.2017 12.9177 18.4713C13.6815 18.6043 14.3565 18.679 14.8395 18.7204C15.0804 18.741 15.2731 18.7533 15.404 18.7604C15.4691 18.7639 15.5195 18.7659 15.5524 18.7672C15.5684 18.7679 15.5809 18.7689 15.5886 18.7692H15.5983L15.6374 18.7731C15.6457 18.7724 15.671 18.7704 15.7175 18.7614C15.8087 18.7436 15.9399 18.7095 16.1052 18.6559C16.4345 18.549 16.8594 18.3773 17.3063 18.1461C18.2257 17.6706 19.1147 17.0089 19.5466 16.2604C19.7578 15.8941 19.9618 15.2874 20.1462 14.4723C20.3271 13.6723 20.4767 12.7294 20.6042 11.7292C20.8232 10.0102 20.9711 8.17469 21.1042 6.65397L16.3747 6.14909C15.963 6.10498 15.6648 5.73562 15.7087 5.3239C15.7528 4.91222 16.1222 4.61399 16.5339 4.65788ZM12.0593 13.1315L12.2038 13.1647L12.3776 13.235C12.7592 13.4197 12.9689 13.7541 13.0837 14.0573C13.2089 14.3885 13.2545 14.7654 13.2858 15.0573C13.3144 15.3233 13.3319 15.5214 13.361 15.6774C13.4345 15.6215 13.5233 15.5493 13.6413 15.4479C13.7924 15.318 14.0034 15.1374 14.2429 15.0114C14.4965 14.878 14.8338 14.7772 15.2175 14.8747C15.5354 14.9556 15.7394 15.1539 15.8679 15.3229C15.9757 15.4648 16.0814 15.6631 16.1247 15.736C16.1889 15.8438 16.2218 15.8788 16.239 15.8922C16.2438 15.896 16.2462 15.8979 16.2497 15.8991C16.2541 15.9005 16.2717 15.9049 16.3093 15.9049C16.6541 15.9051 16.934 16.1851 16.9343 16.5299C16.9343 16.875 16.6543 17.1548 16.3093 17.1549C15.9766 17.1549 15.6957 17.0542 15.4694 16.8776C15.2617 16.7153 15.1322 16.5129 15.0505 16.3756C14.9547 16.2147 14.9262 16.1561 14.8815 16.0944C14.8684 16.0989 14.849 16.1051 14.8249 16.1178C14.7289 16.1684 14.6182 16.2555 14.4557 16.3952C14.3175 16.514 14.1171 16.6946 13.9069 16.821C13.6882 16.9524 13.3571 17.0902 12.9684 16.9938C12.4305 16.8602 12.2473 16.3736 12.1764 16.1051C12.1001 15.8159 12.0709 15.4542 12.0427 15.1911C12.0102 14.8884 11.9751 14.662 11.9138 14.4997C11.9011 14.4662 11.8884 14.4403 11.8776 14.4206C11.7899 14.4801 11.6771 14.5721 11.5329 14.7047C11.3855 14.8404 11.181 15.0386 11.0016 15.196C10.8175 15.3575 10.5936 15.5364 10.3512 15.6569C10.19 15.737 9.99118 15.7919 9.77214 15.7594C9.55026 15.7264 9.38367 15.6153 9.27019 15.5045C9.08085 15.3197 8.96362 15.0503 8.91081 14.9391C8.8766 14.8671 8.85074 14.814 8.82585 14.7692C8.541 14.777 8.27798 14.5891 8.20378 14.3014C8.11797 13.9674 8.31907 13.6269 8.653 13.5407L8.79558 13.5124C8.93966 13.4936 9.0875 13.5034 9.23308 13.5485C9.42396 13.6076 9.569 13.7155 9.67449 13.8239C9.85113 14.0055 9.96389 14.244 10.027 14.3776C10.0723 14.3417 10.124 14.3034
2710.1774 14.2565C10.3474 14.1073 10.4942 13.9615 10.6862 13.7848C10.8571 13.6276 11.0614 13.4475 11.2731 13.32C11.4428 13.2178 11.7294 13.081 12.0593 13.1315ZM2.84537 14.3366C2.88081 14.6965 2.98677 14.9742 3.11588 15.1569C3.24114 15.334 3.38295 15.4211 3.5192 15.4528C3.63372 15.4794 3.79473 15.4775 4.00553 15.3932C3.9133 15.3109 3.82072 15.2311 3.73209 15.151C3.40947 14.8597 3.10909 14.5828 2.84537 14.3366ZM8.73601 3.86003C9.14672 3.91292 9.43715 4.28918 9.38445 4.69987C9.25964 5.66903 9.14642 7.35598 8.87077 9.02018C8.59001 10.7151 8.11848 12.5766 7.20085 14.1003C6.98712 14.4551 6.52539 14.5698 6.17057 14.3561C5.81623 14.1423 5.70216 13.6814 5.91569 13.3268C6.68703 12.0463 7.121 10.4066 7.39128 8.77506C7.66663 7.11265 7.74965 5.64618 7.89616 4.50847C7.94916 4.09794 8.32546 3.80744 8.73601 3.86003ZM11.7614 8.36784C12.1238 8.21561 12.4973 8.25977 12.8054 8.46452C13.0762 8.64474 13.2601 8.92332 13.3884 9.18912C13.5214 9.46512 13.6241 9.79028 13.7009 10.1354C13.7561 10.3842 13.7827 10.6162 13.8034 10.8044C13.8257 11.0069 13.8398 11.1363 13.864 11.2438C13.8806 11.3174 13.8959 11.3474 13.9011 11.3561C13.9095 11.3609 13.9289 11.3695 13.9655 11.3786C14.0484 11.3991 14.0814 11.3929 14.0895 11.3913C14.1027 11.3885 14.1323 11.3804 14.2028 11.3366C14.3137 11.2677 14.6514 11.0042 15.0563 10.8288L15.1364 10.7985C15.3223 10.7392 15.4987 10.7526 15.6335 10.7838C15.7837 10.8188 15.918 10.883 16.0231 10.9421C16.2276 11.057 16.4458 11.2251 16.613 11.3503C16.8019 11.4917 16.9527 11.5999 17.0827 11.6676C17.1539 11.7047 17.1908 11.7142 17.2009 11.7165L17.2849 11.7047C17.5751 11.6944 17.8425 11.8891 17.9138 12.1823C17.995 12.5174 17.7897 12.8554 17.4548 12.9372C17.0733 13.0299 16.7253 12.8909 16.5046 12.776C16.2705 12.6541 16.042 12.4845 15.864 12.3512C15.6704 12.2064 15.5344 12.1038 15.4216 12.0387C15.2178 12.1436 15.1125 12.2426 14.862 12.3981C14.7283 12.4811 14.5564 12.5716 14.3415 12.6159C14.1216 12.6611 13.8975 12.6501 13.6647 12.5924C13.3819 12.5222 13.1344 12.3858 12.9479 12.1657C12.7701 11.9555 12.689 11.7172 12.6442 11.5182C12.601 11.3259 12.58 11.112 12.5612 10.9411C12.5408 10.7561 12.5194 10.5827 12.4802 10.4059C12.4169 10.1215 12.3411 9.89526 12.2624 9.73209C12.2296 9.66404 12.1981 9.61255 12.1716 9.57487C12.1263 9.61576 12.0615 9.68493 11.9802 9.7985C11.8864 9.92952 11.7821 10.0922 11.6589 10.2838C11.5393 10.4698 11.4043 10.6782 11.2634 10.8786C11.123 11.0782 10.9664 11.2843 10.7975 11.4635C10.633 11.6381 10.4285 11.8185 10.1862 11.9342C9.87476 12.0828 9.50095 11.9507 9.35222 11.6393C9.20377 11.3279 9.33594 10.9551 9.64714 10.8063C9.69148 10.7851 9.77329 10.7282 9.88835 10.6061C9.99931 10.4883 10.1167 10.3365 10.2409 10.1598C10.3647 9.98378 10.4855 9.79617 10.6071 9.60709C10.7249 9.42397 10.8479 9.23258 10.9636 9.07096C11.1814 8.76677 11.4424 8.50191 11.7614 8.36784ZM12.4304 2.81218C13.631 2.81246 14.6042 3.78628 14.6042 4.98698C14.6041 5.39899 14.4869 5.78271 14.2878 6.111L15.0007 6.9069C15.2772 7.21532 15.2515 7.689 14.9431 7.96549C14.6347 8.24164 14.1609 8.21606 13.8845 7.90788L13.1139 7.0485C12.8988 7.11984 12.6695 7.16075 12.4304 7.16081C11.2296 7.16081 10.2558 6.18766 10.2555 4.98698C10.2555 3.7861 11.2295 2.81218 12.4304 2.81218ZM12.4304 4.31218C12.0579 4.31218 11.7555 4.61453 11.7555 4.98698C11.7558 5.35924 12.058 5.66081 12.4304 5.66081C12.8024 5.66053 13.104 5.35907 13.1042 4.98698C13.1042 4.6147 12.8026 4.31246 12.4304 4.31218Z",fill:"currentColor"}),a[0]=n):n=a[0],a[1]!==e?(i=(0,t.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:n}),a[1]=e,a[2]=i):i=a[2],i}])},713418,e=>{"use strict";var t=e.i(843476),r=e.i(500932);e.s(["RSSTiny",0,e=>{let n,i,a=(0,r.c)(3);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("path",{d:"M2.82098 5.7636C6.84291 5.76364 10.2363 8.92669 10.2364 13.179C10.2364 13.8688 9.67713 14.428 8.98738 14.428C8.29764 14.428 7.73841 13.8688 7.73837 13.179C7.7383 10.3543 5.5118 8.26167 2.82098 8.26163C2.13119 8.26163 1.572 7.7024 1.57196 7.01262C1.57196 6.32281 2.13116 5.7636 2.82098 5.7636ZM2.82098 1.57196C9.12441 1.572 14.428 6.52137 14.428 13.179C14.428 13.8688 13.8688 14.428 13.179 14.428C12.4892 14.428 11.93 13.8688 11.93 13.179C11.93 7.94901 7.7933 4.07003 2.82098 4.06999C2.13116 4.06999 1.57196 3.51079 1.57196 2.82098C1.57196 2.13116 2.13116 1.57196 2.82098 1.57196ZM3.93094 10.6066C4.82318 10.6067 5.54639 11.3299 5.54649 12.2221C5.54649 13.1145 4.82325 13.8382 3.93094 13.8383C3.03853 13.8383 2.31478 13.1145 2.31478 12.2221C2.31489 11.3298 3.03859 10.6066 3.93094 10.6066Z",fill:"currentColor"}),a[0]=n):n=a[0],a[1]!==e?(i=(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:n}),a[1]=e,a[2]=i):i=a[2],i}])},838854,e=>{"use strict";var t=e.i(843476),r=e.i(500932);e.s(["RecommendEmptyTiny",0,e=>{let n,i,a=(0,r.c)(3);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("path",{d:"M13.8215 8.85505C13.9834 8.63149 14.2961 8.58084 14.5197 8.7427
275C14.7432 8.90468 14.7928 9.21739 14.631 9.44099C12.9668 11.7395 10.7808 13.1138 9.0744 14.0943C8.83501 14.2318 8.52937 14.1491 8.39178 13.9097C8.25431 13.6703 8.33696 13.3647 8.57635 13.2271C10.2586 12.2605 12.2878 10.9733 13.8215 8.85505ZM4.12127 2.44392C5.05035 2.20462 6.17272 2.3143 7.04412 3.04744C7.33889 3.29547 7.62399 3.64884 7.85369 3.96833C7.89451 4.02512 7.93345 4.08237 7.97186 4.13826C8.22436 3.76381 8.53885 3.3457 8.86248 3.06501C9.80388 2.24888 11.1891 2.16939 12.1564 2.56501C12.9693 2.89763 13.663 3.49593 14.0002 4.60701C14.267 5.48669 14.2598 6.26139 14.0461 7.15974C13.7527 8.39225 12.7396 9.53682 11.6691 10.4703C10.5802 11.4198 9.3429 12.2265 8.47772 12.7681C8.47247 12.7714 8.46646 12.7748 8.46111 12.7779C8.43136 12.795 8.369 12.8315 8.30096 12.8619C8.2405 12.8889 8.11991 12.937 7.97576 12.9371C7.82229 12.9372 7.7007 12.8832 7.63885 12.8521C7.6045 12.8349 7.57372 12.8176 7.55291 12.8052C7.52605 12.7893 7.52018 12.7855 7.50701 12.7779C7.50235 12.7752 7.49792 12.7719 7.49334 12.7691C6.59506 12.2129 5.35778 11.3987 4.27654 10.4439C3.21273 9.50447 2.21958 8.35999 1.92693 7.13044C1.71321 6.23218 1.70502 5.4352 1.97186 4.55525C2.31285 3.43128 3.22341 2.67532 4.12127 2.44392ZM6.40057 3.81306C5.82954 3.33259 5.06002 3.23404 4.37029 3.41169C3.79433 3.56026 3.16381 4.07131 2.92889 4.84529C2.72085 5.53135 2.72051 6.14631 2.89959 6.899C3.11654 7.81042 3.90364 8.77988 4.93865 9.69392C5.94258 10.5805 7.10507 11.3507 7.98358 11.8961C8.83657 11.3611 9.99989 10.5988 11.0119 9.71638C12.0571 8.8049 12.8571 7.83679 13.0734 6.9283C13.2523 6.17606 13.2512 5.58411 13.0431 4.89802C12.8044 4.11102 12.3496 3.72381 11.7775 3.48982C11.1013 3.21328 10.1298 3.29025 9.51776 3.82087C9.10331 4.18037 8.63998 4.9218 8.40545 5.3238C8.3158 5.4772 8.1515 5.57185 7.97381 5.57185C7.79617 5.57171 7.63172 5.47723 7.54217 5.3238C7.43363 5.13777 7.25216 4.84479 7.04119 4.55134C6.82572 4.25167 6.5988 3.97993 6.40057 3.81306Z",fill:"currentColor"}),a[0]=n):n=a[0],a[1]!==e?(i=(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:n}),a[1]=e,a[2]=i):i=a[2],i},"RecommendFilledTiny",0,e=>{let n,i,a=(0,r.c)(3);return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("path",{d:"M13.8218 8.85542C13.9838 8.63176 14.2964 8.58118 14.5201 8.74312C14.7433 8.90516 14.7932 9.21786 14.6314 9.44136C12.9671 11.7399 10.7811 13.1142 9.07472 14.0947C8.83547 14.2321 8.52981 14.1491 8.3921 13.9101C8.25463 13.6707 8.33728 13.365 8.57667 13.2275C10.2589 12.2608 12.2881 10.9736 13.8218 8.85542ZM9.09327 2.90525C10.0113 2.2003 11.4161 2.21431 12.2886 2.61521C13.0365 2.95905 13.6929 3.5946 14.0044 4.62106C14.2614 5.46809 14.2169 6.28576 14.0044 7.17867C13.4531 9.49467 10.1475 11.7776 8.22413 12.8828C8.15152 12.9245 8.05431 12.9453 7.97315 12.9453C7.89219 12.9453 7.80343 12.9243 7.73096 12.8828C5.80749 11.7776 2.50174 9.49385 1.95065 7.1777C1.7383 6.28491 1.69376 5.46798 1.95065 4.62106C2.26221 3.59471 2.91764 2.95906 3.66551 2.61521C4.53812 2.21415 5.94374 2.19992 6.86181 2.90525C7.4145 3.32999 7.72613 3.72603 7.97315 4.14939C8.22018 3.72604 8.5406 3.32998 9.09327 2.90525ZM4.55418 3.84079C4.44015 3.58958 4.14441 3.47805 3.89305 3.59177C2.93793 4.0246 2.4787 5.35564 2.85105 6.64059C2.9282 6.90532 3.20525 7.05713 3.47019 6.98043C3.73523 6.9035 3.88869 6.62638 3.81199 6.36129C3.52801 5.38087 3.94973 4.66317 4.30516 4.50192C4.55654 4.38789 4.6681 4.09224 4.55418 3.84079Z",fill:"currentColor"}),a[0]=n):n=a[0],a[1]!==e?(i=(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:n}),a[1]=e,a[2]=i):i=a[2],i}])},794853,e=>{"use strict";var t=e.i(843476),r=e.i(500932);e.s(["ShareTiny",0,e=>{let n,i=(0,r.c)(1);return i[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M15.0103 1.33798C15.2276 1.25313 15.4745 1.29662 15.65 1.45028C15.825 1.6039 15.9006 1.84218 15.8453 2.06845L13.4459 11.8692C13.3697 12.1803 13.0698 12.3837 12.7525 12.3399L7.54549 11.6212L5.06795 14.4884C4.91325 14.6673 4.67125 14.7438 4.44198 14.6856C4.21271 14.6275 4.03564 14.445 3.98494 14.214L3.11678 10.254L0.372639 8.06161C0.198148 7.92224
270.110653 7.70036 0.144124 7.47958C0.177676 7.2588 0.326773 7.07261 0.534749 6.9913L15.0103 1.33798ZM4.38533 10.2052L4.80428 12.1153L5.52694 10.5313L5.57674 10.4415C5.59601 10.4129 5.61836 10.3856 5.64217 10.3604L7.70662 8.18075L4.38533 10.2052ZM1.99862 7.76083L3.72811 9.14169L11.0592 4.67392C11.3266 4.51092 11.6737 4.57107 11.8707 4.81454C12.0676 5.05814 12.0539 5.41037 11.8385 5.63778L7.38533 10.338L12.3648 11.0245L14.3443 2.93954L1.99862 7.76083Z",fill:"currentColor"})}),i[0]=n):n=i[0],n}])},671473,e=>{"use strict";e.s(["LoginContent",()=>C,"LoginModal",()=>v]);var t=e.i(843476),r=e.i(500932),n=e.i(806398),i=e.i(857592),a=e.i(69278),l=e.i(327630),o=e.i(324270),s=e.i(799596),c=e.i(271645),u=e.i(4876),d=e.i(791676),m=e.i(793610),p=e.i(67180),h=e.i(701544),f=e.i(860832),b=e.i(920855),g=e.i(31234),x=e.i(607585),y=e.i(370682);let v=e=>{let n,a,l,o,s=(0,r.c)(17),[u,d]=(0,c.useState)(!1),m=void 0!==e.open,p=e.open??u;s[0]!==m||s[1]!==e?(n=t=>{m||d(t),e.onOpenChange?.(t)},s[0]=m,s[1]=e,s[2]=n):n=s[2];let h=n;return s[3]!==h?(a=()=>h(!1),s[3]=h,s[4]=a):a=s[4],s[5]!==p||s[6]!==e.action||s[7]!==e.noEmailLogin||s[8]!==e.redirectRoute||s[9]!==a?(l=(0,t.jsx)(C,{noEmailLogin:e.noEmailLogin,redirectRoute:e.redirectRoute,action:e.action,open:p,onSuccess:a}),s[5]=p,s[6]=e.action,s[7]=e.noEmailLogin,s[8]=e.redirectRoute,s[9]=a,s[10]=l):l=s[10],s[11]!==p||s[12]!==e.asChild||s[13]!==e.trigger||s[14]!==h||s[15]!==l?(o=(0,t.jsx)(i.Modal,{asChild:e.asChild,trigger:e.trigger,open:p,onOpenChange:h,className:"w-full!",children:l}),s[11]=p,s[12]=e.asChild,s[13]=e.trigger,s[14]=h,s[15]=l,s[16]=o):o=s[16],o},C=e=>{let r=(0,n.useIdentityData)(),[i,v]=(0,c.useState)("log in"),[C,j]=(0,c.useState)(""),[S,k]=(0,c.useState)(null),[N,_]=(0,c.useState)(!1),P=(0,m.useToaster)();if(!e.addAccount){if(r.identity?.atp_did)return null;if(r.identity?.email&&!r.identity.atp_did)return(0,t.jsx)(w,{pageView:e.pageView,redirectRoute:e.redirectRoute,action:e.action,open:e.open})}let R=async()=>{_(!0);try{let e=(0,x.mainSiteAuthBase)();if(e){let t=new URL("/api/auth/email-login",e);t.searchParams.set("email",C),t.searchParams.set("redirect",window.location.href),window.location.href=t.toString();return}let t=await (0,h.requestAuthEmailToken)(C);k(t),v("email confirm")}catch(e){P({content:(0,t.jsx)("div",{className:"font-bold",children:"We couldn't send the email. Please try again!"}),type:"error"})}finally{_(!1)}},U=async r=>{if(!S)return;if(_(!0),!await (0,f.confirmEmailAuthToken)(S,r)){_(!1),P({content:(0,t.jsx)("div",{className:"font-bold",children:"Incorrect code!"}),type:"error"});return}let i=e.addAccount?[]:(0,g.getHomeDocs)().filter(e=>!e.hidden);if(await (0,b.loginWithEmailToken)(i,e.redirectRoute),e.addAccount){(0,y.broadcastIdentityChange)(null),window.location.href="/home";return}(0,n.refreshIdentityData)(),P({content:(0,t.jsx)("div",{className:"font-bold",children:"Logged in! Welcome!"}),type:"success"}),_(!1),e.onSuccess?.()};return(0,t.jsxs)("div",{className:`flex flex-col gap-2 w-full sm:w-xs ${e.className}`,children:[(0,t.jsx)(d.ToggleGroup,{value:"email log in"===i||"email confirm"===i?"log in":i,onChange:v,options:[{value:"log in",label:"Log In"},{value:"sign up",label:"Sign Up"}],fullWidth:!0}),(0,t.jsx)("div",{className:`accent-container flex flex-col gap-1 ${e.pageView?" p-4 py-5":"px-3 py-4 "}`,children:"log in"===i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-center mx-auto leading-tight pb-2",children:[(0,t.jsxs)("h3",{children:["Log in with ",(0,t.jsx)("br",{}),"Atmosphere account"]}),(0,t.jsx)(l.AtmosphericHandleInfo,{trigger:(0,t.jsx)("div",{className:"text-sm text-accent-contrast",children:"What's the Atmosphere?"})})]}),(0,t.jsx)(o.HandleSearchInput,{large:!0,autoFocus:!1!==e.open,action:(0,t.jsx)(u.GoToArrow,{className:"text-accent-contrast"}),loading:N,validateHandle:!0,onSubmit:t=>{_(!0),window.location.href=(0,x.buildOauthLoginUrl)({handle:t,redirect:e.redirectRoute||window.location.href,action:e.action,addAccount:e.addAccount})}}),e.noEmailLogin?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("hr",{className:"border-border-light mt-2 mb-1"}),(0,t.jsx)("button",{className:"text-sm text-accent-contrast",onClick:e=>{e.preventDefault(),e.stopPropagation(),v("email log in")},children:"or log in with email"})]})]}):"email log in"===i?(0,t.jsxs)("form",{className:"flex flex-col gap-1",onSubmit:e=>{e.preventDefault(),e.stopPropagation(),R()},children:[(0,t.jsx)("h3",{className:"text-center",children:"Log in with Email"}),(0,t.jsx)(s.EmailInput,{large:!0,autoFocus:!1!==e.open,value:C,onChange:j,loading:N,action:(0,t.jsx)("button",{type:"submit",onClick:e=>{e.preventDefault(),e.stopPropagation(),R()},children:(0,t.jsx)(u.GoToArrow,{className:"h-fit"})})}),(0,t.jsx)("hr",{className:"border-border-light my-2"}),(0,t.jsx)("button",{type:"button",className:"text-accent-contrast text-sm",onClick:e=>{e.preventDefault(),e.stopPropagation(),v("log in")},children:"or log in with Atmosphere account"})]}):"email confirm"===i?(0,t.jsx)(s.EmailConfirm,{autoFocus:!1!==e.open,emailValue:C,loading:N,onSubmit:U,onBack:()=>v("email log in")}):(0,t.jsxs)("div",{className:"text-center text-sm",children:[(0,t.jsxs)("h3",{className:"pb-1",children:["Leaflet is part of ",(0,t.jsx)("br",{}),"the Atmosphere."]}),(0,t.jsx)("div",{className:"text-secondary pb-3",children:"Create an Atmosphere account on Bluesky to get started!"}),(0,t.jsxs)(a.ButtonPrimary,{className:"mx-auto mb-1",onClick:()=>{window.location.href=(0,x.buildOauthLoginUrl)({redirect:e.redirectRoute||"/",signup:!0,action:e.action,addAccount:e.addAccount})}
27,children:[(0,t.jsx)(p.BlueskyTiny,{})," Sign up via Bluesky"]}),(0,t.jsx)(l.AtmosphericHandleInfo,{})]})})]})},w=e=>{let n,i,a,s,d,m,h,f,b,g,y=(0,r.c)(21),[v,C]=(0,c.useState)(!1),w=`accent-container w-xs flex flex-col gap-1 ${e.pageView?" p-4 py-5":"px-3 py-4 "}`;y[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsxs)("h3",{children:["Link your ",(0,t.jsx)("br",{}),"Atmosphere account"]}),y[0]=n):n=y[0],y[1]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-center mx-auto leading-tight pb-2",children:[n,(0,t.jsx)(l.AtmosphericHandleInfo,{trigger:(0,t.jsx)("div",{className:"text-sm text-accent-contrast",children:"What's the Atmosphere?"})})]}),y[1]=i):i=y[1];let j=!1!==e.open;return y[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)(u.GoToArrow,{className:"text-accent-contrast"}),y[2]=a):a=y[2],y[3]!==e.action||y[4]!==e.redirectRoute?(s=t=>{C(!0),window.location.href=(0,x.buildOauthLoginUrl)({handle:t,redirect:e.redirectRoute||window.location.href,action:e.action,link:!0})},y[3]=e.action,y[4]=e.redirectRoute,y[5]=s):s=y[5],y[6]!==v||y[7]!==j||y[8]!==s?(d=(0,t.jsx)(o.HandleSearchInput,{large:!0,autoFocus:j,action:a,loading:v,validateHandle:!0,onSubmit:s}),y[6]=v,y[7]=j,y[8]=s,y[9]=d):d=y[9],y[10]===Symbol.for("react.memo_cache_sentinel")?(m=(0,t.jsx)("hr",{className:"border-border-light mt-2 mb-1"}),y[10]=m):m=y[10],y[11]!==e.action||y[12]!==e.redirectRoute?(h=()=>{window.location.href=(0,x.buildOauthLoginUrl)({redirect:e.redirectRoute||"/",signup:!0,action:e.action,link:!0})},y[11]=e.action,y[12]=e.redirectRoute,y[13]=h):h=y[13],y[14]===Symbol.for("react.memo_cache_sentinel")?(f=(0,t.jsx)(p.BlueskyTiny,{}),y[14]=f):f=y[14],y[15]!==h?(b=(0,t.jsxs)("button",{type:"button",className:"text-sm text-accent-contrast flex gap-1 items-center mx-auto",onClick:h,children:[f," or sign up via Bluesky"]}),y[15]=h,y[16]=b):b=y[16],y[17]!==w||y[18]!==b||y[19]!==d?(g=(0,t.jsxs)("div",{className:w,children:[i,d,m,b]}),y[17]=w,y[18]=b,y[19]=d,y[20]=g):g=y[20],g}},860740,532089,681415,449883,27542,320205,e=>{"use strict";var t=e.i(843476),r=e.i(500932),n=e.i(806398),i=e.i(271645),a=e.i(618566),l=e.i(338448),o=e.i(69278),s=e.i(788613),c=e.i(857592),u=e.i(793610),d=e.i(997796),m=e.i(30083),p=e.i(541019),h=e.i(791676),f=e.i(864460),b=e.i(192506),g=e.i(144063),x=e.i(393123);let y=e=>(e/100).toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2*(e%100!=0)});function v(e,t){return"year"===t&&null!=e.annual_price_cents?e.annual_price_cents:e.monthly_price_cents}function C(e,t){let r="year"===t&&null!=e.annual_price_cents;return`${y(v(e,t))}/${r?"yr":"mo"}`}let w=(e,t)=>null!=e.annual_price_cents?t:"month",j=e=>"subscriber"===e.kind?"subscriber":e.tier.id;function S(e){let n,i,a,l,c,u,d=(0,r.c)(25);if(d[0]!==e){let r,c,u;d[5]!==e.cadence?(r=(t,r)=>v(t,e.cadence)-v(r,e.cadence),d[5]=e.cadence,d[6]=r):r=d[6];let m=[...e.tiers.paid].sort(r),p=[{kind:"subscriber",tier:e.tiers.subscriber},...m.map(N)],y=m.some(k),S=e.currentMembership;d[7]!==S||d[8]!==e.tiers.paid?(c=S?.kind==="paid"?e.tiers.paid.find(e=>e.id===S.tierId):void 0,d[7]=S,d[8]=e.tiers.paid,d[9]=c):c=d[9];let _=c,P=_?_.monthly_price_cents:S?.kind==="free"?0:null;d[10]!==S||d[11]!==P||d[12]!==e.cadence?(u=t=>{let r=C(t,w(t,e.cadence));return S?null!=P&&t.monthly_price_cents>P?`Upgrade for ${r}`:`Change for ${r}`:`Join for ${r}`},d[10]=S,d[11]=P,d[12]=e.cadence,d[13]=u):u=d[13];let R=u;d[14]!==y||d[15]!==e.cadence||d[16]!==e.onCadenceChange?(l=y&&(0,t.jsx)("div",{className:"flex justify-center pb-4",children:(0,t.jsx)(h.ToggleGroup,{value:e.cadence,onChange:e.onCadenceChange,optionClassName:"px-8",options:[{value:"month",label:"Monthly"},{value:"year",label:"Annual"}]})}),d[14]=y,d[15]=e.cadence,d[16]=e.onCadenceChange,d[17]=l):l=d[17],n="tierGroup sm:grid sm:gap-x-3 sm:gap-y-6 gap-6 flex flex-col w-full items-stretch min-h-0 grow",i=(0,x.centeredGridStyle)(p.length),a=p.map((r,n)=>{let i=j(r),a="subscriber"===r.kind?S?.kind==="free":S?.kind==="paid"&&S.tierId===r.tier.id,l="subscriber"===r.kind?{kind:"free"}:{kind:"paid",tierId:r.tier.id};return(0,t.jsxs)("div",{style:(0,x.centeredGridCellStyle)(n,p.length),className:"tier opaque-container rounded-lg! relative flex flex-col p-4 pt-3 max-w-md w-full max-h-full",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 grow min-h-0 overflow-y-scroll",children:[(0,t.jsx)("h3",{className:"text-primary text-[20px]",children:r.tier.name}),r.tier.description&&(0,t.jsx)("div",{className:"text-secondary text-sm leading-snug pb-3",children:(0,t.jsx)(g.TierDescription,{description:r.tier.description})})]}),(0,t.jsxs)("div",{className:"tierJoinButton shrink-0 flex flex-col gap-2",children:[(0,t.jsx)("hr",{className:"border-border-light"}),a?(0,t.jsx)(o.ButtonSecondary,{fullWidth:!0,type:"button",disabled:!0,children:(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(f.CheckTiny,{className:"shrink-0"})," Subscribed"]})}):"subscriber"===r.kind?(0,t.jsx)(o.ButtonSecondary,{fullWidth:!0,type:"button",disabled:null!==e.busyPlan,onClick:()=>e.onSelectPlan(r),children:e.busyPlan===i?(0,t.jsx)(s.DotLoader,{}):S?"Change to free":"Subscribe for free"}):(0,t.jsx)(o.ButtonPrimary,{fullWidth:!0,type:"button",disabled:null!==e.busyPlan,onClick:()=>e.onSelectPlan(r),children:e.busyPlan===i?(0,t.jsx)(s.DotLoader,{}):R(r.tier)})]}),e.gatePolicy&&(0,b.membershipUnlocksGatedPost)(l,e.gatePolicy)&&(0,t.jsx)("div",{className:"tierPostUnlockIndicator absolute -bottom-3.5 left-0 right-0 flex justify-center",children:(0,t.jsxs)("div",{className:"opaque-container rounded-full! flex items-center gap-1 mx-auto px-2 py-0.5 text-xs font-bold text-accent-contrast",children:[(0,t.jsx)(f.CheckTiny,{className:"w-3 h-3 shrink-0"}),"Unlocks post"]})})]},i)}),d[0]=e,d[1]=n,d[2]=i,d[3]=a,d[4]=l}else n=d[1],i=d[2],a=d[3],l=d[4];return d[18]!==n||d[19]!==i||d[20]!==a?(c=(0,t.jsx)("div",{className:n,style:i,children:a}),d[18]=n,d[19]=i,d[20]=a,d[21]=c):c=d[21],d[22]!==l||d[23]!==c?(u=(0,t.jsxs)(t.Fragment,{children:[l,c]}),d[22]=l,d[23]=c,d[24]=u):u=d[24],u}function k(e){return null!=e.annual_price_cents}function N(e){return{kind:"paid",tier:e}}
27e.s(["TierGrid",0,S,"effectiveCadence",0,w,"formatPrice",0,y,"membershipPlanKey",0,j,"subscribeErrorMessage",0,function(e){switch(e){case"already_member":return"You're already a member!";case"email_required":return"Add an email to your account before joining.";case"no_card":return"Please add a card to continue.";case"no_connected_account":return"This publication can't accept payments right now.";case"not_authenticated":return"Sign in to become a member.";default:return"We couldn't complete your join. Please try again!"}},"tierPriceLabel",0,C],532089);var _=e.i(95187);let P=(0,_.createServerReference)("40cd48f1d819e96441067ed5f84fad77da814f4f62",_.callServer,void 0,_.findSourceMapURL,"previewMembershipChange"),R={year:"numeric",month:"short",day:"numeric"};function U(e){let n,i,a=(0,r.c)(7),o=e.state?.status==="ready"?e.state.preview:void 0,c=(0,l.useLocalizedDate)(o?.effectiveDate??"",R);if(!e.state)return null;a[0]!==c||a[1]!==e.state.preview||a[2]!==e.state.status?(n="loading"===e.state.status?(0,t.jsx)(s.DotLoader,{}):"error"===e.state.status?"Upgrades are charged now, prorated for the rest of the period. Downgrades take effect when the period ends.":function(e,t){let{immediate:r,totalCents:n,amountDueCents:i,currency:a}=e;return r?0===n?"Same price as your current plan, so you switch right away with nothing to pay.":i<=0?"Your account credit covers the rest of this period.":`You'll be charged ${(i/100).toLocaleString("en-US",{style:"currency",currency:a.toUpperCase(),minimumFractionDigits:2*(i%100!=0)})} now, prorated for the time left on your current plan.`:`You'll keep your current plan ${t?`until ${t}`:"until the end of your billing period"}, then switch. Nothing is charged today.`}(e.state.preview,e.state.preview.effectiveDate?c:""),a[0]=c,a[1]=e.state.preview,a[2]=e.state.status,a[3]=n):n=a[3];let u=n;return a[4]!==e.className||a[5]!==u?(i=(0,t.jsx)("div",{className:e.className,children:u}),a[4]=e.className,a[5]=u,a[6]=i):i=a[6],i}function M(e){let n,a,c,u,d,m,h,f,b,g,x,y,v,w=(0,r.c)(41),{membership:j}=e,S="subscriber"===e.newPlan.kind;w[0]!==j.tierId?(n=e=>e.id===j.tierId,w[0]=j.tierId,w[1]=n):n=w[1];let k=e.tiers.paid.find(n),N="year"===j.cadence?"year":"month",_=!S,R="paid"===e.newPlan.kind?e.newPlan.tier.id:null;w[2]!==j.id||w[3]!==e.cadence||w[4]!==_||w[5]!==R?(a={enabled:_,membershipId:j.id,tierId:R,cadence:e.cadence},w[2]=j.id,w[3]=e.cadence,w[4]=_,w[5]=R,w[6]=a):a=w[6];let M=function(e){let t,n,a=(0,r.c)(6),{enabled:l,membershipId:o,tierId:s,cadence:c}=e,[u,d]=(0,i.useState)(null);return a[0]!==c||a[1]!==l||a[2]!==o||a[3]!==s?(t=()=>{let e;return l&&s?(e=!1,d({status:"loading"}),P({membershipId:o,tierId:s,cadence:c}).then(t=>{e||d(t.ok?{status:"ready",preview:t.value}:{status:"error"})}).catch(()=>{e||d({status:"error"})}),()=>{e=!0}):void d(null)},n=[l,o,s,c],a[0]=c,a[1]=l,a[2]=o,a[3]=s,a[4]=t,a[5]=n):(t=a[4],n=a[5]),(0,i.useEffect)(t,n),u}(a);w[7]===Symbol.for("react.memo_cache_sentinel")?(c={year:"numeric",month:"short",day:"numeric"},w[7]=c):c=w[7];let E=(0,l.useLocalizedDate)(j.currentPeriodEnd??"",c),L=k&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"opaque-container w-fit py-0.5 px-2 text-tertiary",children:[k.name," ·"," ",C(k,N)]}),(0,t.jsx)(p.GoToArrowLined,{className:"rotate-90 text-tertiary"})]});w[8]!==e.cadence||w[9]!==e.newPlan.kind||w[10]!==e.newPlan.tier?(u="paid"===e.newPlan.kind&&(0,t.jsxs)(t.Fragment,{children:[" · ",C(e.newPlan.tier,e.cadence)]}),w[8]=e.cadence,w[9]=e.newPlan.kind,w[10]=e.newPlan.tier,w[11]=u):u=w[11],w[12]!==e.newPlan.tier.name||w[13]!==u?(d=(0,t.jsxs)("div",{className:"accent-container w-fit py-0.5 px-2 font-bold text-accent-contrast border border-accent-contrast",children:[e.newPlan.tier.name,u]}),w[12]=e.newPlan.tier.name,w[13]=u,w[14]=d):d=w[14],w[15]!==d||w[16]!==L?(m=(0,t.jsx)("div",{className:"text-secondary leading-snug",children:(0,t.jsxs)("div",{className:"flex flex-col justify-center items-center mx-auto gap-1 pt-2",children:[L,d]})}),w[15]=d,w[16]=L,w[17]=m):m=w[17],w[18]!==E||w[19]!==S||w[20]!==j.currentPeriodEnd||w[21]!==M?(h=S?(0,t.jsxs)("div",{className:"text-tertiary text-sm",children:["You'll keep member access"," ",j.currentPeriodEnd?`until ${E}`:"until the end of your billing period"]}):(0,t.jsx)(U,{state:M,className:"text-tertiary text-sm text-center mx-auto"}),w[18]=E,w[19]=S,w[20]=j.currentPeriodEnd,w[21]=M,w[22]=h):h=w[22],w[23]!==j.pendingPlan?(f=j.pendingPlan&&(0,t.jsxs)("div",{className:"text-tertiary text-sm",children:["This replaces your scheduled switch to"," ",j.pendingPlan.tierName??"another plan","."]}
27),w[23]=j.pendingPlan,w[24]=f):f=w[24],w[25]!==e.onClose?(b=(0,t.jsx)(o.ButtonTertiary,{type:"button",onClick:e.onClose,children:"Nevermind"}),w[25]=e.onClose,w[26]=b):b=w[26];let A=e.busy||M?.status==="loading";return w[27]!==e.busy?(g=e.busy?(0,t.jsx)(s.DotLoader,{}):"Change Membership",w[27]=e.busy,w[28]=g):g=w[28],w[29]!==e.onConfirm||w[30]!==A||w[31]!==g?(x=(0,t.jsx)(o.ButtonPrimary,{type:"button",disabled:A,onClick:e.onConfirm,children:g}),w[29]=e.onConfirm,w[30]=A,w[31]=g,w[32]=x):x=w[32],w[33]!==b||w[34]!==x?(y=(0,t.jsxs)("div",{className:"flex gap-3 mx-auto",children:[b,x]}),w[33]=b,w[34]=x,w[35]=y):y=w[35],w[36]!==m||w[37]!==h||w[38]!==f||w[39]!==y?(v=(0,t.jsxs)("div",{className:"flex flex-col gap-3 w-full max-w-sm mx-auto text-center",children:[m,h,f,y]}),w[36]=m,w[37]=h,w[38]=f,w[39]=y,w[40]=v):v=w[40],v}var E=e.i(283599),L=e.i(72545);let A=(0,_.createServerReference)("40dca83fce78647eb08beb3aba1f0e609a1fdc056d",_.callServer,void 0,_.findSourceMapURL,"getMyMembershipForPublication"),T=e=>`my-membership-${e}`,I=e=>(0,L.mutate)(T(e));e.s(["mutateMyMembership",0,I,"useMyMembership",0,function(e){let t,i,a,l=(0,r.c)(9),{identity:o}=(0,n.useIdentityData)(),s=!!o?.publication_memberships?.some(t=>t.publication===e);l[0]!==s||l[1]!==e?(t=s?T(e):null,l[0]=s,l[1]=e,l[2]=t):t=l[2],l[3]!==e?(i=()=>A(e),l[3]=e,l[4]=i):i=l[4];let{data:c,mutate:u,isLoading:d}=(0,E.default)(t,i),m=c??null;return l[5]!==d||l[6]!==u||l[7]!==m?(a={membership:m,isLoading:d,mutate:u},l[5]=d,l[6]=u,l[7]=m,l[8]=a):a=l[8],a}],681415);let O=(0,_.createServerReference)("403f422e89facc196c5d2ab26f0a2f14483eab482a",_.callServer,void 0,_.findSourceMapURL,"getMembershipTiers");function D(e){let t,n,i,a=(0,r.c)(6);a[0]!==e?(t=()=>O(e),a[0]=e,a[1]=t):t=a[1],a[2]===Symbol.for("react.memo_cache_sentinel")?(n={revalidateOnFocus:!1},a[2]=n):n=a[2];let{data:l}=(0,E.default)(e?`membership-tiers-${e}`:null,t,n),o=l??null,s=!!o?.paid.length;return a[3]!==s||a[4]!==o?(i={tiers:o,hasPaidTiers:s},a[3]=s,a[4]=o,a[5]=i):i=a[5],i}function B(e){let t="year"===e.cadence?e.annualPriceCents:e.monthlyPriceCents;return null==t?null:`${y(t)}/${"year"===e.cadence?"yr":"mo"}`}function $(e){return"active"===e||"trialing"===e}function F(e){let p,h,f,b,g,x,y,v,j=(0,r.c)(56),k=e.membership,N=(0,u.useToaster)(),_=(0,a.useRouter)(),{tiers:P}=D(e.tiers?void 0:k.publication),R=e.tiers??P,[U,E]=(0,i.useState)("year"===k.cadence?"year":"month"),[L,A]=(0,i.useState)(null),[T,O]=(0,i.useState)(null),[B,$]=(0,i.useState)(!1);j[0]!==L?(p=L?()=>A(null):null,j[0]=L,j[1]=p):p=j[1],(0,c.useModalBack)(p),j[2]===Symbol.for("react.memo_cache_sentinel")?(h={year:"numeric",month:"short",day:"numeric"},j[2]=h):h=j[2];let F=(0,l.useLocalizedDate)(k.currentPeriodEnd??"",h);j[3]!==k.publication||j[4]!==_?(f=e=>{A(null),O(e),I(k.publication),(0,n.refreshIdentityData)(),_.refresh()},j[3]=k.publication,j[4]=_,j[5]=f):f=j[5];let H=f;j[6]!==U||j[7]!==H||j[8]!==k.currentPeriodEnd||j[9]!==k.id||j[10]!==F||j[11]!==B||j[12]!==N?(b=async e=>{if(B)return;$(!0);let t=await (0,m.changeMembership)({membershipId:k.id,tierId:e.tier.id,cadence:w(e.tier,U)});if($(!1),!t.ok)return void N({type:"error",content:"Couldn't change plans. Please try again."});let r=C(e.tier,w(e.tier,U));H(t.value.immediate?`You're now on the ${e.tier.name} plan, at ${r}.`:`You'll move to the ${e.tier.name} plan, at ${r}, ${k.currentPeriodEnd?`on ${F}`:"at the end of your billing period"}.`)},j[6]=U,j[7]=H,j[8]=k.currentPeriodEnd,j[9]=k.id,j[10]=F,j[11]=B,j[12]=N,j[13]=b):b=j[13];let W=b;j[14]!==H||j[15]!==k.id||j[16]!==k.publication||j[17]!==B||j[18]!==N?(g=async()=>{if(B)return;$(!0);let e=await (0,d.changeMembershipToFree)({membershipId:k.id,publicationUri:k.publication});($(!1),e.ok)?H(e.value.subscribed?"You'll move to the free plan at the end of your billing period.":"Your membership expires at the end of your billing period."):N({type:"error",content:"We couldn't downgrade your plan. Please try again!"})},j[14]=H,j[15]=k.id,j[16]=k.publication,j[17]=B,j[18]=N,j[19]=g):g=j[19];let z=g;if(T){let r,n,i,a;return j[20]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("strong",{children:"Your membership has been updated!"}),j[20]=r):r=j[20],j[21]!==T?(n=(0,t.jsxs)("div",{className:"text-secondary leading-snug flex flex-col",children:[r,(0,t.jsx)("p",{children:T})]}),j[21]=T,j[22]=n):n=j[22],j[23]!==e.onSuccess?(i=(0,t.jsx)(o.ButtonPrimary,{type:"button",fullWidth:!0,onClick:e.onSuccess,children:"Close"}),j[23]=e.onSuccess,j[24]=i):i=j[24],j[25]!==n||j[26]!==i?(a=(0,t.jsxs)("div",{className:"flex flex-col gap-3 w-full max-w-sm mx-auto text-center justify-center",children:[n,i]}),j[25]=n,j[26]=i,j[27]=a):a=j[27],a}if(!R){let e;return j[28]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("div",{className:"flex justify-center py-8",children:(0,t.jsx)(s.DotLoader,{})}),j[28]=e):e=j[28],e}if(L){let e,r,n,i;return j[29]!==U||j[30]!==L.kind||j[31]!==L.tier?(e="paid"===L.kind?w(L.tier,U):"month",j[29]=U,j[30]=L.kind,j[31]=L.tier,j[32]=e):e=j[32],j[33]!==L||j[34]!==z||j[35]!==W?(r=()=>"subscriber"===L.kind?z():W(L),j[33]=L,j[34]=z,j[35]=W,j[36]=r):r=j[36],j[37]===Symbol.for("react.memo_cache_sentinel")?(n=()=>A(null),j[37]=n):n=j[37],j[38]!==L||j[39]!==k||j[40]!==B||j[41]!==e||j[42]!==r||j[43]!==R?(i=(0,t.jsx)(M,{membership:k,tiers:R,newPlan:L,cadence:e,busy:B,onConfirm:r,onClose:n}),j[38]=L,j[39]=k,j[40]=B,j[41]=e,j[42]=r,j[43]=R,j[44]=i):i=j[44],i}return j[45]!==k.tierId?(x={kind:"paid",tierId:k.tierId},j[45]=k.tierId,j[46]=x):x=j[46],j[47]!==k.cancelAtPeriodEnd||j[48]!==N?(y=e=>k.cancelAtPeriodEnd?N({type:"error",content:"Resume your membership to change plans."}):A(e),j[47]=k.cancelAtPeriodEnd,j[48]=N,j[49]=y):y=j[49],j[50]!==U||j[51]!==e.gatePolicy||j[52]!==x||j[53]!==y||j[54]!==R?(v=(0,t.jsx)("div",{className:"flex flex-col gap-3 max-w-3xl",children:(0,t.jsx)(S,{tiers:R,cadence:U,onCadenceChange:E,busyPlan:null,currentMembership:x,gatePolicy:e.gatePolicy,onSelectPlan:y})}),j[50]=U,j[51]=e.gatePolicy,j[52]=x,j[53]=y,j[54]=R,j[55]=v):v=j[55],v}e.s(["useMembershipTiers",0,D],449883),e.s(["ChangePlanForm",0,F,"ChangePlanModal",0,function(e){let n,i,a,l,o,s=(0,r.c)(14);s[0]!==e?(n=t=>!t&&e.onClose(),s[0]=e,s[1]=n):n=s[1];let u=e.title?e.title:"Change your membership";return s[2]!==u?(i=(0,t.jsx)("h2",{className:"mx-auto text-center pb-2",children:u}),s[2]=u,s[3]=i):i=s[3],s[4]!==e?(a=()=>{e.onSuccess?.(),e.onClose()},s[4]=e,s[5]=a):a=s[5],s[6]!==e.gatePolicy||s[7]!==e.membership||s[8]!==a?(l=(0,t.jsx)(F,{membership:e.membership,gatePolicy:e.gatePolicy,onSuccess:a}),s[6]=e.gatePolicy,s[7]=e.membership,s[8]=a,s[9]=l):l=s[9],s[10]!==n||s[11]!==i||s[12]!==l?
27(o=(0,t.jsx)(c.Modal,{open:!0,onOpenChange:n,title:i,className:"max-w-full w-fit bg-[var(--color-bg-light)]!",sheetOnMobile:!0,children:l}),s[10]=n,s[11]=i,s[12]=l,s[13]=o):o=s[13],o},"MembershipActions",0,function(e){let n,i=(0,r.c)(5),a=e.membership;return $(a.status)?(i[0]!==a.cancelAtPeriodEnd||i[1]!==e.onCancel||i[2]!==e.onChangePlan||i[3]!==e.onResume?(n=(0,t.jsx)(t.Fragment,{children:a.cancelAtPeriodEnd?(0,t.jsx)(o.ButtonPrimary,{className:"text-sm",type:"button",compact:!0,onClick:e.onResume,children:"Resume"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.ButtonPrimary,{className:"text-sm",type:"button",compact:!0,onClick:e.onChangePlan,children:"Change"}),e.onCancel&&(0,t.jsx)(o.ButtonSecondary,{className:"text-sm",type:"button",compact:!0,onClick:e.onCancel,children:"Cancel"})]})}),i[0]=a.cancelAtPeriodEnd,i[1]=e.onCancel,i[2]=e.onChangePlan,i[3]=e.onResume,i[4]=n):n=i[4],n):null},"isMembershipActive",0,$,"membershipPrice",0,B,"pendingPlanLabel",0,function(e,t){let r=e.pendingPlan;if(!r)return null;let n=null==r.priceCents?"":` \xb7 ${y(r.priceCents)}/${"year"===r.cadence?"yr":"mo"}`,i=t?` on ${t}`:"";return`Switches to ${r.tierName??"another plan"}${n}${i}`}],860740);let H=(0,_.createServerReference)("4093f737b315e24e59bccab361ced7d89c2a7f60e4",_.callServer,void 0,_.findSourceMapURL,"cancelMembership");function W(e){let c,d,m,p,h,f,b,g,x,y,v=(0,r.c)(38),C=e.membership,w=(0,u.useToaster)(),j=(0,a.useRouter)(),[S,k]=(0,i.useState)(!1),[N,_]=(0,i.useState)(C.cancelAtPeriodEnd);v[0]===Symbol.for("react.memo_cache_sentinel")?(c={year:"numeric",month:"short",day:"numeric"},v[0]=c):c=v[0];let P=(0,l.useLocalizedDate)(C.currentPeriodEnd??"",c);v[1]!==S||v[2]!==C.id||v[3]!==C.publication||v[4]!==j||v[5]!==w?(d=async()=>{if(S)return;k(!0);let e=await H(C.id);(k(!1),e.ok)?(_(!0),I(C.publication),(0,n.refreshIdentityData)(),j.refresh()):w({type:"error",content:"Couldn't cancel. Please try again."})},v[1]=S,v[2]=C.id,v[3]=C.publication,v[4]=j,v[5]=w,v[6]=d):d=v[6];let R=d;if(N){let r,n,i,a,l;v[7]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("strong",{children:"Your membership has been cancelled!"}),v[7]=r):r=v[7],v[8]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("br",{}),v[8]=n):n=v[8];let s=C.currentPeriodEnd?P:"the end of your billing period";return v[9]!==s?(i=(0,t.jsxs)("div",{className:"text-secondary leading-snug flex flex-col",children:[r,(0,t.jsxs)("p",{children:["You will continue to receive updates and access member posts until"," ",n,(0,t.jsx)("strong",{children:s}),"."]})]}),v[9]=s,v[10]=i):i=v[10],v[11]!==S||v[12]!==e.onSuccess?(a=(0,t.jsx)(o.ButtonPrimary,{type:"button",fullWidth:!0,disabled:S,onClick:e.onSuccess,children:"Close"}),v[11]=S,v[12]=e.onSuccess,v[13]=a):a=v[13],v[14]!==i||v[15]!==a?(l=(0,t.jsxs)("div",{className:"flex flex-col gap-3 text-center justify-center",children:[i,a]}),v[14]=i,v[15]=a,v[16]=l):l=v[16],l}v[17]!==C.tierName?(m=C.tierName?(0,t.jsx)("strong",{children:C.tierName}):"",v[17]=C.tierName,v[18]=m):m=v[18],v[19]!==m?(p=(0,t.jsxs)("div",{className:"",children:["Cancel your ",m," ","membership?"]}),v[19]=m,v[20]=p):p=v[20];let U=C.currentPeriodEnd?`until ${P}`:"until the end of your billing period";return v[21]!==U?(h=(0,t.jsxs)("div",{children:["You'll keep member access"," ",U]}),v[21]=U,v[22]=h):h=v[22],v[23]!==e.onBack?(f=e.onBack&&(0,t.jsx)(o.ButtonTertiary,{type:"button",onClick:e.onBack,children:"Nevermind"}),v[23]=e.onBack,v[24]=f):f=v[24],v[25]!==S?(b=S?(0,t.jsx)(s.DotLoader,{}):"Cancel membership",v[25]=S,v[26]=b):b=v[26],v[27]!==S||v[28]!==R||v[29]!==b?(g=(0,t.jsx)(o.ButtonPrimary,{type:"button",disabled:S,onClick:R,children:b}),v[27]=S,v[28]=R,v[29]=b,v[30]=g):g=v[30],v[31]!==f||v[32]!==g?(x=(0,t.jsxs)("div",{className:"flex gap-3 pt-2 justify-center",children:[f,g]}),v[31]=f,v[32]=g,v[33]=x):x=v[33],v[34]!==p||v[35]!==h||v[36]!==x?(y=(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-center text-secondary leading-snug",children:[p,h,x]}),v[34]=p,v[35]=h,v[36]=x,v[37]=y):y=v[37],y}e.s(["CancelMembershipForm",0,W,"CancelMembershipModal",0,function(e){let n,i,a,l=(0,r.c)(8);return l[0]!==e?(n=t=>!t&&e.onClose(),l[0]=e,l[1]=n):n=l[1],l[2]!==e.membership||l[3]!==e.onClose?
27(i=(0,t.jsx)(W,{membership:e.membership,onSuccess:e.onClose,onBack:e.onClose}),l[2]=e.membership,l[3]=e.onClose,l[4]=i):i=l[4],l[5]!==n||l[6]!==i?(a=(0,t.jsx)(c.Modal,{open:!0,onOpenChange:n,title:"Cancel Membership?",className:"max-w-full w-sm text-center",children:i}),l[5]=n,l[6]=i,l[7]=a):a=l[7],a}],27542);let z=(0,_.createServerReference)("404db21c7ae0d4b9d2eb90f0db7b4fc63152825abe",_.callServer,void 0,_.findSourceMapURL,"resumeMembership");function G(e){let c,d,m,p,h,f,b,g,x,y=(0,r.c)(35),v=e.membership,C=(0,u.useToaster)(),w=(0,a.useRouter)(),[j,S]=(0,i.useState)(!1),[k,N]=(0,i.useState)(!1),_=B(v);y[0]===Symbol.for("react.memo_cache_sentinel")?(c={year:"numeric",month:"short",day:"numeric"},y[0]=c):c=y[0];let P=(0,l.useLocalizedDate)(v.currentPeriodEnd??"",c),R=v.currentPeriodEnd?`on ${P}`:"at the end of your billing period";y[1]!==j||y[2]!==v.id||y[3]!==v.publication||y[4]!==w||y[5]!==C?(d=async()=>{if(j)return;S(!0);let e=await z(v.id);(S(!1),e.ok)?(N(!0),I(v.publication),(0,n.refreshIdentityData)(),w.refresh()):C({type:"error",content:"Couldn't resume. Please try again."})},y[1]=j,y[2]=v.id,y[3]=v.publication,y[4]=w,y[5]=C,y[6]=d):d=y[6];let U=d;if(k){let r,n,i,a;return y[7]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("strong",{children:"Your membership has been resumed!"}),y[7]=r):r=y[7],y[8]!==R?(n=(0,t.jsxs)("div",{className:"text-secondary leading-snug flex flex-col",children:[r,(0,t.jsxs)("p",{children:["It will keep renewing ",R,"."]})]}),y[8]=R,y[9]=n):n=y[9],y[10]!==e.onSuccess?(i=(0,t.jsx)(o.ButtonPrimary,{type:"button",fullWidth:!0,onClick:e.onSuccess,children:"Close"}),y[10]=e.onSuccess,y[11]=i):i=y[11],y[12]!==n||y[13]!==i?(a=(0,t.jsxs)("div",{className:"flex flex-col gap-3 text-center justify-center",children:[n,i]}),y[12]=n,y[13]=i,y[14]=a):a=y[14],a}let M=v.tierName??"Membership",E=_?` \xb7 ${_}`:"";return y[15]!==M||y[16]!==E?(m=(0,t.jsx)("div",{className:"flex justify-center pt-2",children:(0,t.jsxs)("div",{className:"accent-container w-fit py-0.5 px-2 font-bold text-accent-contrast border border-accent-contrast",children:[M,E]})}),y[15]=M,y[16]=E,y[17]=m):m=y[17],y[18]!==R?(p=(0,t.jsxs)("div",{className:"text-tertiary text-sm",children:["Your membership will start renewing again ",R]}),y[18]=R,y[19]=p):p=y[19],y[20]!==e.onBack?(h=e.onBack&&(0,t.jsx)(o.ButtonTertiary,{type:"button",onClick:e.onBack,children:"Nevermind"}),y[20]=e.onBack,y[21]=h):h=y[21],y[22]!==j?(f=j?(0,t.jsx)(s.DotLoader,{}):"Resume Membership",y[22]=j,y[23]=f):f=y[23],y[24]!==j||y[25]!==U||y[26]!==f?(b=(0,t.jsx)(o.ButtonPrimary,{type:"button",disabled:j,onClick:U,children:f}),y[24]=j,y[25]=U,y[26]=f,y[27]=b):b=y[27],y[28]!==h||y[29]!==b?(g=(0,t.jsxs)("div",{className:"flex gap-3 mx-auto",children:[h,b]}),y[28]=h,y[29]=b,y[30]=g):g=y[30],y[31]!==m||y[32]!==p||y[33]!==g?(x=(0,t.jsxs)("div",{className:"flex flex-col gap-3 w-full max-w-sm mx-auto text-center",children:[m,p,g]}),y[31]=m,y[32]=p,y[33]=g,y[34]=x):x=y[34],x}e.s(["ResumeMembershipForm",0,G,"ResumeMembershipModal",0,function(e){let n,i,a,l=(0,r.c)(8);return l[0]!==e?(n=t=>!t&&e.onClose(),l[0]=e,l[1]=n):n=l[1],l[2]!==e.membership||l[3]!==e.onClose?(i=(0,t.jsx)(G,{membership:e.membership,onSuccess:e.onClose,onBack:e.onClose}),l[2]=e.membership,l[3]=e.onClose,l[4]=i):i=l[4],l[5]!==n||l[6]!==i?(a=(0,t.jsx)(c.Modal,{open:!0,onOpenChange:n,title:"Resume Membership?",className:"max-w-full w-sm text-center",children:i}),l[5]=n,l[6]=i,l[7]=a):a=l[7],a}],320205)},911119,e=>{"use strict";e.s(["JoinMembershipFlow",()=>F]);var t=e.i(843476),r=e.i(500932),n=e.i(271645),i=e.i(618566),a=e.i(72545),l=e.i(788613),o=e.i(793610),s=e.i(806398),c=e.i(799596),u=e.i(277009),d=e.i(279490),m=e.i(324270),p=e.i(327630),h=e.i(368408),f=e.i(694777),b=e.i(545850),g=e.i(937929),x=e.i(532089),y=e.i(231363),v=e.i(152298),C=e.i(336731),w=e.i(59209),j=e.i(326420),S=e.i(443274),k=e.i(906695),N=e.i(519848),_=e.i(701544),P=e.i(860832),R=e.i(920855),U=e.i(31234),M=e.i(72864),E=e.i(607585),L=e.i(123838),A=e.i(671473),T=e.i(69278),I=e.i(338448),O=e.i(681415),D=e.i(860740),B=e.i(27542),$=e.i(320205);function F(e){let T,I,F,Z,V,q,Y,K,J,X,Q,ee,et,er,en,ei,ea,el,eo,es,ec,eu=(0,r.c)(130),ed=(0,o.useToaster)();(0,o.useSmoker)();let em=(0,i.useRouter)(),{identity:ep,identityPending:eh}=(0,s.useIdentityData)(),ef=(0,b.useViewerSubscription)(e.publicationUri),{membership:eb}=(0,O.useMyMembership)(e.publicationUri),eg=ef.membership?.kind==="paid",[ex,ey]=(0,n.use
27State)(null),[ev,eC]=(0,n.useState)(0),[ew,ej]=(0,n.useState)(e.viewerOverride??null),[eS,ek]=(0,n.useState)(""),[eN,e_]=(0,n.useState)(""),[eP,eR]=(0,n.useState)(e.newsletterMode?"email":"atproto"),[eU,eM]=(0,n.useState)("month"),[eE,eL]=(0,n.useState)(null),[eA,eT]=(0,n.useState)(!1),[eI,eO]=(0,n.useState)(!1),[eD,eB]=(0,n.useState)(null),[e$,eF]=(0,n.useState)(null),[eH,eW]=(0,n.useState)(!1),[ez,eG]=(0,n.useState)(null),[eZ,eV]=(0,n.useState)(!1),eq=(0,n.useRef)(!1);(0,d.useSubscribeSuccessData)(e.active?e.publicationUri:void 0);let eY=e.newsletterMode?!!ep?.email:!!ep?.bsky_profiles?.handle,eK=ep&&eY?e.newsletterMode?ep.email:`@${ep.bsky_profiles?.handle}`:null;eu[0]!==e.active||eu[1]!==e.publicationUri||eu[2]!==e.viewerOverride?(T=()=>{let t;if(e.active&&!e.viewerOverride)return t=!1,(0,v.getMembershipJoinViewer)(e.publicationUri).then(e=>{t||ej(e)}),()=>{t=!0}},eu[0]=e.active,eu[1]=e.publicationUri,eu[2]=e.viewerOverride,eu[3]=T):T=eu[3],eu[4]!==e.active||eu[5]!==e.publicationUri?(I=[e.active,e.publicationUri],eu[4]=e.active,eu[5]=e.publicationUri,eu[6]=I):I=eu[6],(0,n.useEffect)(T,I),eu[7]!==e.publicationUri||eu[8]!==e.source?(F=()=>(0,L.encodeActionToSearchParam)({action:"subscribe",publication:e.publicationUri,...e.source?{source:{url:window.location.href,...e.source}}:{}}),eu[7]=e.publicationUri,eu[8]=e.source,eu[9]=F):F=eu[9];let eJ=F;eu[10]!==eU?(Z=e=>{let t=new URL(window.location.href);return t.searchParams.delete("join_tier"),t.searchParams.delete("join_cadence"),"paid"===e.kind&&(t.searchParams.set("join_tier",e.tier.id),t.searchParams.set("join_cadence",(0,x.effectiveCadence)(e.tier,eU))),t.toString()},eu[10]=eU,eu[11]=Z):Z=eu[11];let eX=Z;eu[12]!==e||eu[13]!==em||eu[14]!==ed?(V=t=>{ed({type:"success",content:t}),e.onClose?.(),eL(null),(0,a.mutate)("identity"),(0,y.revalidateUnlocks)(),em.refresh()},eu[12]=e,eu[13]=em,eu[14]=ed,eu[15]=V):V=eu[15];let eQ=V;eu[16]!==e.publicationUri||eu[17]!==e.source||eu[18]!==em||eu[19]!==ed?(q=async(t,r)=>{let n=await (0,C.subscribeToTier)({publicationUri:e.publicationUri,tierId:t,cadence:r,source:e.source?{url:window.location.href,...e.source}:void 0});if(!n.ok)return ed({type:"error",content:(0,x.subscribeErrorMessage)(n.error)}),"error";let{status:i,hostedInvoiceUrl:l}=n.value;return"active"===i||"trialing"===i?(eV(!0),(0,a.mutate)("identity"),(0,y.revalidateUnlocks)(),em.refresh(),"success"):l?(window.location.href=l,"navigating"):(ed({type:"error",content:"We couldn't complete your payment. Please try again!"}),"error")},eu[16]=e.publicationUri,eu[17]=e.source,eu[18]=em,eu[19]=ed,eu[20]=q):q=eu[20];let e1=q;eu[21]!==eU||eu[22]!==ep?.email||eu[23]!==ed||eu[24]!==ew?(Y=async(e,t,r)=>{if(!(t?.hasEmail??ew?.hasEmail??!!ep?.email))return void ed({type:"error",content:"Add an email to your account before joining."});let n=r??(0,x.effectiveCadence)(e,eU);t&&!ew&&ej(t),eG({tier:e,cadence:n})},eu[21]=eU,eu[22]=ep?.email,eu[23]=ed,eu[24]=ew,eu[25]=Y):Y=eu[25];let e0=Y;eu[26]!==ez||eu[27]!==e1||eu[28]!==ed?(K=async e=>{if(ez){if(!(await (0,j.saveWalletCardFromSetupIntent)(e)).ok){ed({type:"error",content:"We couldn't save your payment method. Please try again!"}),eG(null);return}"navigating"!==await e1(ez.tier.id,ez.cadence)&&eG(null)}},eu[26]=ez,eu[27]=e1,eu[28]=ed,eu[29]=K):K=eu[29];let e2=K;eu[30]!==e0||eu[31]!==e.active||eu[32]!==e.publicationUri||eu[33]!==e.resume||eu[34]!==e.tiers||eu[35]!==e1||eu[36]!==ed?(J=()=>{let t=e.resume;e.active&&t&&!eq.current&&(eq.current=!0,(async()=>{if(eT(!0),"wallet"===t.kind){if(!(await (0,w.saveWalletCardFromSession)(t.sessionId)).ok){eT(!1),ed({type:"error",content:"We couldn't save your card. Please try again!"});return}if(t.tierId&&t.cadence){let e=await e1(t.tierId,t.cadence);if("navigating"===e)return;if("success"===e)return eT(!1)}ej(await (0,v.getMembershipJoinViewer)(e.publicationUri)),eT(!1)}else{let r=await (0,v.getMembershipJoinViewer)(e.publicationUri);ej(r);let n=e.tiers.paid.find(e=>e.id===t.tierId);if("year"===t.cadence&&eM("year"),eT(!1),!r.loggedIn||!n)return;await e0(n,r,t.cadence)}})())},eu[30]=e0,eu[31]=e.active,eu[32]=e.publicationUri,eu[33]=e.resume,eu[34]=e.tiers,eu[35]=e1,eu[36]=ed,eu[37]=J):J=eu[37],eu[38]!==e.active||eu[39]!==e.resume?(X=[e.active,e.resume],eu[38]=e.active,eu[39]=e.resume,eu[40]=X):X=eu[40],(0,n.useEffect)(J,X),eu[41]!==eQ||eu[42]!==ep||eu[43]!==e.newsletterMode||eu[44]!==e.publicationUri||eu[45]!==e.s
27ource||eu[46]!==ed?(Q=async()=>{if(eL("subscriber"),e.newsletterMode&&ep?.email){let t=await (0,k.requestPublicationEmailSubscription)(e.publicationUri,ep.email,e.source);if(!t.ok){eL(null),ed({type:"error",content:g.SUBSCRIBE_ERROR_MESSAGES[t.error]});return}}else if(!(await (0,M.subscribeToPublication)(e.publicationUri,window.location.href,e.source)).success){eL(null),ed({type:"error",content:"We couldn't subscribe you. Try again."});return}eQ("You're subscribed!")},eu[41]=eQ,eu[42]=ep,eu[43]=e.newsletterMode,eu[44]=e.publicationUri,eu[45]=e.source,eu[46]=ed,eu[47]=Q):Q=eu[47];let e3=Q;eu[48]!==eS||eu[49]!==eX||eu[50]!==e.publicationName||eu[51]!==e.publicationUrl||eu[52]!==eJ||eu[53]!==ed?(ee=async t=>{let r=(0,E.mainSiteAuthBase)();if(r){eL((0,x.membershipPlanKey)(t));let e=new URL("/api/auth/email-login",r);e.searchParams.set("email",eS),e.searchParams.set("redirect",eX(t)),e.searchParams.set("action",eJ()),window.location.href=e.toString();return}eL((0,x.membershipPlanKey)(t));try{let r=await (0,_.requestAuthEmailToken)(eS,{publicationName:e.publicationName,publicationUrl:e.publicationUrl});eB({kind:"authToken",tokenId:r,plan:t})}catch{ed({type:"error",content:"We couldn't send the email. Please try again!"})}eL(null)},eu[48]=eS,eu[49]=eX,eu[50]=e.publicationName,eu[51]=e.publicationUrl,eu[52]=eJ,eu[53]=ed,eu[54]=ee):ee=eu[54];let e4=ee;eu[55]!==eN||eu[56]!==eX||eu[57]!==eJ?(et=(e,t)=>{eL((0,x.membershipPlanKey)(e)),window.location.href=(0,E.buildOauthLoginUrl)({handle:eN.trim(),redirect:eX(e),action:eJ(),link:t,autoMerge:t})},eu[55]=eN,eu[56]=eX,eu[57]=eJ,eu[58]=et):et=eu[58];let e5=et;eu[59]!==eS||eu[60]!==eQ||eu[61]!==e0||eu[62]!==e.publicationUri||eu[63]!==e.source||eu[64]!==ed?(en=async t=>{eL((0,x.membershipPlanKey)(t));let r=await (0,k.requestPublicationEmailSubscription)(e.publicationUri,eS,e.source);(eL(null),r.ok)?r.value.confirmed?"subscriber"===t.kind?eQ("You're subscribed!"):await er(t.tier):eB({kind:"pubCode",plan:t}):ed({type:"error",content:g.SUBSCRIBE_ERROR_MESSAGES[r.error]})},er=async t=>{(0,a.mutate)("identity");let r=await (0,v.getMembershipJoinViewer)(e.publicationUri);ej(r),await e0(t,r)},eu[59]=eS,eu[60]=eQ,eu[61]=e0,eu[62]=e.publicationUri,eu[63]=e.source,eu[64]=ed,eu[65]=er,eu[66]=en):(er=eu[65],en=eu[66]),eu[67]!==eD||eu[68]!==eI||eu[69]!==eS||eu[70]!==eQ||eu[71]!==er||eu[72]!==e.publicationUri||eu[73]!==e.source||eu[74]!==ed?(ei=async t=>{if(!eD||eI)return;eO(!0);let r=eD.plan;if("authToken"===eD.kind){if(!await (0,P.confirmEmailAuthToken)(eD.tokenId,t,"membership")){eO(!1),ed({type:"error",content:"Incorrect code!"});return}await (0,R.loginWithEmailToken)((0,U.getHomeDocs)().filter(W)),(0,a.mutate)("identity");let r=await (0,k.requestPublicationEmailSubscription)(e.publicationUri,eS,e.source);if(!r.ok){eO(!1),ed({type:"error",content:g.SUBSCRIBE_ERROR_MESSAGES[r.error]});return}}else{let r=await (0,N.confirmPublicationEmailSubscription)(e.publicationUri,eS,t,!0,e.source);if(!r.ok){eO(!1),ed({type:"error",content:g.SUBSCRIBE_ERROR_MESSAGES[r.error]});return}}(eO(!1),eB(null),"subscriber"===r.kind)?eQ("You're subscribed!"):await er(r.tier)},eu[67]=eD,eu[68]=eI,eu[69]=eS,eu[70]=eQ,eu[71]=er,eu[72]=e.publicationUri,eu[73]=e.source,eu[74]=ed,eu[75]=ei):ei=eu[75];let e6=ei;eu[76]!==eE||eu[77]!==eS||eu[78]!==e3||eu[79]!==eN||eu[80]!==eY||eu[81]!==ep||eu[82]!==eh||eu[83]!==eg||eu[84]!==eP||eu[85]!==e0||eu[86]!==eA||eu[87]!==e5||eu[88]!==e4||eu[89]!==ed||eu[90]!==ew?.isOwner?(ea=async e=>{if(!eE&&!eA&&!eh){if(ew?.isOwner)return void ed({type:"error",content:"This is your publication â you can't join it."});if(!eg){if(ep)return eY?"subscriber"===e.kind?e3():e0(e.tier):("email"===eP?G(eS):eN.trim())?void eF(e):eW(!0);if("email"===eP)return G(eS)?e4(e):eW(!0);if(!eN.trim())return eW(!0);e5(e,!1)}}},eu[76]=eE,eu[77]=eS,eu[78]=e3,eu[79]=eN,eu[80]=eY,eu[81]=ep,eu[82]=eh,eu[83]=eg,eu[84]=eP,eu[85]=e0,eu[86]=eA,eu[87]=e5,eu[88]=e4,eu[89]=ed,eu[90]=ew?.isOwner,eu[91]=ea):ea=eu[91];let e8=ea;eu[92]!==eP?(el=(0,t.jsx)(h.SubscribeInputModeMenu,{mode:eP,onChange:eR}),eu[92]=eP,eu[93]=el):el=eu[93];let e7=el;return eu[94]!==eE||eu[95]!==eU||eu[96]!==ez||eu[97]!==ev||eu[98]!==e2||eu[99]!==eD||eu[100]!==eI||eu[101]!==eS||eu[102]!==ep||eu[103]!==eh||eu[104]!==eH||eu[105]!==eg||eu[106]!==eZ||eu[107]!==ex||eu[108]!==eP||eu[109]!==e7||eu[110]!==eb||eu[111]!==eA||eu[112]!==e||eu[113]!==e8||eu[114]!==e6||eu[115]!==eK||eu[116]!==ef.membership?(eo=eZ?e.newsletterMode?(0,t.jsx)(u.EmailSubscribeSuccess,{email:ep?.email??void 0,handle:ep?.bsky_profiles?.handle??void 0,publicationUri:e.publicationUri}):(0,t.jsx)(u.AtSubscribeSuccess,{publicationUri:e.publicationUri}):eA?(0,t.jsxs)("div",{className:"px-4 py-8 flex flex-col items-center gap-2",children:[(0,t.jsx)(l.DotLoader,{}),(0,t.jsx)("div",{className:"text-secondary text-sm",children:"Completing your membershipâ¦"})]}):eD?(0,t.jsx)("div",{className:"flex justify-center",children:(0,t.jsx)(c.EmailConfirm,{autoFocus:!0,loading:eI,emailValue:eS,onBack:()=>eB(null),onSubmit:e6})}):ez?(0,t.jsxs)("div",{className:"flex flex-col gap-3 max-w-sm w-full mx-auto",children:[(0,t.jsxs)("div",{className:"text-center flex flex-col gap-1",children:[(0,t.jsxs)("h2",{className:"text-primary leading-snug text-xl",children:["Join ",e.publicationName]}),(0,t.jsxs)("p",{className:"text-secondary",children:[ez.tier.name," ·"," ",(0,x.tierPriceLabel)(ez.tier,ez.cadence)]})]}),(0,t.jsx)(S.WalletPaymentForm,{submitLabel:`Join for ${(0,x.tierPriceLabel)(ez.tier,ez.cadence)}`,email:ep?.email,onSuccess:e2,onCancel:()=>eG(null)})]}):ex&&eb?(0,t.jsx)("div",{className:"flex justify-center",children:"cancel"===ex?(0,t.jsx)(B.CancelMembershipForm,{membership:eb,onSuccess:()=>ey(null),onBack:()=>ey(null)}):(0,t.jsx)($.ResumeMembershipForm,{membership:eb,onSuccess:()=>ey(null),onBack:()=>ey(null)})}):(0,t.jsxs)("div",{className:"memberSignUp flex flex-col max-w-3xl",children:[(0,t.jsx)("div",{className:"text-center flex flex-col gap-1 max-w-md mx-auto",children:(0,t.jsxs)("h2",{className:"text-primary leading-snug text-xl",children:[eg?"Your membership to":"Become a member of"," ",(0,t.jsx)("br",{}),e.publicationName]})}),eg?eb?(0,t.jsx)(z,{membership:eb,onCancel:()=>
27ey("cancel"),onResume:()=>ey("resume")}):(0,t.jsx)("div",{className:"flex justify-center pt-1 pb-4",children:(0,t.jsx)(l.DotLoader,{})}):eh?(0,t.jsx)("div",{className:"flex justify-center pt-1 pb-4",children:(0,t.jsx)(l.DotLoader,{})}):eK?(0,t.jsxs)("p",{className:"text-tertiary text-lg text-center pt-1 pb-4",children:["Subscribe as ",eK]}):(0,t.jsxs)("div",{className:"flex flex-col gap-1 max-w-sm w-full mx-auto pt-3 pb-3",children:[e.newsletterMode&&"email"===eP?(0,t.jsx)(c.EmailInput,{value:eS,onChange:ek,leading:e7,highlight:eH,onFocus:()=>eW(!1)}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.HandleSearchInput,{onChange:e_,onSubmit:e_,leading:e.newsletterMode?e7:void 0,highlight:eH,onFocus:()=>eW(!1)}),(0,t.jsx)("div",{className:"text-center pt-1",children:(0,t.jsx)(p.AtmosphericHandleInfo,{})})]}),eH?(0,t.jsx)("p",{className:"text-accent-contrast text-xs text-center font-bold",children:e.newsletterMode&&"email"===eP?"Enter your email":"Enter your Atmosphere handle."}):(0,t.jsx)("div",{className:"spacer h-4.5"})]}),eg&&eb?(0,t.jsx)(D.ChangePlanForm,{membership:eb,tiers:e.tiers,gatePolicy:e.gatePolicy,onSuccess:()=>{eC(H),e.onClose?.()}},ev):(0,t.jsx)(x.TierGrid,{tiers:e.tiers,cadence:eU,onCadenceChange:eM,busyPlan:eE,currentMembership:ef.membership,gatePolicy:e.gatePolicy,onSelectPlan:e8}),ep||eh?null:(0,t.jsxs)("p",{className:"tierPaymentInfo text-tertiary text-sm text-center pt-4",children:["Already Subscribed?"," ",(0,t.jsx)(A.LoginModal,{trigger:(0,t.jsx)("div",{className:"underline",children:"Sign in"})})]})]}),eu[94]=eE,eu[95]=eU,eu[96]=ez,eu[97]=ev,eu[98]=e2,eu[99]=eD,eu[100]=eI,eu[101]=eS,eu[102]=ep,eu[103]=eh,eu[104]=eH,eu[105]=eg,eu[106]=eZ,eu[107]=ex,eu[108]=eP,eu[109]=e7,eu[110]=eb,eu[111]=eA,eu[112]=e,eu[113]=e8,eu[114]=e6,eu[115]=eK,eu[116]=ef.membership,eu[117]=eo):eo=eu[117],eu[118]!==eE||eu[119]!==eS||eu[120]!==eN||eu[121]!==ep||eu[122]!==e$||eu[123]!==eP||eu[124]!==e5||eu[125]!==en?(es=e$&&ep&&(0,t.jsx)(f.LinkIdentityModal,{open:!0,onOpenChange:e=>{e||eF(null)},signedInAs:ep.bsky_profiles?.handle?`@${ep.bsky_profiles.handle}`:ep.email||"your account",linkingIdentity:"email"===eP?eS:`@${eN.trim()}`,confirmButtonLabel:"email"===eP?"Link email":"Link Bluesky",confirming:null!==eE,onConfirm:async()=>{eF(null),"email"===eP?await en(e$):e5(e$,!0)}}),eu[118]=eE,eu[119]=eS,eu[120]=eN,eu[121]=ep,eu[122]=e$,eu[123]=eP,eu[124]=e5,eu[125]=en,eu[126]=es):es=eu[126],eu[127]!==eo||eu[128]!==es?(ec=(0,t.jsxs)(t.Fragment,{children:[eo,es]}),eu[127]=eo,eu[128]=es,eu[129]=ec):ec=eu[129],ec}function H(e){return e+1}function W(e){return!e.hidden}function z(e){let n,i,a,l,o,s=(0,r.c)(15),c=e.membership,u=(0,D.membershipPrice)(c);s[0]===Symbol.for("react.memo_cache_sentinel")?(n={year:"numeric",month:"short",day:"numeric"},s[0]=n):n=s[0];let d=(0,I.useLocalizedDate)(c.currentPeriodEnd??"",n);s[1]!==c.status?(i=(0,D.isMembershipActive)(c.status),s[1]=c.status,s[2]=i):i=s[2];let m=i,p=m?c.cancelAtPeriodEnd?c.currentPeriodEnd?`Ends ${d}`:"Ends at the end of your billing period":(0,D.pendingPlanLabel)(c,c.currentPeriodEnd?d:"")??(c.currentPeriodEnd?`Renews ${d}`:""):"Not active",h=c.tierName??"Membership",f=u?` \xb7 ${u}`:"",b=p?` \xb7 ${p}`:"";return s[3]!==h||s[4]!==f||s[5]!==b?(a=(0,t.jsxs)("p",{className:"text-tertiary text-lg",children:[h,f,b]}),s[3]=h,s[4]=f,s[5]=b,s[6]=a):a=s[6],s[7]!==m||s[8]!==c.cancelAtPeriodEnd||s[9]!==e.onCancel||s[10]!==e.onResume?(l=m&&(c.cancelAtPeriodEnd?(0,t.jsx)(T.ButtonPrimary,{compact:!0,type:"button",className:"text-sm",onClick:e.onResume,children:"Resume"}):(0,t.jsx)(T.ButtonSecondary,{compact:!0,type:"button",className:"text-sm",onClick:e.onCancel,children:"Cancel membership"})),s[7]=m,s[8]=c.cancelAtPeriodEnd,s[9]=e.onCancel,s[10]=e.onResume,s[11]=l):l=s[11],s[12]!==a||s[13]!==l?(o=(0,t.jsxs)("div",{className:"membershipStatus flex flex-wrap items-center justify-center gap-x-3 gap-y-1 pt-1 pb-4 text-center",children:[a,l]}),s[12]=a,s[13]=l,s[14]=o):o=s[14],o}function G(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.trim())}},144063,553556,e=>{"use strict";var t=e.i(843476),r=e.i(500932),n=e.i(885718);function i(e){if(!e||"{"!==e[0])return null;try{let t=JSON.parse(e);if(t&&"doc"===t.type&&Array.isArray(t.content))return t}catch{}return null}function a(e,r){if("paragraph"!==e.type)return null;let n=e.content??[];return(0,t.jsx)("p",{children:0===n.length?(0,t.jsx)("br",{}):n.map(l)},r)}function l(e,r){return(0,t.jsx)(o,{node:e},r)}function o(e){let i,a,l,o=(0,r.c)(11);
27if("hard_break"===e.node.type){let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("br",{}),o[0]=e):e=o[0],e}if("text"!==e.node.type||!e.node.text)return null;if(o[1]!==e.node.marks){for(let t of(a={},i=null,e.node.marks??[]))switch(t.type){case"strong":a.fontWeight=700;break;case"em":a.fontStyle="italic";break;case"underline":a.textDecoration="underline";break;case"strikethrough":a.textDecoration=a.textDecoration?"underline line-through":"line-through",a.textDecorationColor=n.theme.colors.tertiary;break;case"link":i=function(e){if(!e)return null;try{let t=new URL(e);if(["http:","https:","mailto:"].includes(t.protocol))return e}catch{}return null}(t.attrs?.href)}o[1]=e.node.marks,o[2]=i,o[3]=a}else i=o[2],a=o[3];if(i){let r;return o[4]!==i||o[5]!==e.node.text||o[6]!==a?(r=(0,t.jsx)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-accent-contrast",style:a,children:e.node.text}),o[4]=i,o[5]=e.node.text,o[6]=a,o[7]=r):r=o[7],r}return o[8]!==e.node.text||o[9]!==a?(l=(0,t.jsx)("span",{style:a,children:e.node.text}),o[8]=e.node.text,o[9]=a,o[10]=l):l=o[10],l}e.s(["parseTierDescriptionDoc",0,i],553556),e.s(["TierDescription",0,function(e){let n,l,o,s=(0,r.c)(5),c=e.description;if(s[0]!==e.description){l=Symbol.for("react.early_return_sentinel");e:{let r=i(c);if(!r){l=(0,t.jsx)("p",{children:e.description});break e}n=r.content.map(a)}s[0]=e.description,s[1]=n,s[2]=l}else n=s[1],l=s[2];return l!==Symbol.for("react.early_return_sentinel")?l:(s[3]!==n?(o=(0,t.jsx)(t.Fragment,{children:n}),s[3]=n,s[4]=o):o=s[4],o)}],144063)},231363,152298,336731,59209,326420,e=>{"use strict";var t=e.i(72545);e.s(["revalidateUnlocks",0,()=>(0,t.mutate)(e=>Array.isArray(e)&&"unlocked-post"===e[0])],231363);var r=e.i(95187);let n=(0,r.createServerReference)("40af915615a6504ef837a904d36721fda2b528b02d",r.callServer,void 0,r.findSourceMapURL,"getMembershipJoinViewer");e.s(["getMembershipJoinViewer",0,n],152298);let i=(0,r.createServerReference)("40ae0533625487b11f4751eebfbcdc59149b74a5f4",r.callServer,void 0,r.findSourceMapURL,"subscribeToTier");e.s(["subscribeToTier",0,i],336731);let a=(0,r.createServerReference)("40cf1ee5bb8c2a359d703cf99003c5c2d01f35113b",r.callServer,void 0,r.findSourceMapURL,"saveWalletCardFromSession");e.s(["saveWalletCardFromSession",0,a],59209);let l=(0,r.createServerReference)("407a2f618e948cd0c2b4b92726c3ba78adfff9c63c",r.callServer,void 0,r.findSourceMapURL,"saveWalletCardFromSetupIntent");e.s(["saveWalletCardFromSetupIntent",0,l],326420)},410275,607585,e=>{"use strict";var t=e.i(843476),r=e.i(500932),n=e.i(806398);let i=e.i(247167).default.env.NEXT_PUBLIC_APP_URL||"https://leaflet.pub";function a(e){let t=e??window.location.hostname;return!t||("leaflet.pub"===t||t.startsWith("localhost")||t.startsWith("127.0.0.1")||t.endsWith(".vercel.app"))&&!t.endsWith(".vercel.app")?"":i}function l(e,t){let r=a(t),n=e.redirect;if(r&&n&&!/^https?:\/\//.test(n)){let e=t?`https://${t}`:window.location.origin;e&&(n=new URL(n,e).toString())}let i=new URLSearchParams;return e.handle&&i.set("handle",e.handle),n&&i.set("redirect_url",n),e.action&&i.set("action",e.action),e.link&&i.set("link","true"),e.signup&&i.set("signup","true"),e.autoMerge&&i.set("autoMerge","true"),e.reauth&&i.set("reauth","true"),e.addAccount&&i.set("addAccount","true"),`${r}/api/oauth/login?${i}`}function o(e){let i,a,o,s,c=(0,r.c)(10),{error:u,className:d}=e,{identity:m}=(0,n.useIdentityData)(),p=u.did||void 0;c[0]!==p?(i=l({reauth:!0,redirect:window.location.href,handle:p}),c[0]=p,c[1]=i):i=c[1];let h=i;if(u.did&&m?.atp_did&&u.did!==m.atp_did){let e,r=`${d} leading-snug`;return c[2]!==r?(e=(0,t.jsx)("div",{className:r,children:"The publication owner's session has expired. Ask them to sign in again before publishing."}),c[2]=r,c[3]=e):e=c[3],e}let f=`${d} leading-snug`;return c[4]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("span",{children:"You're logged out! "}),c[4]=a):a=c[4],c[5]!==h?(o=(0,t.jsx)("a",{href:h,className:"underline font-bold whitespace-nowrap",children:"Sign in"}),c[5]=h,c[6]=o):o=c[6],c[7]!==f||c[8]!==o?(s=(0,t.jsxs)("div",{className:f,children:[a,o]}),c[7]=f,c[8]=o,c[9]=s):s=c[9],s}function s(e){return"object"==typeof e&&null!==e&&"type"in e&&"oauth_session_expired"===e.type}e.s(["buildOauthLoginUrl",0,l,"mainSiteAuthBase",0,a],607585),e.s(["OAuthErrorMessage",0,o,"actionErrorContent",0,function(e,r){return s(e)?(0,t.jsx)(o,{error:e}):r},"isOAuthSessionError",0,s],410275)},443274,e=>{"use strict";var t,r=e.i(843476),n=e.i(500932),i=e.i(271645);function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var l="dahlia",o="https://js.stripe.com",s="".concat(o,"/").concat(l,"/stripe.js"),c=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,u=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,d=function(){for(var e=document.querySelectorAll('script[src^="'.concat(o,'"]')),t=0;t<e.length;t++){var r,n=e[t];if(r=n.src,c.test(r)||u.test(r))return n}return null},m=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(s).concat(t);var n=document.head||document.body;if(!n)throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return n.appendChild(r),r},p=function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"9.13.0",startTime:t})},h=null,f=null,b=null,g=function(e,t,r){if(null===e)return null;var n,i=t[0];if("string"!=typeof i)throw Error("Expected publishable key to be of type string, got type ".concat(a(i)," instead."));var o=i.match(/^pk_test/),s=3===(n=e.version)?"v3":n;o&&s!==l&&console.warn("Stripe.js@".concat(s," was loaded on the page, but @stripe/stripe-js@").concat("9.13.0"," expected Stripe.js@").concat(l,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var c=e.apply(void 0,t);return p(c,r),c},x=!1,y=function(){return t||(t=(null!==h?h:(h=new Promise(function(e,t){if("u"<typeof window||"u"<typeof document)return void e(null);if(window.Stripe,window.Stripe)return void e(window.Stripe);try{var r,n=d();n?n&&null!==b&&null!==f&&(n.removeEventListener("load",b),n.removeEventListener("error",f),null==(r=n.parentNode)||r.removeChild(n),n=m(null)):n=m(null),b=function(){window.Stripe?e(window.Stripe):t(Error("Stripe.js not available"))},f=function(e){t(Error("Failed to load Stripe.js",{cause:e}))},n.addEventListener("load",b),n.addEventListener("error",f)}catch(e){t(e);return}})).catch(function(e){return h=null,Promise.reject(e)})).catch(function(e){return t=null,Promise.reject(e)}))};Promise.resolve().then(function(){return y()}).catch(function(e){x||console.warn(e)});var v=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];x=!0;var n=Date.now();return y().then(function(e){return g(e,t,n)})},C=e.i(745009);function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function j(e,t,r){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?n:n+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
27t%2?S(Object(r),!0).forEach(function(t){j(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function N(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,l,o=[],s=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t);else for(;!(s=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return w(e,t);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var P=function(e,t,r){var n=!!r,a=i.default.useRef(r);i.default.useEffect(function(){a.current=r},[r]),i.default.useEffect(function(){if(!n||!e)return function(){};var r=function(){if(a.current)return a.current.apply(a,arguments)};return e.on(t,r),function(){e.off(t,r)}},[n,t,e,a])},R=function(e){var t=i.default.useRef(e);return i.default.useEffect(function(){t.current=e},[e]),t.current},U=function(e){return null!==e&&"object"===_(e)},M="[object Object]",E=function e(t,r){if(!U(t)||!U(r))return t===r;var n=Array.isArray(t);if(n!==Array.isArray(r))return!1;var i=Object.prototype.toString.call(t)===M;if(i!==(Object.prototype.toString.call(r)===M))return!1;if(!i&&!n)return t===r;var a=Object.keys(t),l=Object.keys(r);if(a.length!==l.length)return!1;for(var o={},s=0;s<a.length;s+=1)o[a[s]]=!0;for(var c=0;c<l.length;c+=1)o[l[c]]=!0;var u=Object.keys(o);return u.length===a.length&&u.every(function(n){return e(t[n],r[n])})},L=function(e,t,r){return U(e)?Object.keys(e).reduce(function(n,i){var a=!U(t)||!E(e[i],t[i]);return r.includes(i)?(a&&console.warn("Unsupported prop change: options.".concat(i," is not a mutable property.")),n):a?k(k({},n||{}),{},j({},i,e[i])):n},null):null},A="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",T=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A;if(null===e||U(e)&&"function"==typeof e.elements&&"function"==typeof e.createToken&&"function"==typeof e.createPaymentMethod&&"function"==typeof e.confirmCardPayment)return e;throw Error(t)},I=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A;if(U(e)&&"function"==typeof e.then)return{tag:"async",stripePromise:Promise.resolve(e).then(function(e){return T(e,t)})};var r=T(e,t);return null===r?{tag:"empty"}:{tag:"sync",stripe:r}},O=function(e){e&&e._registerWrapper&&e.registerAppInfo&&(e._registerWrapper({name:"react-stripe-js",version:"6.8.1"}),e.registerAppInfo({name:"react-stripe-js",version:"6.8.1",url:"https://stripe.com/docs/stripe-js/react"}))},D=i.default.createContext(null);D.displayName="ElementsContext";var B=function(e,t){if(!e)throw Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e},$=function(e){var t=e.stripe,r=e.options,n=e.children,a=i.default.useMemo(function(){return I(t)},[t]),l=N(i.default.useState(function(){return{stripe:"sync"===a.tag?a.stripe:null,elements:"sync"===a.tag?a.stripe.elements(r):null}}),2),o=l[0],s=l[1];i.default.useEffect(function(){var e=!0,t=function(e){s(function(t){return t.stripe?t:{stripe:e,elements:e.elements(r)}})};return"async"!==a.tag||o.stripe?"sync"!==a.tag||o.stripe||t(a.stripe):a.stripePromise.then(function(r){r&&e&&t(r)}),function(){e=!1}},[a,o,r]);var c=R(t);i.default.useEffect(function(){null!==c&&c!==t&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[c,t]);var u=R(r);return i.default.useEffect(function(){if(o.elements){var e=L(r,u,["clientSecret","fonts"]);e&&o.elements.update(e)}},[r,u,o.elements]),i.default.useEffect(function(){O(o.stripe)},[o.stripe]),i.default.createElement(D.Provider,{value:o},n)};$.propTypes={stripe:C.default.any,options:C.default.object};C.default.func.isRequired;var F=i.default.createContext(null);F.displayName="CheckoutContext";var H=function(e){var t=i.default.useContext(F),r=i.default.useContext(D);if(!t)return B(r,e);if(!r)return t;throw Error("You cannot wrap the part of your app that ".concat(e," in both a checkout provider and <Elements> provider."))},W=["mode"],z=function(e,t,r){var n="".concat(e.charAt(0).toUpperCase()+e.slice(1),"Element"),a=t?function(e){H("mou
27nts <".concat(n,">"));var t=e.id,r=e.className;return i.default.createElement("div",{id:t,className:r})}:function(t){var r,a=t.id,l=t.className,o=t.options,s=void 0===o?{}:o,c=t.onBlur,u=t.onFocus,d=t.onReady,m=t.onChange,p=t.onEscape,h=t.onClick,f=t.onLoadError,b=t.onLoaderStart,g=t.onNetworksChange,x=t.onConfirm,y=t.onCancel,v=t.onShippingAddressChange,C=t.onShippingRateChange,w=t.onSavedPaymentMethodRemove,j=t.onSavedPaymentMethodUpdate,S=t.onAvailablePaymentMethodsChange,k=H("mounts <".concat(n,">")),_="elements"in k?k.elements:null,U="checkoutState"in k?k.checkoutState:null,M=(null==U?void 0:U.type)==="success"||(null==U?void 0:U.type)==="loading"?U.sdk:null,E=N(i.default.useState(null),2),A=E[0],T=E[1],I=i.default.useRef(null),O=i.default.useRef(null);P(A,"blur",c),P(A,"focus",u),P(A,"escape",p),P(A,"click",h),P(A,"loaderror",f),P(A,"loaderstart",b),P(A,"networkschange",g),P(A,"confirm",x),P(A,"cancel",y),P(A,"shippingaddresschange",v),P(A,"shippingratechange",C),P(A,"savedpaymentmethodremove",w),P(A,"savedpaymentmethodupdate",j),P(A,"availablepaymentmethodschange",S),P(A,"change",m),d&&(r="expressCheckout"===e?d:function(){d(A)}),P(A,"ready",r),i.default.useLayoutEffect(function(){if(null===I.current&&null!==O.current&&(_||M)){var t=null;if(M)switch(e){case"paymentForm":t=M.createForm(s);break;case"payment":t=M.createPaymentElement(s);break;case"address":if("mode"in s){var r=s.mode,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(s,W);
27if("shipping"===r)t=M.createShippingAddressElement(i);else if("billing"===r)t=M.createBillingAddressElement(i);else throw Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":t=M.createExpressCheckoutElement(s);break;case"currencySelector":t=M.createCurrencySelectorElement();break;case"taxId":t=M.createTaxIdElement(s);break;case"contactDetails":t=M.createContactDetailsElement();break;case"terms":t=M.createTermsElement(s);break;default:throw Error("<".concat(n,"> is not supported inside a checkout provider. Use an <Elements> provider instead."))}else _&&(t=_.create(e,s));I.current=t,T(t),t&&t.mount(O.current)}},[_,M,s]);var D=R(s);return i.default.useEffect(function(){if(I.current){var e=L(s,D,["paymentRequest"]);e&&"update"in I.current&&I.current.update(e)}},[s,D]),i.default.useLayoutEffect(function(){return function(){if(I.current&&"function"==typeof I.current.destroy)try{I.current.destroy(),I.current=null}catch(e){}}},[]),i.default.createElement("div",{id:a,className:l,ref:O})};return a.propTypes={id:C.default.string,className:C.default.string,onChange:C.default.func,onBlur:C.default.func,onFocus:C.default.func,onReady:C.default.func,onEscape:C.default.func,onClick:C.default.func,onLoadError:C.default.func,onLoaderStart:C.default.func,onNetworksChange:C.default.func,onConfirm:C.default.func,onCancel:C.default.func,onShippingAddressChange:C.default.func,onShippingRateChange:C.default.func,onSavedPaymentMethodRemove:C.default.func,onSavedPaymentMethodUpdate:C.default.func,onAvailablePaymentMethodsChange:C.default.func,options:C.default.object},a.displayName=n,a.__elementType=e,a},G="u"<typeof window;i.default.createContext(null).displayName="EmbeddedCheckoutProviderContext",z("auBankAccount",G),z("card",G),z("cardNumber",G),z("cardExpiry",G),z("cardCvc",G),z("currencySelector",G),z("iban",G);var Z=z("payment",G);z("expressCheckout",G),z("paymentRequestButton",G),z("linkAuthentication",G),z("contactDetails",G),z("address",G),z("shippingAddress",G),z("paymentMethodMessaging",G),z("taxId",G),z("issuingCardNumberDisplay",G),z("issuingCardCvcDisplay",G),z("issuingCardExpiryDisplay",G),z("issuingCardPinDisplay",G),z("issuingCardCopyButton",G),z("terms",G);var V=e.i(69278),q=e.i(788613),Y=e.i(95187);let K=(0,Y.createServerReference)("0096d27fe8adf5e26fee138f60efd1e6578e822e58",Y.callServer,void 0,Y.findSourceMapURL,"createWalletSetupIntent"),J=null;function X(e){var t;let a,l,o,s,c,u,d,m=(0,n.c)(22),p=H("calls useStripe()").stripe,h=(t="calls useElements()",B(i.default.useContext(D),t)).elements,[f,b]=(0,i.useState)(!1),[g,x]=(0,i.useState)(!1),[y,v]=(0,i.useState)(null);m[0]!==g||m[1]!==h||m[2]!==e||m[3]!==p?(a=async t=>{if(t.preventDefault(),!p||!h||g)return;x(!0),v(null);let r=await p.confirmSetup({elements:h,redirect:"if_required",confirmParams:{return_url:window.location.href}});if(r.error){v(r.error.message??"We couldn't save your payment method. Please try again!"),x(!1);return}if("succeeded"!==r.setupIntent.status){v("We couldn't save your payment method. Please try again!"),x(!1);return}await e.onSuccess(r.setupIntent.id),x(!1)},m[0]=g,m[1]=h,m[2]=e,m[3]=p,m[4]=a):a=m[4];let C=a;return m[5]===Symbol.for("react.memo_cache_sentinel")?(l=()=>b(!0),m[5]=l):l=m[5],m[6]!==e.email?(o=e.email?{defaultValues:{billingDetails:{email:e.email}}}:void 0,m[6]=e.email,m[7]=o):o=m[7],m[8]!==o?(s=(0,r.jsx)(Z,{onReady:l,options:o}),m[8]=o,m[9]=s):s=m[9],m[10]!==y?(c=y&&(0,r.jsx)("p",{className:"text-accent-contrast text-sm text-center font-bold",children:y}),m[10]=y,m[11]=c):c=m[11],m[12]!==g||m[13]!==e.onCancel||m[14]!==e.submitLabel||m[15]!==f?(u=f&&(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)(V.ButtonPrimary,{type:"submit",disabled:g,fullWidth:!0,children:g?(0,r.jsx)(q.DotLoader,{}):e.submitLabel}),e.onCancel&&(0,r.jsx)("button",{type:"button",className:"text-tertiary text-sm hover:underline",onClick:e.onCancel,disabled:g,children:"Back"})]}),m[12]=g,m[13]=e.onCancel,m[14]=e.submitLabel,m[15]=f,m[16]=u):u=m[16],m[17]!==C||m[18]!==s||m[19]!==c||m[20]!==u?(d=(0,r.jsxs)("form",{onSubmit:C,className:"flex flex-col gap-3",children:[s,c,u]}),m[17]=C,m[18]=s,m[19]=c,m[20]=u,m[21]=d):d=m[21],d}e.s(["WalletPaymentForm",0,function(e){let t,a,l,o,s,c=(0,n.c)(12),[u,d]=(0,i.useState)(null),[m,p]=(0,i.useState)(!1),[h,f]=(0,i.useState)(null),b=(0,i.useRef)(null);if(c[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{let e;return e=!1,K().then(t=>{e||(t.ok?d(t.value):p(!0))}),()=>{e=!0}},a=[],c[0]=t,c[1]=a):(t=c[0],a=c[1]),(0,i.useEffect)(t,a),c[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{if(!b.current)return;let e=getComputedStyle(b.current),t=t=>{let r=e.getPropertyValue(t).trim();return r?`rgb(${r})`:void 0};f({theme:"stripe",variables:{colorPrimary:t("--accent-contrast"),colorText:t
27("--primary"),colorBackground:t("--bg-page"),borderRadius:"4px"}})},o=[],c[2]=l,c[3]=o):(l=c[2],o=c[3]),(0,i.useEffect)(l,o),m){let e;return c[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,r.jsx)("div",{className:"text-center text-secondary py-4",children:"We couldn't load the payment form. Please try again!"}),c[4]=e):e=c[4],e}if(c[5]!==h||c[6]!==u||c[7]!==e.email||c[8]!==e.onCancel||c[9]!==e.onSuccess||c[10]!==e.submitLabel){let t;s=(0,r.jsx)("div",{ref:b,className:"flex flex-col gap-3",children:u&&h?(0,r.jsx)($,{stripe:(t=u.publishableKey,J??=v(t)),options:{clientSecret:u.clientSecret,customerSessionClientSecret:u.customerSessionClientSecret,appearance:h},children:(0,r.jsx)(X,{submitLabel:e.submitLabel,email:e.email,onSuccess:e.onSuccess,onCancel:e.onCancel})}):(0,r.jsx)("div",{className:"flex justify-center py-8",children:(0,r.jsx)(q.DotLoader,{})})}),c[5]=h,c[6]=u,c[7]=e.email,c[8]=e.onCancel,c[9]=e.onSuccess,c[10]=e.submitLabel,c[11]=s}else s=c[11];return s}],443274)},66016,e=>{"use strict";var t=e.i(500932),r=e.i(271645),n=e.i(283599),i=e.i(935593);let a=new Set,l=new Map,o=!1,s=(0,r.createContext)(null);e.s(["useStandardSitePublication",0,function(e){let c,u,d,m=(0,t.c)(6),p=(0,r.useContext)(s),h=e?p?.[e]:void 0;m[0]!==e?(c=()=>new Promise(t=>{a.add(e);let r=l.get(e)||[];r.push(t),l.set(e,r),o||(o=!0,queueMicrotask(async()=>{let e=Array.from(a);a=new Set;let t=l;if(l=new Map,o=!1,0!==e.length)try{let r=await (0,i.callRPC)("get_standard_site_publications",{uris:e}),n=new Map((r?.result.publications||[]).map(e=>[e.uri,e]));for(let r of e){let e=n.get(r)??null;for(let n of t.get(r)||[])n(e)}}catch{for(let r of e)for(let e of t.get(r)||[])e(null)}}))}),m[0]=e,m[1]=c):c=m[1],m[2]===Symbol.for("react.memo_cache_sentinel")?(u={revalidateOnFocus:!1,revalidateIfStale:!1},m[2]=u):u=m[2];let f=(0,n.default)(!e||h?null:`standard-site-publication:${e}`,c,u),b=h??f.data,g=!h&&f.isLoading;return m[3]!==b||m[4]!==g?(d={data:b,isLoading:g},m[3]=b,m[4]=g,m[5]=d):d=m[5],d}])},799596,e=>{"use strict";e.s(["EmailButton",()=>N,"EmailConfirm",()=>_,"EmailInput",()=>k]);var t=e.i(843476),r=e.i(500932),n=e.i(573687),i=e.i(271645),a=e.i(618566),l=e.i(69278),o=e.i(713418),s=e.i(784192),c=e.i(788613),u=e.i(793610),d=e.i(906695),m=e.i(72864),p=e.i(410275),h=e.i(937929),f=e.i(250366),b=e.i(885718),g=e.i(728684),x=e.i(645522),y=e.i(806398),v=e.i(229008),C=e.i(268046),w=e.i(368408),j=e.i(263183),S=e.i(545850);let k=e=>{let n,i,a,u,d,m,p,h,f,g,x=(0,r.c)(33),y=` input-with-border flex gap-2 w-full items-center mx-auto py-0! min-w-0 ${e.large&&"px-2!"} ${e.highlight?j.INPUT_HIGHLIGHT_CLASS:""} `;x[0]!==e.loading?(n=e.loading?{backgroundColor:b.theme.colors["border-light"],color:b.theme.colors.tertiary}:{backgroundColor:b.theme.colors["bg-page"],color:b.theme.colors.primary},x[0]=e.loading,x[1]=n):n=x[1],x[2]!==e.leading?(i=e.leading&&(0,t.jsx)("div",{className:"text-tertiary shrink-0 flex items-center",children:e.leading}),x[2]=e.leading,x[3]=i):i=x[3];let v=`appearance-none! outline-none! grow min-w-0 ${e.large?"py-1!":`${e.compact?"py-0!":"py-0.5"} disabled:text-tertiary disabled:italic disabled:border-border-light`}`,C=e.disabled||e.loading;x[4]!==e?(a=t=>e.onChange(t.target.value),x[4]=e,x[5]=a):a=x[5],x[6]!==e.autoFocus||x[7]!==e.onFocus||x[8]!==e.value||x[9]!==v||x[10]!==C||x[11]!==a?(u=(0,t.jsx)(s.Input,{type:"email",autoFocus:e.autoFocus,className:v,disabled:C,placeholder:"[email protected]",size:0,value:e.value,onChange:a,onFocus:e.onFocus}),x[6]=e.autoFocus,x[7]=e.onFocus,x[8]=e.value,x[9]=v,x[10]=C,x[11]=a,x[12]=u):u=x[12],x[13]!==e.action||x[14]!==e.loading?(d=e.loading?(0,t.jsx)(c.DotLoader,{}):e.action,x[13]=e.action,x[14]=e.loading,x[15]=d):d=x[15],x[16]!==d?(m=(0,t.jsx)("div",{className:" text-accent-contrast flex items-center shrink-0 ",children:d}),x[16]=d,x[17]=m):m=x[17],x[18]!==y||x[19]!==n||x[20]!==i||x[21]!==u||x[22]!==m?(p=(0,t.jsxs)("div",{className:y,style:n,children:[i,u,m]}),x[18]=y,x[19]=n,x[20]=i,x[21]=u,x[22]=m,x[23]=p):p=x[23],x[24]!==e.compact||x[25]!==e.publicationUrl?(h=e.publicationUrl&&(0,t.jsx)("a",{href:`${e.publicationUrl}/rss`,target:"_blank",rel:"noopener noreferrer",className:"no-underlinetext-accent-contrast",children:(0,t.jsx)(l.ButtonSecondary,{className:`${e.compact?"p-[3px]!":"p-[6px]!"}
27 border-border!`,children:(0,t.jsx)(o.RSSTiny,{})})}),x[24]=e.compact,x[25]=e.publicationUrl,x[26]=h):h=x[26],x[27]!==h||x[28]!==p?(f=(0,t.jsxs)(t.Fragment,{children:[p,h]}),x[27]=h,x[28]=p,x[29]=f):f=x[29];let w=f;return x[30]!==w||x[31]!==e?(g=e.onSubmit?(0,t.jsx)("form",{className:"flex gap-1 w-full min-w-0",onSubmit:t=>{t.preventDefault(),e.onSubmit?.()},children:w}):(0,t.jsx)("div",{className:"flex gap-1 w-full min-w-0",children:w}),x[30]=w,x[31]=e,x[32]=g):g=x[32],g},N=e=>{let n,s,f,b,j,k,N,_,P,R,U,M,E=(0,r.c)(53),L=(0,u.useToaster)(),A=(0,a.useRouter)(),{identity:T}=(0,y.useIdentityData)(),{data:I}=(0,v.useRecordFromDid)(T?.atp_did),[O,D]=(0,i.useState)(!1),B=e.compact||e.handle,$=e.email||null,F=I?.avatar,H=I?.displayName||I?.handle;E[0]!==F||E[1]!==H?(n=(0,t.jsx)(x.Avatar,{size:"tiny",src:F,displayName:H}),E[0]=F,E[1]=H,E[2]=n):n=E[2];let W=n;E[3]!==e.email||E[4]!==e.publicationUri||E[5]!==e.source||E[6]!==L?(s=async()=>{let t=await (0,d.requestPublicationEmailSubscription)(e.publicationUri,e.email,e.source);return!!t.ok||(L({type:"error",content:h.SUBSCRIBE_ERROR_MESSAGES[t.error]}),!1)},E[3]=e.email,E[4]=e.publicationUri,E[5]=e.source,E[6]=L,E[7]=s):s=E[7];let z=s;E[8]!==e.publicationUri||E[9]!==e.source||E[10]!==L?(f=async()=>{let t=await (0,m.subscribeToPublication)(e.publicationUri,window.location.href,e.source);return!!t.success||(L({type:"error",content:(0,p.actionErrorContent)(t.error,"We couldn't subscribe you. Try again.")}),!1)},E[8]=e.publicationUri,E[9]=e.source,E[10]=L,E[11]=f):f=E[11];let G=f;E[12]!==O||E[13]!==e||E[14]!==A||E[15]!==G||E[16]!==z||E[17]!==L?(b=async r=>{if(O)return;D(!0);let n="email"===r?await z():await G();D(!1),n&&(e.onSuccess?e.onSuccess(r):L({content:(0,t.jsx)("div",{children:"You're Subscribed!"}),type:"success"}),(0,S.markLocallySubscribed)(e.publicationUri,r),A.refresh())},E[12]=O,E[13]=e,E[14]=A,E[15]=G,E[16]=z,E[17]=L,E[18]=b):b=E[18];let Z=b;E[19]!==Z?(j=()=>Z("email"),E[19]=Z,E[20]=j):j=E[20];let V=`text-sm grow shrink! min-w-0 flex gap-2 items-center ${B?"gap-1! rounded-r-none! hover:outline-transparent! focus:outline-transparent!":""} `;E[21]!==O||E[22]!==e.compact||E[23]!==e.email?(k=O?(0,t.jsx)(c.DotLoader,{className:"h-auto!"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.EmailTiny,{className:"shrink-0"}),(0,t.jsx)("span",{className:"shrink-0",children:" Subscribe"})," ",(0,t.jsxs)("span",{className:`truncate min-w-0 ${e.compact&&"hidden"}`,children:["with ",e.email]})]}),E[21]=O,E[22]=e.compact,E[23]=e.email,E[24]=k):k=E[24],E[25]!==O||E[26]!==e.compact||E[27]!==j||E[28]!==V||E[29]!==k?(N=(0,t.jsx)(l.ButtonPrimary,{compact:e.compact,disabled:O,onClick:j,className:V,children:k}),E[25]=O,E[26]=e.compact,E[27]=j,E[28]=V,E[29]=k,E[30]=N):N=E[30];let q=N,Y=`flex grow min-w-0 ${e.compact?"group rounded-md outline-2 outline-transparent outline-offset-1 hover:outline-accent-1 focus-within:outline-accent-1 shrink-0":""}`;return E[31]!==e.compact||E[32]!==q||E[33]!==$?(_=e.compact&&$?(0,t.jsx)(C.Tooltip,{asChild:!0,delayDuration:0,side:"top",trigger:q,className:"text-sm p-1! text-tertiary",children:$}):q,E[31]=e.compact,E[32]=q,E[33]=$,E[34]=_):_=E[34],E[35]!==W||E[36]!==B||E[37]!==O||E[38]!==e.email||E[39]!==e.handle||E[40]!==e.publicationUrl||E[41]!==Z?(P=B?(0,t.jsx)(w.SubscribeButtonModeMenu,{disabled:O,publicationUrl:e.publicationUrl,accounts:[{value:"email",label:e.email,icon:(0,t.jsx)(g.EmailTiny,{}),selected:!0,onSelect:()=>Z("email")},...e.handle?[{value:"atproto",label:`@${e.handle}`,icon:W,selected:!1,onSelect:()=>Z("atproto")}]:[]]}):null,E[35]=W,E[36]=B,E[37]=O,E[38]=e.email,E[39]=e.handle,E[40]=e.publicationUrl,E[41]=Z,E[42]=P):P=E[42],E[43]!==Y||E[44]!==_||E[45]!==P?(R=(0,t.jsxs)("div",{className:Y,children:[_,P]}),E[43]=Y,E[44]=_,E[45]=P,E[46]=R):R=E[46],E[47]!==e.compact||E[48]!==e.publicationUrl?(U=!e.compact&&(0,t.jsx)("a",{href:`${e.publicationUrl}/rss`,target:"_blank",rel:"noopener noreferrer",className:`no-underline shrink-0 ${e.compact?"w-6":"w-7"}`,children:(0,t.jsx)(l.ButtonPrimary,{className:"h-full! w-auto! py-0! px-0! aspect-square",children:(0,t.jsx)(o.RSST
27iny,{})})}),E[47]=e.compact,E[48]=e.publicationUrl,E[49]=U):U=E[49],E[50]!==R||E[51]!==U?(M=(0,t.jsxs)("div",{className:"flex gap-1 max-w-full w-fit min-w-0",children:[R,U]}),E[50]=R,E[51]=U,E[52]=M):M=E[52],M},_=e=>{let i,a,l,o,s,c,u,d,m,p=(0,r.c)(19),h=`input-with-border text-2xl w-8 h-12 text-center ${e.loading?"bg-border-light! text-tertiary!":""}`;return p[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsx)("h3",{children:"Confirm your email"}),p[0]=i):i=p[0],p[1]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("br",{}),p[1]=a):a=p[1],p[2]!==e.emailValue?(l=(0,t.jsx)("div",{className:"italic min-w-0 truncate",children:e.emailValue}),p[2]=e.emailValue,p[3]=l):l=p[3],p[4]!==e?(o=t=>{e.onSubmit(t)},p[4]=e,p[5]=o):o=p[5],p[6]!==h?(s=(0,t.jsxs)("div",{className:"flex gap-1 pt-4 w-full justify-center",children:[(0,t.jsx)(n.Input,{className:h,onPointerDown:f.onMouseDown}),(0,t.jsx)(n.Input,{className:h,onPointerDown:f.onMouseDown}),(0,t.jsx)(n.Input,{className:h,onPointerDown:f.onMouseDown}),(0,t.jsx)(n.Input,{className:h,onPointerDown:f.onMouseDown}),(0,t.jsx)(n.Input,{className:h,onPointerDown:f.onMouseDown}),(0,t.jsx)(n.Input,{className:h,onPointerDown:f.onMouseDown})]}),p[6]=h,p[7]=s):s=p[7],p[8]===Symbol.for("react.memo_cache_sentinel")?(c=(0,t.jsx)(n.HiddenInput,{}),p[8]=c):c=p[8],p[9]!==e.autoFocus||p[10]!==o||p[11]!==s?(u=(0,t.jsxs)(n.Root,{autoSubmit:!0,autoFocus:e.autoFocus,validationType:"alphanumeric",onAutoSubmit:o,children:[s,c]}),p[9]=e.autoFocus,p[10]=o,p[11]=s,p[12]=u):u=p[12],p[13]!==e?(d=(0,t.jsx)("button",{className:"text-sm text-accent-contrast mt-1",onClick:()=>e.onBack(),children:"Use a different email?"}),p[13]=e,p[14]=d):d=p[14],p[15]!==l||p[16]!==u||p[17]!==d?(m=(0,t.jsxs)("div",{className:"flex flex-col text-center max-w-sm pb-2 text-secondary leading-snug",children:[i,"Enter the code sent to ",a,l,u,d]}),p[15]=l,p[16]=u,p[17]=d,p[18]=m):m=p[18],m}},327630,e=>{"use strict";e.s(["AtmosphericHandleInfo",()=>S,"LinkHandle",()=>j,"SubscribeWithHandle",()=>w]);var t=e.i(843476),r=e.i(500932),n=e.i(607585),i=e.i(69278),a=e.i(814649),l=e.i(271645),o=e.i(123838),s=e.i(72864),c=e.i(410275),u=e.i(793610),d=e.i(788613),m=e.i(324270),p=e.i(645522),h=e.i(806398),f=e.i(229008),b=e.i(694777),g=e.i(545850),x=e.i(713418),y=e.i(268046),v=e.i(368408);let C=[{name:"Leaflet",logo:"https://leaflet.pub/logos/leaflet.svg"},{name:"Bluesky",logo:"https://leaflet.pub/logos/bluesky.svg"},{name:"Blacksky",logo:"https://leaflet.pub/logos/blacksky.svg"},{name:"Eurosky",logo:"https://leaflet.pub/logos/eurosky.svg"},{name:"Tangled",logo:"https://leaflet.pub/logos/tangled.svg"},{name:"Semble",logo:"https://leaflet.pub/logos/semble.svg"},{name:"Surf",logo:"https://leaflet.pub/logos/surf.svg"},{name:"Spark",logo:"https://leaflet.pub/logos/spark.svg"},{name:"Pckt",logo:"https://leaflet.pub/logos/pckt.svg"},{name:"pdsls",logo:"https://leaflet.pub/logos/pdsls.svg"},{name:"plyr.fm",logo:"https://leaflet.pub/logos/plyr.fm.svg"},{name:"Popfeed",logo:"https://leaflet.pub/logos/popfeed.svg"},{name:"Roomy",logo:"https://leaflet.pub/logos/roomy.svg"},{name:"Sill",logo:"https://leaflet.pub/logos/sill.svg"},{name:"Offprint",logo:"https://leaflet.pub/logos/offprint.svg"},{name:"Margin",logo:"https://leaflet.pub/logos/margin.svg"},{name:"Anisota",logo:"https://leaflet.pub/logos/anisota.svg"},{name:"Blento",logo:"https://leaflet.pub/logos/blento.svg"},{name:"Cartridge",logo:"https://leaflet.pub/logos/cartridge.svg"},{name:"Graze",logo:"https://leaflet.pub/logos/graze.svg"}],w=e=>{let a,C=(0,r.c)(71),w=(0,u.useToaster)(),{identity:j}=(0,h.useIdentityData)(),{data:k}=(0,f.useRecordFromDid)(j?.atp_did),[N,_]=(0,l.useState)(!1),[P,R]=(0,l.useState)(!1),[U,M]=(0,l.useState)(null),E=j?.email,L=j?.atp_did,A=!!E&&!L;C[0]!==e.publicationUri||C[1]!==e.source?(a=(t,r)=>{let i=(0,o.encodeActionToSearchParam)({action:"subscribe",publication:e.publicationUri,...e.source?{source:{url:window.location.href,...e.source}}:{}}),a=(()=>{try{return window.self!==window.top}catch{return!0}})(),l=new URL(window.location.href);a&&(l.searchParams.set("showSubscribeSuccess","true"),l.searchParams.set("subscribed_pub",e.publicationUri));let s=(0,n.buildOauthLoginUrl)({handle:t,redirect:l.toString(),action:i,link:r,autoMerge:r});if(a){window.open(s,"_blank","noopener,noreferrer"),_(!1);return}window.location.href=s},C[0]=e.publicationUri,C[1]=e.source,C[2]=a):a=C[2];let T=a;if(e.user.loggedIn&&e.user.handle){let r,n,a,l,o,u,m,h,f,b,j=e.user.handle?`@${e.user.handle}`:null,S=k?.avatar,N=k?.displayName||k?.handle;C[3]!==S||C[4]!==N?(r=(0,t.jsx)(p.Avatar,{size:"tiny",src:S,displayName:N}),C[3]=S,C[4]=N,C[5]=r):r=C[5];let _=r;C[6]!==e||C[7]!==P||C[8]!==w?(n=async()=>
27{if(P)return;R(!0);let r=await (0,s.subscribeToPublication)(e.publicationUri,window.location.href,e.source);if(!r.success){w({type:"error",content:(0,c.isOAuthSessionError)(r.error)?(0,t.jsx)(c.OAuthErrorMessage,{error:r.error}):"We couldn't subscribe you. Try again."}),R(!1);return}e.onAtSuccess?e.onAtSuccess():w({content:(0,t.jsx)("div",{children:"You're Subscribed!"}),type:"success"}),(0,g.markLocallySubscribed)(e.publicationUri,"atproto"),R(!1)},C[6]=e,C[7]=P,C[8]=w,C[9]=n):n=C[9];let U=n,M=` 28 subscribeButton 29 text-sm grow shrink! 30 ${e.compact?"gap-1! min-w-0 flex items-center rounded-r-none! hover:outline-transparent! focus:outline-transparent!":""}`;C[10]!==_||C[11]!==e.compact||C[12]!==e.user.handle||C[13]!==P?(a=P?(0,t.jsx)(d.DotLoader,{className:"h-auto!"}):(0,t.jsxs)(t.Fragment,{children:[_,(0,t.jsxs)("div",{className:"flex grow min-w-0",children:[(0,t.jsx)("div",{className:"shrink-0 pr-[6px]",children:"Subscribe"}),!e.compact&&(0,t.jsxs)("span",{className:"grow truncate min-w-0",children:["as ",e.user.handle]})]})]}),C[10]=_,C[11]=e.compact,C[12]=e.user.handle,C[13]=P,C[14]=a):a=C[14],C[15]!==e.compact||C[16]!==U||C[17]!==P||C[18]!==M||C[19]!==a?(l=(0,t.jsx)(i.ButtonPrimary,{compact:e.compact,className:M,disabled:P,onClick:U,children:a}),C[15]=e.compact,C[16]=U,C[17]=P,C[18]=M,C[19]=a,C[20]=l):l=C[20];let E=l,L=`flex grow min-w-0 max-w-full ${e.compact?"group rounded-md outline-2 outline-transparent outline-offset-1 hover:outline-accent-1 focus-within:outline-accent-1 shrink-0":""}`;return C[21]!==e.leading?(o=e.leading&&(0,t.jsx)("div",{className:"shrink-0 flex items-center",children:e.leading}),C[21]=e.leading,C[22]=o):o=C[22],C[23]!==e.compact||C[24]!==E||C[25]!==j?(u=e.compact&&j?(0,t.jsx)(y.Tooltip,{asChild:!0,delayDuration:0,side:"top",trigger:E,className:"text-sm p-1! text-tertiary",children:j}):E,C[23]=e.compact,C[24]=E,C[25]=j,C[26]=u):u=C[26],C[27]!==_||C[28]!==e.compact||C[29]!==e.publicationUrl||C[30]!==e.user.handle||C[31]!==U||C[32]!==P?(m=e.compact&&(0,t.jsx)(v.SubscribeButtonModeMenu,{disabled:P,publicationUrl:e.publicationUrl,accounts:[{value:"atproto",label:`@${e.user.handle}`,icon:_,selected:!0,onSelect:U}]}),C[27]=_,C[28]=e.compact,C[29]=e.publicationUrl,C[30]=e.user.handle,C[31]=U,C[32]=P,C[33]=m):m=C[33],C[34]!==u||C[35]!==m||C[36]!==L||C[37]!==o?(h=(0,t.jsxs)("div",{className:L,children:[o,u,m]}),C[34]=u,C[35]=m,C[36]=L,C[37]=o,C[38]=h):h=C[38],C[39]!==e.compact||C[40]!==e.publicationUrl?(f=!e.compact&&(0,t.jsx)("a",{href:`${e.publicationUrl}/rss`,target:"_blank",rel:"noopener noreferrer",className:`no-underline shrink-0 ${e.compact?"w-6":"w-7"}`,children:(0,t.jsx)(i.ButtonPrimary,{className:"h-full! w-auto! py-0! px-0! aspect-square",children:(0,t.jsx)(x.RSSTiny,{})})}),C[39]=e.compact,C[40]=e.publicationUrl,C[41]=f):f=C[41],C[42]!==h||C[43]!==f?(b=(0,t.jsxs)("div",{className:"flex items-stretch gap-1 w-fit max-w-full min-w-0",children:[h,f]}
30),C[42]=h,C[43]=f,C[44]=b):b=C[44],b}{let r,n,a,l,o,s,c,u;return C[45]!==A||C[46]!==T?(r=e=>{let t=e.trim();if(t){if(A)return void M(t);_(!0),T(t,!1)}},C[45]=A,C[46]=T,C[47]=r):r=C[47],C[48]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("div",{className:"bg-accent-1 rounded-md px-1 text-accent-2 font-bold text-sm min-w-20 shrink-0",children:"Subscribe"}),C[48]=n):n=C[48],C[49]!==N||C[50]!==e.autoFocus||C[51]!==e.compact||C[52]!==e.leading||C[53]!==r?(a=(0,t.jsx)(m.HandleSearchInput,{autoFocus:e.autoFocus,compact:e.compact,loading:N,leading:e.leading,onSubmit:r,action:n}),C[49]=N,C[50]=e.autoFocus,C[51]=e.compact,C[52]=e.leading,C[53]=r,C[54]=a):a=C[54],C[55]!==e.compact||C[56]!==e.publicationUrl?(l=e.publicationUrl&&(0,t.jsx)("a",{href:`${e.publicationUrl}/rss`,target:"_blank",rel:"noopener noreferrer",className:"no-underlinetext-accent-contrast",children:(0,t.jsx)(i.ButtonSecondary,{className:`${e.compact?"p-[3px]!":"p-[6px]!"} border-border!`,children:(0,t.jsx)(x.RSSTiny,{})})}),C[55]=e.compact,C[56]=e.publicationUrl,C[57]=l):l=C[57],C[58]!==a||C[59]!==l?(o=(0,t.jsxs)("div",{className:"flex gap-1 w-full",children:[a,l]}),C[58]=a,C[59]=l,C[60]=o):o=C[60],C[61]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)("div",{className:"pt-1 w-fit mx-auto",children:(0,t.jsx)(S,{})}),C[61]=s):s=C[61],C[62]!==N||C[63]!==A||C[64]!==U||C[65]!==T||C[66]!==E?(c=A&&(0,t.jsx)(b.LinkIdentityModal,{open:null!==U,onOpenChange:e=>{e||M(null)},signedInAs:E,linkingIdentity:`@${U??""}`,confirmButtonLabel:"Link Bluesky",confirming:N,onConfirm:()=>{U&&(_(!0),T(U,!0))}}),C[62]=N,C[63]=A,C[64]=U,C[65]=T,C[66]=E,C[67]=c):c=C[67],C[68]!==o||C[69]!==c?(u=(0,t.jsxs)("div",{className:"subscribeHandleInputWrapper max-w-sm mx-auto w-full min-w-0",children:[o,s,c]}),C[68]=o,C[69]=c,C[70]=u):u=C[70],u}},j=e=>{let i,a,o,s,c,u,d,p,h=(0,r.c)(15),[f,b]=(0,l.useState)(!1),g=`flex flex-col text-center justify-center ${e.compact?"gap-3":"gap-4"}`,x=`text-secondary flex flex-col ${e.compact&&"text-sm leading-snug"}`,y=`${e.compact&&"text-sm"}`;return h[0]!==y?(i=(0,t.jsx)("h4",{className:y,children:"Link your Atmosphere account"}),h[0]=y,h[1]=i):i=h[1],h[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("div",{className:"text-tertiary",children:"to comment, recommend, and see what your friends are reading"}),o=(0,t.jsx)(S,{}),h[2]=a,h[3]=o):(a=h[2],o=h[3]),h[4]!==x||h[5]!==i?(s=(0,t.jsxs)("div",{className:x,children:[i,a,o]}),h[4]=x,h[5]=i,h[6]=s):s=h[6],h[7]===Symbol.for("react.memo_cache_sentinel")?(c=e=>{let t=e.trim();t&&(b(!0),window.location.href=(0,n.buildOauthLoginUrl)({handle:t,redirect:window.location.href}))},u=(0,t.jsx)("div",{className:"bg-accent-1 rounded-md px-1 text-accent-2 font-bold text-sm",children:"Link"}),h[7]=c,h[8]=u):(c=h[7],u=h[8]),h[9]!==f?(d=(0,t.jsx)("div",{className:"text-base",children:(0,t.jsx)(m.HandleSearchInput,{loading:f,onSubmit:c,action:u})}),h[9]=f,h[10]=d):d=h[10],h[11]!==g||h[12]!==s||h[13]!==d?(p=(0,t.jsxs)("div",{className:g,children:[s,d]}),h[11]=g,h[12]=s,h[13]=d,h[14]=p):p=h[14],p},S=e=>{let n,l,o,s,c,u,d,m=(0,r.c)(9);return m[0]!==e.trigger?(n=e.trigger?e.trigger:(0,t.jsx)("div",{className:"text-accent-contrast text-sm mx-auto",children:"What's the Atmosphere?"}),m[0]=e.trigger,m[1]=n):n=m[1],m[2]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsxs)("div",{className:"font-bold text-secondary pb-1 ",children:["The Atmosphere is a growing ecosystem of social apps, like Leaflet and Bluesky.",(0,t.jsx)("br",{})]}),m[2]=l):l=m[2],m[3]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsxs)("div",{className:"pb-3 font-bold text-secondary",children:["One account gets you into ",(0,t.jsx)("em",{children:"all"})," of them."]}),s=(0,t.jsx)("div",{className:" text-sm text-tertiary uppercase",children:"Apps on the Atmosphere!"}),m[3]=o,m[4]=s):(o=m[3],s=m[4]),m[5]===Symbol.for("react.memo_cache_sentinel")?(c=(0,t.jsx)("div",{className:"opaque-container pt-3 pb-2 overflow-hidden",children:(0,t.jsx)("div",{className:"logo-scroll-track flex w-max",children:[...C,...C].map(N)})}),u=(0,t.jsx)(i.ButtonPrimary,{fullWidth:!0,className:"mt-3 mx-auto mb-3",children:"Sign up via Bluesky!"}),m[5]=c,m[6]=u):(c=m[5],u=m[6]),m[7]!==n?(d=(0,t.jsxs)(a.Popover,{className:"z-100! w-[min(24rem,var(--radix-popover-content-available-width))] flex flex-col",trigger:n,children:[l,o,s,c,u]}),m[7]=n,m[8]=d):d=m[8],d},k=e=>{let n,i,a=(0,r.c)(6);return a[0]!==e.logo||a[1]!==e.name?(n=(0,t.jsx)("img",{src:e.logo,alt:e.name,className:"w-12 h-12 mx-auto"}),a[0]=e.logo,a[1]=e.name,a[2]=n):n=a[2],a[3]!==e.name||a[4]!==n?(i=(0,t.jsxs)("div",{className:"w-20 flex-shrink-0 flex flex-col gap-2 justify-center text-tertiary font-bold text-sm text-center",children:[n,e.name]}),a[3]=e.name,a[4]=n,a[5]=i):i=a[5],i};function N(e,r){return(0,t.jsx)(k,{logo:e.logo,name:e.name},r)}},503410,e=>{"use strict";e.s(["ManageSubscription",()=>_],503410);var t=e.i(843476),r=e.i(500932),n=e.i(271645),i=e.i(618566),a=e.i(69278),l=e.i(864460),o=e.i(4876),s=e.i(857592),c=e.i(103136),u=e.i(793610),d=e.i(788613),m=e.i(860740),p=e.i(27542),h=e.i(320205),f=e.i(338448),b=e.i(681415),g=e.i(327630),x=e.i(909920),y=e.i(799596),v=e.i(545850),C=e.i(906695),w=e.i(519848),j=e.i(95187);let S=(0,j.createServerReference)("600cc7db62cba45c0ddc17aa70e4139019146b36b0",j.callServer,void 0,j.findSourceMapURL,"unsubscribeFromPublication"),k=(0,j.createServerReference)("60ebb809436d54f58fa3c27ce5
305042274c69566ce9",j.callServer,void 0,j.findSourceMapURL,"setEmailNotifications"),N="flex gap-2 justify-between font-bold text-secondary items-center",_=e=>{let i,a,o,c,u,d,m,p,h,f=(0,r.c)(22),[g,x]=(0,n.useState)(!1),[y,v]=(0,n.useState)(null);f[0]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{(function(){let e=new URLSearchParams(window.location.search);if(!e.get("manage_subscription"))return!1;e.delete("manage_subscription");let t=e.toString();return window.history.replaceState(null,"",window.location.pathname+(t?`?${t}`:"")),!0})()&&x(!0)},a=[],f[0]=i,f[1]=a):(i=f[0],a=f[1]),(0,n.useEffect)(i,a),f[2]!==e.publicationUri?(o=()=>{v(null),x(!1),(0,b.mutateMyMembership)(e.publicationUri)},f[2]=e.publicationUri,f[3]=o):o=f[3];let C=o;f[4]!==e?(c=()=>{x(!1),e.onChangeMembership?.()},f[4]=e,f[5]=c):c=f[5];let w=c,j=y?.type==="change"?"Change Membership":y?.type==="resume"?"Resume Membership?":y?.type==="cancel"?y.membership.cancelAtPeriodEnd?"Membership Cancelled":"Cancel Membership":"Manage Subscription";f[6]!==j?(u=(0,t.jsx)("div",{className:"relative mx-auto text-center",children:j}),f[6]=j,f[7]=u):u=f[7];let S=y?.type==="change"?"w-fit max-w-full bg-[var(--color-bg-light)]!":"w-md max-w-full";return f[8]===Symbol.for("react.memo_cache_sentinel")?(d=e=>{x(e),e||v(null)},f[8]=d):d=f[8],f[9]!==e.triggerLabel?(m=(0,t.jsx)("button",{type:"button",className:"manageSubPrefsTrigger flex gap-1 text-accent-contrast text-sm items-center",children:e.triggerLabel?(0,t.jsx)("div",{className:"hover:underline",children:e.triggerLabel}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"font-bold flex gap-1 items-center",children:[(0,t.jsx)(l.CheckTiny,{})," Subscribed"]}),(0,t.jsx)("div",{className:"underline",children:"Manage"})]})}),f[9]=e.triggerLabel,f[10]=m):m=f[10],f[11]!==y||f[12]!==w||f[13]!==C||f[14]!==e?(p=(0,t.jsx)(P,{...e,state:y,setState:v,onSuccess:C,onFreeMembershipChange:w}),f[11]=y,f[12]=w,f[13]=C,f[14]=e,f[15]=p):p=f[15],f[16]!==g||f[17]!==u||f[18]!==S||f[19]!==m||f[20]!==p?(h=(0,t.jsx)(s.Modal,{asChild:!0,open:g,title:u,className:S,onOpenChange:d,sheetOnMobile:!0,trigger:m,children:p}),f[16]=g,f[17]=u,f[18]=S,f[19]=m,f[20]=p,f[21]=h):h=f[21],h},P=e=>{let n,i,a,l,o,c,u=(0,r.c)(26);u[0]!==e?({state:l,setState:a,onSuccess:i,...n}=e,o=()=>a(null),u[0]=e,u[1]=n,u[2]=i,u[3]=a,u[4]=l,u[5]=o):(n=u[1],i=u[2],a=u[3],l=u[4],o=u[5]);let d=o;if((0,s.useModalBack)(l?d:null),!l){let e,r,i,l;return u[6]!==a?(e=e=>a({type:"change",membership:e}),r=e=>a({type:"resume",membership:e}),i=e=>a({type:"cancel",membership:e}),u[6]=a,u[7]=e,u[8]=r,u[9]=i):(e=u[7],r=u[8],i=u[9]),u[10]!==n||u[11]!==e||u[12]!==r||u[13]!==i?(l=(0,t.jsx)(R,{...n,onChangePlan:e,onResume:r,onCancel:i}),u[10]=n,u[11]=e,u[12]=r,u[13]=i,u[14]=l):l=u[14],l}if("change"===l.type){let e;return u[15]!==i||u[16]!==l.membership?(e=(0,t.jsx)(m.ChangePlanForm,{membership:l.membership,onSuccess:i}),u[15]=i,u[16]=l.membership,u[17]=e):e=u[17],e}if("resume"===l.type){let e;return u[18]!==d||u[19]!==i||u[20]!==l.membership?(e=(0,t.jsx)(h.ResumeMembershipForm,{membership:l.membership,onSuccess:i,onBack:d}),u[18]=d,u[19]=i,u[20]=l.membership,u[21]=e):e=u[21],e}return u[22]!==d||u[23]!==i||u[24]!==l.membership?(c=(0,t.jsx)(p.CancelMembershipForm,{membership:l.membership,onSuccess:i,onBack:d}),u[22]=d,u[23]=i,u[24]=l.membership,u[25]=c):c=u[25],c},R=e=>{let l,m,p,h,f,j,_,P,R,L,A,T,I,O,D,B,$,F,H,W=(0,r.c)(81),{user:z}=e,{membership:G,isLoading:Z}=(0,b.useMyMembership)(e.publicationUri),[V,q]=(0,n.useState)(z.email??""),[Y,K]=(0,n.useState)(!1),[J,X]=(0,n.useState)(!1),[Q,ee]=(0,n.use
30State)(!1),[et,er]=(0,n.useState)(!1),[en,ei]=(0,n.useState)(null),ea=(0,u.useToaster)(),el=(0,i.useRouter)();W[0]!==ea?(l=(e,r)=>ea({type:e,content:(0,t.jsx)("div",{className:"font-bold",children:r})}),W[0]=ea,W[1]=l):l=W[1];let eo=l;W[2]!==eo?(m=(e,t)=>eo("error",E[e]??t),W[2]=eo,W[3]=m):m=W[3];let es=m,ec=en??z.emailEnabled;W[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{ei(null)},W[4]=p):p=W[4],W[5]!==e.publicationUri||W[6]!==z.emailEnabled?(h=[z.emailEnabled,e.publicationUri],W[5]=e.publicationUri,W[6]=z.emailEnabled,W[7]=h):h=W[7],(0,n.useEffect)(p,h),W[8]!==ec||W[9]!==en||W[10]!==es||W[11]!==e.publicationUri||W[12]!==el?(f=async()=>{if(null!==en)return;let t=!ec;ei(t);let r=await k(e.publicationUri,t);if(!r.ok){ei(null),es(r.error,"We couldn't update your email notifications. Please try again!");return}(0,v.markLocalEmailEnabled)(e.publicationUri,t),el.refresh()},W[8]=ec,W[9]=en,W[10]=es,W[11]=e.publicationUri,W[12]=el,W[13]=f):f=W[13];let eu=f;W[14]!==eo||W[15]!==e.publicationUri||W[16]!==el?(j=()=>{eo("success","Email Linked!"),K(!1),(0,v.markLocallySubscribed)(e.publicationUri,"email"),el.refresh()},W[14]=eo,W[15]=e.publicationUri,W[16]=el,W[17]=j):j=W[17];let ed=j;W[18]!==V||W[19]!==J||W[20]!==es||W[21]!==ed||W[22]!==e.publicationUri?(_=async()=>{if(J||!V)return;X(!0);let t=await (0,C.requestPublicationEmailSubscription)(e.publicationUri,V);(X(!1),t.ok)?t.value.confirmed?ed():K(!0):es(t.error,"We couldn't link that email. Please try again!")},W[18]=V,W[19]=J,W[20]=es,W[21]=ed,W[22]=e.publicationUri,W[23]=_):_=W[23];let em=_;W[24]!==V||W[25]!==Q||W[26]!==es||W[27]!==ed||W[28]!==e.publicationUri?(P=async t=>{if(Q)return;ee(!0);let r=await (0,w.confirmPublicationEmailSubscription)(e.publicationUri,V,t);(ee(!1),r.ok)?ed():es(r.error,"We couldn't confirm the code. Please try again!")},W[24]=V,W[25]=Q,W[26]=es,W[27]=ed,W[28]=e.publicationUri,W[29]=P):P=W[29];let ep=P;W[30]!==eo||W[31]!==es||W[32]!==e.publicationUri||W[33]!==el||W[34]!==et?(R=async()=>{if(et)return;er(!0);let t=await S(e.publicationUri);(er(!1),t.ok)?(eo("success","Unsubscribed!"),(0,b.mutateMyMembership)(e.publicationUri),(0,v.markLocallyUnsubscribed)(e.publicationUri),el.refresh()):es(t.error,"We couldn't unsubscribe you. Please try again!")},W[30]=eo,W[31]=es,W[32]=e.publicationUri,W[33]=el,W[34]=et,W[35]=R):R=W[35];let eh=R;if(Z){let e;return W[36]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("div",{className:"flex justify-center py-8",children:(0,t.jsx)(d.DotLoader,{})}),W[36]=e):e=W[36],e}let ef=z.membership,eb=G&&ef?.kind==="paid"?G:null,eg=eb?.cancelAtPeriodEnd?eb:null,ex=eb||ef?.kind!=="free"?null:e.membershipTiers?.subscriber,ey=!ec||z.atprotoSubscribed||!!eb;return W[37]!==eb||W[38]!==ex||W[39]!==e.onChangeMembership||W[40]!==e.onChangePlan||W[41]!==e.onFreeMembershipChange||W[42]!==e.onResume?(L=eb?(0,t.jsx)(M,{membership:eb,onChangePlan:e.onChangePlan,onResume:e.onResume}):ex?(0,t.jsx)(U,{tier:ex,onChangePlan:e.onChangeMembership?e.onFreeMembershipChange:void 0}):null,W[37]=eb,W[38]=ex,W[39]=e.onChangeMembership,W[40]=e.onChangePlan,W[41]=e.onFreeMembershipChange,W[42]=e.onResume,W[43]=L):L=W[43],W[44]!==ey||W[45]!==ec||W[46]!==eu||W[47]!==e.newsletterMode||W[48]!==z.email?(A=e.newsletterMode&&z.email?(0,t.jsxs)("div",{className:N,children:[(0,t.jsxs)("div",{className:"flex flex-col leading-snug",children:[(0,t.jsx)("p",{children:"Email Notifications"}),(0,t.jsx)("p",{className:"text-tertiary font-normal italic",children:z.email})]}),ey?(0,t.jsx)(c.Toggle,{toggle:ec,onToggle:eu,children:(0,t.jsx)("span",{className:"sr-only",children:ec?"Turn off email notifications":"Turn on email notifications"})}):null]}):null,W[44]=ey,W[45]=ec,W[46]=eu,W[47]=e.newsletterMode,W[48]=z.email,W[49]=A):A=W[49],W[50]!==z.handle?(T=z.handle&&(0,t.jsx)("div",{className:N,children:(0,t.jsxs)("div",{className:"flex flex-col leading-snug",children:["Linked Handle",(0,t.jsx)("p",{className:"text-tertiary font-normal italic",children:z.handle})]})}),W[50]=z.handle,W[51]=T):T=W[51],W[52]!==e.publicationUrl?(I=e.publicationUrl&&(0,t.jsxs)("a",{href:`${e.publicationUrl}/rss`,target:"_blank",rel:"noopener noreferrer",className:`${N}
30 no-underline hover:text-accent-contrast`,children:["RSS Feed ",(0,t.jsx)(o.GoToArrow,{className:"text-accent-contrast"})]}),W[52]=e.publicationUrl,W[53]=I):I=W[53],W[54]===Symbol.for("react.memo_cache_sentinel")?(O=(0,t.jsxs)("a",{href:x.BLUESKY_SUBSCRIBED_FEED_URL,target:"_blank",rel:"noopener noreferrer",className:`${N} no-underline hover:text-accent-contrast`,children:["Bluesky Feed",(0,t.jsx)(o.GoToArrow,{className:"text-accent-contrast"})]}),W[54]=O):O=W[54],W[55]!==V||W[56]!==Q||W[57]!==Y||W[58]!==J||W[59]!==ep||W[60]!==em||W[61]!==e.newsletterMode||W[62]!==z.email?(D=e.newsletterMode&&!z.email?(0,t.jsxs)("div",{className:"linkEmail accent-container p-4 text-sm flex flex-col gap-3 text-center justify-center",children:[(0,t.jsxs)("div",{className:"text-secondary flex flex-col text-sm leading-snug",children:[(0,t.jsx)("h4",{className:"text-sm",children:"Link your email"}),(0,t.jsx)("div",{className:"text-tertiary",children:"to get updates right to your inbox!"})]}),(0,t.jsx)(y.EmailInput,{value:V,onChange:q,loading:J,onSubmit:em,action:(0,t.jsx)(s.Modal,{open:Y,onOpenChange:K,trigger:(0,t.jsx)(a.ButtonPrimary,{type:"button",compact:!0,disabled:J||!V,onClick:em,className:"leading-tight! outline-none! text-sm!",children:"link"}),children:(0,t.jsx)(y.EmailConfirm,{emailValue:V,autoFocus:!0,loading:Q,onBack:()=>K(!1),onSubmit:ep})})})]}):null,W[55]=V,W[56]=Q,W[57]=Y,W[58]=J,W[59]=ep,W[60]=em,W[61]=e.newsletterMode,W[62]=z.email,W[63]=D):D=W[63],W[64]!==z.handle?(B=z.handle?null:(0,t.jsx)("div",{className:"accent-container p-4 text-sm",children:(0,t.jsx)(g.LinkHandle,{compact:!0})}),W[64]=z.handle,W[65]=B):B=W[65],W[66]===Symbol.for("react.memo_cache_sentinel")?($=(0,t.jsx)("hr",{className:"border-border-light my-2"}),W[66]=$):$=W[66],W[67]!==eb||W[68]!==eh||W[69]!==eg||W[70]!==e||W[71]!==et?(F=eb&&!eg?(0,t.jsx)(a.ButtonSecondary,{fullWidth:!0,onClick:()=>e.onCancel(eb),children:"Cancel Membership"}):(0,t.jsx)(a.ButtonSecondary,{fullWidth:!0,disabled:et,onClick:()=>eg?e.onCancel(eg):eh(),children:et?"Unsubscribingâ¦":"Unsubscribe"}),W[67]=eb,W[68]=eh,W[69]=eg,W[70]=e,W[71]=et,W[72]=F):F=W[72],W[73]!==A||W[74]!==T||W[75]!==I||W[76]!==D||W[77]!==B||W[78]!==F||W[79]!==L?(H=(0,t.jsxs)("div",{className:"manageSubPrefs flex flex-col gap-2",children:[L,A,T,I,O,D,B,$,F]}),W[73]=A,W[74]=T,W[75]=I,W[76]=D,W[77]=B,W[78]=F,W[79]=L,W[80]=H):H=W[80],H},U=e=>{let n,i,l,o,s=(0,r.c)(8);return s[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("p",{children:"Membership"}),s[0]=n):n=s[0],s[1]!==e.tier.name?(i=(0,t.jsxs)("div",{className:"flex flex-col leading-snug",children:[n,(0,t.jsx)("p",{className:"text-tertiary font-normal italic",children:e.tier.name})]}),s[1]=e.tier.name,s[2]=i):i=s[2],s[3]!==e.onChangePlan?(l=e.onChangePlan&&(0,t.jsx)(a.ButtonPrimary,{className:"text-sm",type:"button",compact:!0,onClick:e.onChangePlan,children:"Change"}),s[3]=e.onChangePlan,s[4]=l):l=s[4],s[5]!==i||s[6]!==l?(o=(0,t.jsxs)("div",{className:N,children:[i,l]}),s[5]=i,s[6]=l,s[7]=o):o=s[7],o},M=e=>{let n,i,a,l,o,s,c,u,d,p=(0,r.c)(22),{membership:h}=e,b=(0,m.membershipPrice)(h);p[0]===Symbol.for("react.memo_cache_sentinel")?(n={year:"numeric",month:"short",day:"numeric"},p[0]=n):n=p[0];let g=(0,f.useLocalizedDate)(h.currentPeriodEnd??"",n);p[1]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsx)("p",{children:"Membership"}),p[1]=i):i=p[1],p[2]!==h||p[3]!==e?(a=()=>e.onChangePlan(h),l=()=>e.onResume(h),p[2]=h,p[3]=e,p[4]=a,p[5]=l):(a=p[4],l=p[5]),p[6]!==h||p[7]!==a||p[8]!==l?(o=(0,t.jsxs)("div",{className:" flex justify-between gap-4 w-full",children:[i,(0,t.jsx)(m.MembershipActions,{membership:h,onChangePlan:a,onResume:l})]}),p[6]=h,p[7]=a,p[8]=l,p[9]=o):o=p[9];let x=h.tierName??"Membership",y=b?` \xb7 ${b}`:"";return p[10]!==x||p[11]!==y?(s=(0,t.jsxs)("p",{className:"text-tertiary font-normal italic",children:[x,y]}),p[10]=x,p[11]=y,p[12]=s):s=p[12],p[13]!==g||p[14]!==h?(c=h.cancelAtPeriodEnd&&h.currentPeriodEnd?`Ends ${g}`:(0,m.pendingPlanLabel)(h,h.currentPeriodEnd?g:"")??"",p[13]=g,p[14]=h,p[15]=c):c=p[15],p[16]!==c?(u=(0,t.jsx)("p",{className:"text-tertiary text-sm font-normal italic",children:c}),p[16]=c,p[17]=u):u=p[17],p[18]!==o||p[19]!==s||p[20]!==u?(d=(0,t.jsx)("div",{className:N,children:(0,t.jsxs)("div",{className:"flex flex-col leading-snug w-full",children:[o,s,u]})}),p[18]=o,p[19]=s,p[20]=u,p[21]=d):d=p[21],d},E={unauthorized:"Sign in to manage your subscription.",database_error:"Something went wrong. Please try again.",invalid_email:"Please enter a valid email address.",no_email:"Link an email to your account first.",newsletter_disabled:"This publication isn't accepting email subscriptions.",email_send_failed:"We couldn't send the confirmation email. Please try again.",subscriber_not_found:"No pending subscription. Please try again.",invalid_code:"That code didn't match. Please try again.",suppressed_spam_complaint:"This address was previously marked as spam. Contact the publication to resolve.",suppression_delete_failed:"We couldn't clear a prior delivery issue on this address. Try again later.",membership_active:"Cancel your membership first, then unsubscribe.",membership_pending_cancellation:"Your membership is still active â confirm cancelling it to unsubscribe.",stripe_error:"We couldn't cancel your membership's b
30illing. Please try again."}},459759,880585,749638,e=>{"use strict";e.s(["PaidSubscribeButton",()=>m],459759);var t=e.i(843476),r=e.i(500932),n=e.i(271645),i=e.i(69278),a=e.i(503410),l=e.i(545850);e.s(["JoinMembershipModal",()=>c],880585);var o=e.i(857592),s=e.i(911119);function c(e){let n,i,a,l,c=(0,r.c)(19);return c[0]!==e?(n=()=>e.onOpenChange(!1),c[0]=e,c[1]=n):n=c[1],c[2]!==e.gatePolicy||c[3]!==e.newsletterMode||c[4]!==e.open||c[5]!==e.publicationName||c[6]!==e.publicationUri||c[7]!==e.publicationUrl||c[8]!==e.resume||c[9]!==e.source||c[10]!==e.tiers||c[11]!==e.viewerOverride||c[12]!==n?(i=(0,t.jsx)(s.JoinMembershipFlow,{active:e.open,onClose:n,publicationUri:e.publicationUri,publicationName:e.publicationName,publicationUrl:e.publicationUrl,newsletterMode:e.newsletterMode,tiers:e.tiers,gatePolicy:e.gatePolicy,resume:e.resume,source:e.source,viewerOverride:e.viewerOverride}),c[2]=e.gatePolicy,c[3]=e.newsletterMode,c[4]=e.open,c[5]=e.publicationName,c[6]=e.publicationUri,c[7]=e.publicationUrl,c[8]=e.resume,c[9]=e.source,c[10]=e.tiers,c[11]=e.viewerOverride,c[12]=n,c[13]=i):i=c[13],c[14]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("div",{className:"spacer h-6 sm:hidden"}),c[14]=a):a=c[14],c[15]!==e.onOpenChange||c[16]!==e.open||c[17]!==i?(l=(0,t.jsxs)(o.Modal,{sheetOnMobile:!0,open:e.open,onOpenChange:e.onOpenChange,className:"max-w-full w-fit p-4 pt-3 sm:p-6 sm:pb-8 sm:pt-5 bg-[var(--color-bg-light)]!",children:[i,a]}),c[15]=e.onOpenChange,c[16]=e.open,c[17]=i,c[18]=l):l=c[18],l}let u=!1;function d(){let e=new URLSearchParams(window.location.search),t=e.get("wallet_session"),r=e.get("join_tier"),n=e.get("join_cadence"),i="year"===n?"year":"month"===n?"month":null;return(t||r)&&!u&&(u=!0,1)?(window.history.replaceState(null,"",window.location.pathname),t?{kind:"wallet",sessionId:t,tierId:r,cadence:i}:{kind:"auth",tierId:r,cadence:i}):null}e.s(["readJoinResume",0,d],749638);let m=e=>{let o,s,u,m,p,h=(0,r.c)(23),f=(0,l.useViewerSubscription)(e.publicationUri),[b,g]=(0,n.useState)(!1),[x,y]=(0,n.useState)(null);return h[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{let e=d();e&&(y(e),g(!0))},s=[],h[0]=o,h[1]=s):(o=h[0],s=h[1]),(0,n.useEffect)(o,s),h[2]!==e.compact||h[3]!==e.newsletterMode||h[4]!==e.publicationUri||h[5]!==e.publicationUrl||h[6]!==e.tiers||h[7]!==f?(u=f.subscribed?(0,t.jsx)(a.ManageSubscription,{publicationUri:e.publicationUri,publicationUrl:e.publicationUrl,newsletterMode:e.newsletterMode,user:f,membershipTiers:e.tiers,onChangeMembership:()=>g(!0)}):(0,t.jsx)(i.ButtonPrimary,{compact:e.compact,type:"button",className:"pubPageSubscribe text-sm!",onClick:()=>g(!0),children:"Subscribe"}),h[2]=e.compact,h[3]=e.newsletterMode,h[4]=e.publicationUri,h[5]=e.publicationUrl,h[6]=e.tiers,h[7]=f,h[8]=u):u=h[8],h[9]!==b||h[10]!==e.gatePolicy||h[11]!==e.newsletterMode||h[12]!==e.publicationName||h[13]!==e.publicationUri||h[14]!==e.publicationUrl||h[15]!==e.source||h[16]!==e.tiers||h[17]!==e.viewerOverride||h[18]!==x?(m=(0,t.jsx)(c,{open:b,onOpenChange:g,publicationUri:e.publicationUri,publicationUrl:e.publicationUrl,publicationName:e.publicationName,newsletterMode:e.newsletterMode,tiers:e.tiers,gatePolicy:e.gatePolicy,resume:x,source:e.source,viewerOverride:e.viewerOverride}),h[9]=b,h[10]=e.gatePolicy,h[11]=e.newsletterMode,h[12]=e.publicationName,h[13]=e.publicationUri,h[14]=e.publicationUrl,h[15]=e.source,h[16]=e.tiers,h[17]=e.viewerOverride,h[18]=x,h[19]=m):m=h[19],h[20]!==u||h[21]!==m?(p=(0,t.jsxs)(t.Fragment,{children:[u,m]}),h[20]=u,h[21]=m,h[22]=p):p=h[22],p}},819772,e=>{"use strict";e.s(["RecommendedPublications",()=>l,"RecommendedPubsGrid",()=>a]);var t=e.i(843476),r=e.i(500932),n=e.i(855476),i=e.i(393123);let a=e=>{let a,l,o,s=(0,r.c)(24);if(e.compact){let r,i,a=`flex flex-row gap-3 text-left overflow-x-auto p-1 -m-1 ${e.className||""}`;if(s[0]!==e.disableLinks||s[1]!==e.listings||s[2]!==e.subscribeSource){let i;s[4]!==e.disableLinks||s[5]!==e.subscribeSource?(i=r=>(0,t.jsx)("div",{className:"flex sm:w-56 w-32 shrink-0",children:(0,t.jsx)(n.PubListing,{compact:!0,showSubscribeButton:!0,subscribeSource:e.subscribeSource,disableLinks:e.disableLinks,...r})},r.uri),s[4]=e.disableLinks,s[5]=e.subscribeSource,s[6]=i):i=s[6],r=e.listings.map(i),s[0]=e.disableLinks,s[1]=e.listings,s[2]=e.subscribeSource,s[3]=r}else r=s[3];return s[7]!==a||s[8]!==r?(i=(0,t.jsx)("div",{className:a,children:r}),s[7]=a,s[8]=r,s[9]=i):i=s[9],i}let c=`flex flex-col gap-2 text-left sm:grid ${e.className||""}`;if(s[10]!==e.listings.length?(a=(0,i.centeredGridStyle)(e.listings.length),s[10]=e.listings.length,s[11]=a):a=s[11],s[12]!==e.disableLinks||s[13]!==e.listings||s[14]!==e.subscribeSource){let r;s[16]!==e.disableLinks||s[17]!==e.listings.length||s[18]!==e.subscribeSource?(r=(r,a)=>(0,t.jsx)("div",{className:"flex",style:(0,i.centeredGridCellStyle)(a,e.listings.length),children:(0,t.jsx)(n.PubListing,{compact:!0,showSubscribeButton:!0,subscribeSource:e.subscribeSource,disableLinks:e.disableLinks,...r})},r.uri),s[16]=e.disableLinks,s[17]=e.listings.length,s[18]=e.subscribeSource,s[19]=r):r=s[19],l=e.listings.map(r),s[12]=e.disableLinks,s[13]=e.listings,s[14]=e.subscribeSource,s[15]=l}else l=s[15];return s[20]!==c||s[21]!==a||s[22]!==l?(o=(0,t.jsx)("div",{className:c,style:a,children:l}),s[20]=c,s[21]=a,s[22]=l,s[23]=o):o=s[23],o},l=e=>{let n,i,l,o,s=(0,r.c)(10);return 0===e.listings.length?null:(s[0]!==e.publicationName?(n=(0,t.jsxs)("h4",{children:["Check out ",e.publicationName,"'s recommendations! "]}),s[0]=e.publicationName,s[1]=n):n=s[1],s[2]!==e.recommendingPublicationUri?(i={placement:"recommendation",publication:e.recommendingPublicationUri},s[2]=e.recommendingPublicationUri,s[3]=i):i=s[3],s[4]!==e.listings||s[5]!==i?(l=(0,t.jsx)("div",{className:"light-container p-2",children:(0,t.jsx)(a,{listings:e.listings,subscribeSource:i})}),s[4]=e.listings,s[5]=i,s[6]=l):l=s[6],s[7]!==n||s[8]!==l?(o=(0,t.jsxs)("div",{className:"flex flex-col gap-2 w-full max-w-full sm:w-2xl pt-6",children:[n,l]}),s[7]=n,s[8]=l,s[9]=o):o=s[9],o)}},368408,e=>{"use strict";e.s(["SubscribeButton",()=>M,"SubscribeButtonModeMenu",()=>L,"SubscribeInput",()=>U,"SubscribeInputModeMenu",()=>E,"SubscribePanel",()=>R]);var t=e.i(843476),r=e.i(500932),n=e.i(271645),i=e.i(618566),a=e.i(327630),l=e.i(799596),o=e.i(277009),s=e.i(694777),c=e.i(937929),u=e.i(857592),d=e.i(69278),m=e.i(503410),p=e.i(793610),h=e.i(806398),f=e.i(899161),b=e.i(728684),g=e.i(416504),x=e.i(713418),y=e.i(906695),v=e.i(519848),C=e.i(123838),w=e.i(607585),j=e.i(545850),S=e.i(279490),k=e.i(859015),N=e.i(142524),_=e.i(459759),P=e.i(449883);let R=e=>{let n,i,a,l,o=(0,r.c)(10);return o[0]!==e.publicationName?(n=(0,t.jsx)("h3",{className:"leading-snug text-secondary",children:e.publicationName}),o[0]=e.publicationName,o[1]=n):n=o[1],o[2]!==e.publicationDescription?(i=e.publicationDescription&&(0,t.jsx)("div",{className:"text-tertiary leading-snug",children:e.publicationDescription}),o[2]=e.publicationDescription,o[3]=i):i=o[3],o[4]!==e?(a=(0,t.jsx)("div",{className:"w-fit max-w-full mx-auto pt-3",children:(0,t.jsx)(U,{...e})}),o[4]=e,o[5]=a):a=o[5],o[6]!==n||o[7]!==i||o[8]!==a?(l=(0,t.jsx)("div",{className:"subscribePanel accent-container rounded-lg! border-none! p-0! w-full text-center justify-center",children:(0,t.jsxs)("div",{className:"px-3 pt-3 pb-4 sm:px-4 sm:pt-4 sm:pb-5",children:[n,i,a]})}),o[6]=n,o[7]=i,o[8]=a,o[9]=l):l=o[9],l},U=e=>{let f,b,g,x,k,N,R,U,M,L,A,T,I,O,D=(0,r.c)(74),B=(0,p.useToaster)(),$=(0,i.useRouter)(),F=(0,j.useViewerSubscription)(e.publicationUri),{identity:H}
30=(0,h.useIdentityData)(),[W,z]=(0,n.useState)(F.email??"");D[0]!==F.email?(f=()=>{F.email&&z(e=>""===e?F.email:e)},b=[F.email],D[0]=F.email,D[1]=f,D[2]=b):(f=D[1],b=D[2]),(0,n.useEffect)(f,b);let[G,Z]=(0,n.useState)(!1),[V,q]=(0,n.useState)(!1),[Y,K]=(0,n.useState)(!1),[J,X]=(0,n.useState)("confirm"),[Q,ee]=(0,n.useState)(!1),[et,er]=(0,n.useState)(!1),[en,ei]=(0,n.useState)(!1),[ea,el]=(0,n.useState)("email"),eo=(0,P.useMembershipTiers)(e.publicationUri);(0,S.useSubscribeSuccessData)(e.publicationUri);let es=H?.bsky_profiles?.handle,ec=H?.atp_did,eu=H?.email,ed=!!ec&&!eu&&!!W;D[3]!==W||D[4]!==e.publicationUri||D[5]!==e.source||D[6]!==$||D[7]!==B?(g=async t=>{Z(!0),er(t);let r=await (0,y.requestPublicationEmailSubscription)(e.publicationUri,W,e.source);(Z(!1),r.ok)?(r.value.confirmed&&(X("success"),(0,j.markLocallySubscribed)(e.publicationUri,"email"),$.refresh()),K(!0)):B({type:"error",content:c.SUBSCRIBE_ERROR_MESSAGES[r.error]})},D[3]=W,D[4]=e.publicationUri,D[5]=e.source,D[6]=$,D[7]=B,D[8]=g):g=D[8];let em=g;D[9]!==ea?(x=(0,t.jsx)(E,{mode:ea,onChange:el}),D[9]=ea,D[10]=x):x=D[10];let ep=x;if(eo.hasPaidTiers&&eo.tiers){let r;return D[11]!==eo.tiers||D[12]!==e?(r=(0,t.jsx)(_.PaidSubscribeButton,{...e,tiers:eo.tiers}),D[11]=eo.tiers,D[12]=e,D[13]=r):r=D[13],r}let eh=F.loggedIn&&!!F.email;D[14]!==W||D[15]!==ed||D[16]!==e.publicationUri||D[17]!==e.source||D[18]!==G?(k=()=>{if(W&&!G){var t,r;let n;if(ed)return void ei(!0);t=e.publicationUri,r=e.source,(n=new URL("/api/auth/email-login",(0,w.mainSiteAuthBase)()||window.location.origin)).searchParams.set("email",W),n.searchParams.set("redirect",window.location.href),n.searchParams.set("action",(0,C.encodeActionToSearchParam)({action:"subscribe",publication:t,...r?{source:{url:window.location.href,...r}}:{}})),window.location.href=n.toString()}},D[14]=W,D[15]=ed,D[16]=e.publicationUri,D[17]=e.source,D[18]=G,D[19]=k):k=D[19],D[20]===Symbol.for("react.memo_cache_sentinel")?(N=(0,t.jsx)(d.ButtonPrimary,{type:"submit",compact:!0,className:"leading-tight! outline-none! text-sm!",children:"Subscribe"}),D[20]=N):N=D[20],D[21]!==W||D[22]!==ep||D[23]!==e.publicationUrl||D[24]!==G||D[25]!==eh||D[26]!==k?(R=(0,t.jsx)(l.EmailInput,{publicationUrl:e.publicationUrl,value:W,onChange:z,disabled:eh,loading:G,leading:ep,onSubmit:k,action:N}),D[21]=W,D[22]=ep,D[23]=e.publicationUrl,D[24]=G,D[25]=eh,D[26]=k,D[27]=R):R=D[27];let ef=R;return D[28]!==W||D[29]!==ef||D[30]!==ep||D[31]!==ed||D[32]!==e.newsletterMode||D[33]!==e.publicationUri||D[34]!==e.publicationUrl||D[35]!==e.source||D[36]!==G||D[37]!==em||D[38]!==ea||D[39]!==F?(U=F.subscribed?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex justify-center",children:(0,t.jsx)(m.ManageSubscription,{publicationUri:e.publicationUri,publicationUrl:e.publicationUrl,newsletterMode:e.newsletterMode,user:F})}),e.newsletterMode&&F.atprotoSubscribed&&!F.emailEnabled?(0,t.jsxs)("div",{className:"text-secondary w-full text-sm p-2 pt-1.5 mt-1 rounded-md flex flex-col gap-1",style:{background:"color-mix(in oklab, rgb(var(--accent-contrast)), rgb(var(--bg-page)) 70%"},children:[(0,t.jsx)("div",{className:"font-bold",children:"Opt in to get updates via email!"}),(0,t.jsx)("div",{className:"max-w-sm w-full mx-auto",children:(0,t.jsx)(l.EmailInput,{publicationUrl:e.publicationUrl,value:W,onChange:z,disabled:F.loggedIn&&!!F.email,loading:G,onSubmit:async()=>{if(!G&&W){if(ed)return void ei(!0);await em(!1)}},action:(0,t.jsx)(d.ButtonPrimary,{type:"submit",compact:!0,className:"leading-tight! outline-none! text-sm!",disabled:G||!W,children:"Get Emails"})})})]}):null]}):e.newsletterMode?(0,t.jsx)("div",{className:"max-w-sm w-full mx-auto",children:F.loggedIn&&F.email?(0,t.jsx)(l.EmailButton,{publicationUri:e.publicationUri,publicationUrl:e.publicationUrl,source:e.source,email:F.email,handle:F.handle,onSuccess:e=>{"email"===e?(X("success"),K(!0)):ee(!0)}}):"email"===ea?ef:(0,t.jsx)(a.SubscribeWithHandle,{user:F,publicationUri:e.publicationUri,publicationUrl:e.publicationUrl,source:e.source,onAtSuccess:()=>ee(!0),leading:ep})}):(0,t.jsx)(a.SubscribeWithHandle,{user:F,publicationUri:e.publicationUri,publicationUrl:e.publicationUrl,source:e.source,onAtSuccess:()=>ee(!0)}),D[28]=W,D[29]=ef,D[30]=ep,D[31]=ed,D[32]=e.newsletterMode,D[33]=e.publicationUri,D[34]=e.publicationUrl,D[35]=e.source,D[36]=G,D[37]=em,D[38]=ea,D[39]=F,D[40]=U):U=D[40],D[41]!==W||D[42]!==en||D[43]!==ed||D[44]!==e.newsletterMode||D[45]!==G||D[46]!==em||D[47]!==es?(M=e.newsletterMode&&ed&&(0,t.jsx)(s.LinkIdentityModal,{open:en,onOpenChange:ei,signedInAs:es?`@${es}`:"your Bluesky account",linkingIdentity:W,confirmButtonLabel:"Link email",confirming:G,onConfirm:async()=>{ei(!1),await em(!0)}}),D[41]=W,D[42]=en,D[43]=ed,D[44]=e.newsletterMode,D[45]=G,D[46]=em,D[47]=es,D[48]=M):M=D[48],D[49]!==$?(L=e=>{ee(e),e||$.refresh()},D[49]=$,D[50]=L):L=D[50],D[51]!==e.publicationUri?(A=(0,t.jsx)(o.AtSubscribeSuccess,{publicationUri:e.publicationUri}),D[51]=e.publicationUri,D[52]=A):A=D[52],D[53]!==Q||D[54]!==L||D[55]!==A?(T=(0,t.jsx)(u.Modal,{open:Q,onOpenChange:L,children:A}),D[53]=Q,D[54]=L,D[55]=A,D[56]=T):T=D[56],D[57]!==Y||D[58]!==J||D[59]!==V||D[60]!==W||D[61]!==et||D[62]!==e.newsletterMode||D[63]!==e.publicationUri||D[64]!==e.source||D[65]!==$||D[66]!==B||D[67]!==F.handle?(I=e.newsletterMode&&(0,t.jsx)(u.Modal,{open:Y,onOpenChange:e=>{K(e),e||(X("confirm"),er(!1))},children:"success"===J?(0,t.jsx)(o.EmailSubscribeSuccess,{email:W,handle:F.handle,publicationUri:e.publicationUri}):(0,t.jsx)(l.EmailConfirm,{autoFocus:!0,loading:V,onBack:()=>K(!1),emailValue:W,onSubmit:async t=>{if(V)return;q(!0);let r=await (0,v.confirmPublicationEmailSubscription)(e.publicationUri,W,t,et,e.source);(q(!1),r.ok)?(X("success"),(0,j.markLocallySubscribed)(e.publicationUri,"email"),$.refresh()):B({type:"error",content:c.SUBSCRIBE_ERROR_MESSAGES[r.error]})}})}),D[57]=Y,D[58]=J,D[59]=V,D[60]=W,D[61]=et,D[62]=e.newsletterMode,D[63]=e.publicationUri,D[64]=e.source,D[65]=$,D[66]=B,D[67]=F.handle,D[68]=I):I=D[
3068],D[69]!==T||D[70]!==I||D[71]!==U||D[72]!==M?(O=(0,t.jsxs)(t.Fragment,{children:[U,M,T,I]}),D[69]=T,D[70]=I,D[71]=U,D[72]=M,D[73]=O):O=D[73],O},M=e=>{let i,s,c,p,h,f,b,g,x,y=(0,r.c)(25),v=(0,j.useViewerSubscription)(e.publicationUri),[C,w]=(0,n.useState)(!1),[S,k]=(0,n.useState)(!1),N=(0,P.useMembershipTiers)(e.publicationUri);if(N.hasPaidTiers&&N.tiers){let r;return y[0]!==N.tiers||y[1]!==e?(r=(0,t.jsx)(_.PaidSubscribeButton,{...e,tiers:N.tiers,compact:!0}),y[0]=N.tiers,y[1]=e,y[2]=r):r=y[2],r}y[3]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsx)(d.ButtonPrimary,{compact:!0,className:"pubPageSubscribe text-sm!",children:"Subscribe"}),y[3]=i):i=y[3];let U=i;return y[4]!==e||y[5]!==v?(s=v.subscribed?(0,t.jsx)(m.ManageSubscription,{publicationUri:e.publicationUri,publicationUrl:e.publicationUrl,newsletterMode:e.newsletterMode,user:v}):!e.newsletterMode&&v.loggedIn&&v.handle?(0,t.jsx)(a.SubscribeWithHandle,{compact:!0,user:v,publicationUri:e.publicationUri,publicationUrl:e.publicationUrl,source:e.source,onAtSuccess:()=>w(!0)}):e.newsletterMode&&v.loggedIn&&v.email?(0,t.jsx)(l.EmailButton,{compact:!0,publicationUri:e.publicationUri,publicationUrl:e.publicationUrl,source:e.source,email:v.email,handle:v.handle,onSuccess:e=>{"email"===e?k(!0):w(!0)}}):(0,t.jsx)(u.Modal,{asChild:!0,trigger:U,children:(0,t.jsx)("div",{className:"w-md max-w-full",children:(0,t.jsx)(R,{...e})})}),y[4]=e,y[5]=v,y[6]=s):s=y[6],y[7]===Symbol.for("react.memo_cache_sentinel")?(c=e=>{e||w(!1)},y[7]=c):c=y[7],y[8]!==e.publicationUri?(p=(0,t.jsx)(o.AtSubscribeSuccess,{publicationUri:e.publicationUri}),y[8]=e.publicationUri,y[9]=p):p=y[9],y[10]!==C||y[11]!==p?(h=(0,t.jsx)(u.Modal,{open:C,onOpenChange:c,children:p}),y[10]=C,y[11]=p,y[12]=h):h=y[12],y[13]===Symbol.for("react.memo_cache_sentinel")?(f=e=>{e||k(!1)},y[13]=f):f=y[13],y[14]!==e.publicationUri||y[15]!==v.email||y[16]!==v.handle?(b=(0,t.jsx)(o.EmailSubscribeSuccess,{email:v.email,handle:v.handle,publicationUri:e.publicationUri}),y[14]=e.publicationUri,y[15]=v.email,y[16]=v.handle,y[17]=b):b=y[17],y[18]!==S||y[19]!==b?(g=(0,t.jsx)(u.Modal,{open:S,onOpenChange:f,children:b}),y[18]=S,y[19]=b,y[20]=g):g=y[20],y[21]!==s||y[22]!==h||y[23]!==g?(x=(0,t.jsxs)(t.Fragment,{children:[s,h,g]}),y[21]=s,y[22]=h,y[23]=g,y[24]=x):x=y[24],x},E=e=>{let n,i,a,l,o,s,c,u,d,m,p,h,x,y=(0,r.c)(25);y[0]!==e.mode?(n="email"===e.mode?(0,t.jsx)(b.EmailTiny,{}):(0,t.jsx)(f.AtmosphereAccount,{}),y[0]=e.mode,y[1]=n):n=y[1],y[2]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsx)(N.ArrowDownTiny,{className:"scale-90"}),y[2]=i):i=y[2],y[3]!==n?(a=(0,t.jsxs)("button",{type:"button","aria-label":"Choose subscribe method",className:"text-inherit flex items-center gap-1",children:[n,i]}),y[3]=n,y[4]=a):a=y[4],y[5]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)("div",{className:"text-tertiary text-sm px-1 pt-0.5 -mb-0.5",children:"Subscribe viaâ¦"}),y[5]=l):l=y[5],y[6]!==e?(o=t=>e.onChange(t),y[6]=e,y[7]=o):o=y[7];let v="email"===e.mode;y[8]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsxs)("span",{className:"flex items-center gap-2 shrink-0",children:[(0,t.jsx)(b.EmailTiny,{})," Email"]}),y[8]=s):s=y[8],y[9]!==v?(c=(0,t.jsx)(g.RadioMenuItem,{value:"email",selected:v,children:s}),y[9]=v,y[10]=c):c=y[10];let C="atproto"===e.mode;return y[11]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)(f.AtmosphereAccount,{})," Atmosphere"]}),y[11]=u):u=y[11],y[12]!==C?(d=(0,t.jsx)(g.RadioMenuItem,{value:"atproto",selected:C,children:u}),y[12]=C,y[13]=d):d=y[13],y[14]!==e.mode||y[15]!==d||y[16]!==o||y[17]!==c?(m=(0,t.jsxs)(g.RadioMenuGroup,{value:e.mode,onValueChange:o,children:[c,d]}),y[14]=e.mode,y[15]=d,y[16]=o,y[17]=c,y[18]=m):m=y[18],y[19]!==m||y[20]!==a?(p=(0,t.jsxs)(g.Menu,{align:"start",asChild:!0,className:"z-[60]!",trigger:a,children:[l,m]}),y[19]=m,y[20]=a,y[21]=p):p=y[21],y[22]===Symbol.for("react.memo_cache_sentinel")?(h=(0,t.jsx)(k.Separator,{classname:"h-5! "}),y[22]=h):h=y[22],y[23]!==p?(x=(0,t.jsxs)("div",{className:"flex gap-1",children:[p,h]}),y[23]=p,y[24]=x):x=y[24],x},L=e=>{let n,i,a,l,o,s,c,u=(0,r.c)(15),m=e.accounts.find(A)?.value??e.accounts[0]?.value;u[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)(N.ArrowDownTiny,{}),u[0]=n):n=u[0],u[1]!==e.disabled?(i=(0,t.jsx)(d.ButtonPrimary,{compact:!0,disabled:e.disabled,"aria-label":"Choose how to subscribe",className:"rounded-l-none! border-l-accent-2! py-0! h-full! hover:outline-transparent! focus:outline-transparent! active:outline-transparent! px-0.5!",children:n}),u[1]=e.disabled,u[2]=i):i=u[2],u[3]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("div",{className:"text-tertiary text-sm px-1 pt-0.5 ",children:"Subscribe withâ¦"}),u[3]=a):a=u[3];let p=m??"";return u[4]!==e.accounts?(l=e.accounts.map(T),u[4]=e.accounts,u[5]=l):l=u[5],u[6]!==p||u[7]!==l?(o=(0,t.jsx)(g.RadioMenuGroup,{value:p,children:l}),u[6]=p,u[7]=l,u[8]=o):o=u[8],u[9]!==e.publicationUrl?(s=e.publicationUrl&&(0,t.jsx)(g.MenuItem,{className:"py-0.5! font-normal!",onSelect:()=>window.open(`${e.publicationUrl}/rss`,"_blank","noopener,noreferrer"),children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)(x.RSSTiny,{className:"shrink-0 text-tertiary"})," RSS Feed"]})}),u[9]=e.publicationUrl,u[10]=s):s=u[10],u[11]!==i||u[12]!==o||u[13]!==s?(c=(0,t.jsxs)(g.Menu,{align:"end",asChild:!0,className:"text-sm",trigger:i,children:[a,o,s]}),u[11]=i,u[12]=o,u[13]=s,u[14]=c):c=u[14],c};function A(e){return e.selected}function T(e){return(0,t.jsx)(g.RadioMenuItem,{className:"py-0.5! font-normal!",value:e.value,selected:e.selected,onSelect:()=>e.onSelect(),children:(0,t.jsxs)("span",{className:"flex items-center gap-2 min-w-0",children:[e.icon,(0,t.jsx)("span",{className:"truncate",children:e.label})]})},e.value)}},277009,e=>{"use strict";e.s(["AtSubscribeSuccess",()=>B,"EmailSubscribeSuccess",()=>$],277009);var t=e.i(843476),r=e.i(500932),n=e.i(271645),i=e.i(283599),a=e.i(522016),l=e.i(620196),o=e.i(899169),s=e.i(66016),c=e.i(250209),u=e.i(124670),d=e.i(806398),m=e.i(857592),p=e.i(69278),h=e.i(634622),f=e.i(788613),b=e.i(794853),g=e.i(864460),x=e.i(687258),y=e.i(327630),v=e.i(909920),C=e.i(819772),w=e.i(279490),j=e.i(72545),S=e.i(793610),k=e.i(838854),N=e.i(410275),_=e.i(475307),P=e.i(509387),R=e.i(580357),U=e.i(104493),M=e.i(755223),E=e.i(815255);function L(e){let n,i,a,l,o,s,c,u,m=(0,r.c)(31),{identity:p}=(0,d.useIdentityData)();m[0]!==e.onPosted?(n={onPosted:e.onPosted},m[0]=e.onPosted,m[1]=n):n=m[1];let{editorStateRef:h,charCount:f,setCharCount:b,posting:g,post:x}=(0,_.useBskyPostSubmit)(n),y=e.publication.record.url,v=(0,P.usePrefetchedScreenshot)(y,!0);m[2]!==x||m[3]!==e.publication.uri||m[4]!==v.promiseRef||m[5]!==y?(i=()=>x(async(t,r)=>(0,R.publishPublicationShareToBsky)({text:t,facets:r,url:y,publicationUri:e.publication.uri,prefetchedThumb:await v.promiseRef.current??void 0,langs:(0,E.viewerPostLangs)()})),m[2]=x,m[3]=e.publication.uri,m[4]=v.promiseRef,m[5]=y,m[6]=i):i=m[6];let C=i;m[7]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("h3",{className:"text-primary text-center",children:"Share on Bluesky"}),m[7]=a):a=m[7];let w=p?.bsky_profiles?.record.avatar,j=p?.bsky_profiles?.record.displayName,S=p?.bsky_profiles?.record.handle;m[8]!==w||m[9]!==j||m[10]!==S?(l={avatar:w,displayName:j,handle:S},m[8]=w,m[9]=j,m[10]=S,m[11]=l):l=m[11];let k=v.previewSrc??void 0,N=!v.previewSrc;return m[12]!==e.publication.record.description||m[13]!==e.publication.record.name||m[14]!==k||m[15]!==N||m[16]!==y?(o=(0,M.bskyPostEmbed)({url:y,title:e.publication.record.name,description:e.publication.record.description,thumb:k,thumbPending:N,pubOwnerDid:void 0}),m[12]=e.publication.record.description,m[13]=e.publication.record.name,m[14]=k,m[15]=N,m[16]=y,m[17]=o):o=m[17],m[18]!==f||m[19]!==h||m[20]!==b||m[21]!==l||m[22]!==o?(s=(0,t.jsx)(_.LazyBlueskyPostComposer,{profile:l,editorStateRef:h,charCount:f,onCharCountChange:b,embed:o}),m[18]=f,m[19]=h,m[20]=b,m[21]=l,m[22]=o,m[23]=s):s=m[23],m[24]!==f||m[25]!==g||m[26]!==C?(c=(0,t.jsx)(_.BskyPostSubmitButton,{posting:g,charCount:f,onClick:C}),m[24]=f,m[25]=g,m[26]=C,m[27]=c):c=m[27],m[28]!==s||m[29]!==c?(u=(0,t.jsxs)("div",{className:"flex flex-col gap-3 w-full max-w-full sm:w-lg text-left",children:[a,s,c]}),m[28]=s,m[29]=c,m[30]=u):u=m[30],u}function A(e){let i,a,l,o,s,c,u,d,m,b,x=(0,r.c)(30),y=(0,S.useToaster)();x[0]===Symbol.for("react.memo_cache_sentinel")?(i=[],x[0]=i):i=x[0];
30let[v,C]=(0,n.useState)(i),[w,_]=(0,n.useState)(!1),P=e.publicationName??"this publication";x[1]===Symbol.for("react.memo_cache_sentinel")?(a=e=>C(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),x[1]=a):a=x[1];let R=a;x[2]!==P||x[3]!==e||x[4]!==w||x[5]!==v||x[6]!==y?(l=async()=>{let t=e.publications.filter(e=>v.includes(e.uri));if(!t.length||w)return;_(!0);let r=[],n=null;for(let i of t){let t=await (0,U.addPublicationRecommendation)({publicationUri:i.uri,recommendation:e.publicationUri});if(!t.ok){n=n??t.error;continue}r.push(i),(0,j.mutate)(["publication_recommendations",i.uri],t.value.recommendations,{revalidate:!1})}if(_(!1),r.length&&y({type:"success",content:1===r.length?`${r[0].name} now recommends ${P}!`:`${r.length} of your publications now recommend ${P}!`}),n){let e=r.map(T);C(t=>t.filter(t=>!e.includes(t))),y({type:"error",content:(0,N.actionErrorContent)(n,"Hmm⦠Something went wrong. Try again!")});return}e.onRecommended()},x[2]=P,x[3]=e,x[4]=w,x[5]=v,x[6]=y,x[7]=l):l=x[7];let M=l;if(x[8]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)("h3",{className:"text-primary",children:"Recommend this Publication"}),x[8]=o):o=x[8],x[9]!==P?(s=(0,t.jsxs)("div",{className:"text-center",children:[o,(0,t.jsxs)("p",{className:"text-secondary text-sm",children:["Pick which of your publications should recommend ",P,". Recommendations are shown to readers after they subscribe."]})]}),x[9]=P,x[10]=s):s=x[10],x[11]!==e.publicationUri||x[12]!==e.publications||x[13]!==v){let r;x[15]!==e.publicationUri||x[16]!==v?(r=r=>{let n=r.recommendations.includes(e.publicationUri)?"Already recommends this publication":null,i=v.includes(r.uri);return(0,t.jsxs)("button",{type:"button",role:"checkbox","aria-checked":i,disabled:!!n,onClick:()=>R(r.uri),className:`flex items-start gap-2 p-2 text-left rounded-md block-border hover:outline-border! 31 ${i?"bg-[var(--accent-light)]":"border-border-light"} 32 ${n?"opacity-60 cursor-not-allowed":"hover:border-accent-contrast"}`,children:[(0,t.jsx)(h.PubIcon,{icon:r.icon??void 0,pubName:r.name}),(0,t.jsxs)("div",{className:"flex flex-col grow min-w-0 leading-tight",children:[(0,t.jsx)("span",{className:"font-bold text-primary truncate pt-0.5",children:r.name}),n&&(0,t.jsx)("span",{className:"text-xs text-tertiary",children:n})]}),i&&(0,t.jsx)(g.CheckTiny,{className:"text-accent-contrast shrink-0 mt-1 mr-1 "})]},r.uri)},x[15]=e.publicationUri,x[16]=v,x[17]=r):r=x[17],c=e.publications.map(r),x[11]=e.publicationUri,x[12]=e.publications,x[13]=v,x[14]=c}else c=x[14];x[18]!==c?(u=(0,t.jsx)("div",{className:"flex flex-col gap-2",role:"group",children:c}),x[18]=c,x[19]=u):u=x[19];let E=!v.length||w;return x[20]!==w?(d=w?(0,t.jsx)(f.DotLoader,{}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(k.RecommendEmptyTiny,{})," Recommend"]}),x[20]=w,x[21]=d):d=x[21],x[22]!==M||x[23]!==E||x[24]!==d?(m=(0,t.jsx)(p.ButtonPrimary,{className:"place-self-end",onClick:M,disabled:E,children:d}),x[22]=M,x[23]=E,x[24]=d,x[25]=m):m=x[25],x[26]!==s||x[27]!==u||x[28]!==m?(b=(0,t.jsxs)("div",{className:"flex flex-col gap-3 w-full max-w-full text-left p-2 sm:w-xl",children:[s,u,m]}),x[26]=s,x[27]=u,x[28]=m,x[29]=b):b=x[29],b}function T(e){return e.uri}function I(e){let a,l,o,s,c,u,h,g,x,y,v,j,S,k=(0,r.c)(42),{loading:N,publication:_,listings:P}=(0,w.useSubscribeSuccessData)(e.publicationUri),{identity:R}=(0,d.useIdentityData)(),[U,M]=(0,n.useState)(null);k[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>M(null),k[0]=a):a=k[0];let E=a;(0,m.useModalBack)(U?E:null);let T=R?.atp_did??null;k[1]!==T?(l=T?["viewer-owned-publications",T]:null,k[1]=T,k[2]=l):l=k[2],k[3]===Symbol.for("react.memo_cache_sentinel")?(o={revalidateOnFocus:!1},k[3]=o):o=k[3];let{data:I,mutate:B}=(0,i.default)(l,O,o);if(k[4]!==I?(s=I??[],k[4]=I,k[5]=s):s=k[5],k[6]!==e.publicationUri||k[7]!==s){let t;k[9]!==e.publicationUri?(t=t=>t.uri!==e.publicationUri,k[9]=e.publicationUri,k[10]=t):t=k[10],c=s.filter(t),k[6]=e.publicationUri,k[7]=s,k[8]=c}else c=k[8];let $=c;if(N){let e;return k[11]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("div",{className:"flex justify-center items-center py-8 text-secondary w-full max-w-full sm:min-w-md",children:(0,t.jsx)(f.DotLoader,{})}),k[11]=e):e=k[11],e}if("share"===U&&_){let e;return k[12]!==_?(e=(0,t.jsx)(L,{publication:_,onPosted:E}),k[12]=_,k[13]=e):e=k[13],e}if("recommend"===U&&_){let e,r;return k[14]!==B?(e=()=>{B(),E()},k[14]=B,k[15]=e):e=k[15],k[16]!==$||k[17]!==_.record.name||k[18]!==_.uri||k[19]!==e?(r=(0,t.jsx)(A,{publicationUri:_.uri,publicationName:_.record.name,publications:$,onRecommended:e}),k[16]=$,k[17]=_.record.name,k[18]=_.uri,k[19]=e,k[20]=r):r=k[20],r}let F=!!T&&!!_,H=F&&$.length>0;
32k[21]!==_?(u=_&&(0,t.jsx)(D,{publication:_}),k[21]=_,k[22]=u):u=k[22],k[23]===Symbol.for("react.memo_cache_sentinel")?(h=(0,t.jsx)("h3",{className:"text-primary",children:"You're Subscribed!"}),k[23]=h):h=k[23],k[24]!==e.children?(g=(0,t.jsxs)("div",{className:"flex flex-col w-full",children:[h,e.children]}),k[24]=e.children,k[25]=g):g=k[25],k[26]!==F?(x=F&&(0,t.jsxs)(p.ButtonPrimary,{onClick:()=>M("share"),children:[(0,t.jsx)(b.ShareTiny,{})," Share"]}),k[26]=F,k[27]=x):x=k[27],k[28]!==u||k[29]!==g||k[30]!==x?(y=(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 w-full pt-2",children:[u,g,x]}),k[28]=u,k[29]=g,k[30]=x,k[31]=y):y=k[31];let W=_?.record.name;return k[32]!==P||k[33]!==e.publicationUri||k[34]!==W?(v=(0,t.jsx)(C.RecommendedPublications,{publicationName:W,recommendingPublicationUri:e.publicationUri,listings:P}),k[32]=P,k[33]=e.publicationUri,k[34]=W,k[35]=v):v=k[35],k[36]!==H?(j=H&&(0,t.jsxs)("div",{className:"text-tertiary text-sm pt-3",children:["If your readers would enjoy this publication, consider"," ",(0,t.jsx)("button",{type:"button",className:"text-accent-contrast hover:underline",onClick:()=>M("recommend"),children:"recommending it"}),"!"]}),k[36]=H,k[37]=j):j=k[37],k[38]!==v||k[39]!==j||k[40]!==y?(S=(0,t.jsxs)("div",{className:"flex flex-col justify-center text-center text-secondary w-full sm:w-xl pb-2",children:[y,v,j]}),k[38]=v,k[39]=j,k[40]=y,k[41]=S):S=k[41],S}function O(){return(0,x.getViewerOwnedPublications)()}let D=e=>{let n,i,a,o,s=(0,r.c)(9),c=e.publication.record;s[0]!==e.publication.uri||s[1]!==c.icon?(n=c.icon?(0,u.blobRefToSrc)(c.icon.ref,new l.AtUri(e.publication.uri).host):void 0,s[0]=e.publication.uri,s[1]=c.icon,s[2]=n):n=s[2];let d=n;return s[3]!==d||s[4]!==c.name?(i=(0,t.jsx)(h.PubIcon,{icon:d,pubName:c.name,xl:!0}),s[3]=d,s[4]=c.name,s[5]=i):i=s[5],s[6]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("div",{className:"absolute -bottom-1 -right-1 rounded-full p-1.5 bg-accent-1 text-accent-2 border-2 border-bg-page",children:(0,t.jsx)(g.CheckTiny,{})}),s[6]=a):a=s[6],s[7]!==i?(o=(0,t.jsxs)("div",{className:"relative w-fit",children:[i,a]}),s[7]=i,s[8]=o):o=s[8],o},B=e=>{let n,i,l,o,u,d,m,p,h,f=(0,r.c)(13),{data:b}=(0,s.useStandardSitePublication)(e.publicationUri),g=b?`${(0,c.getPublicationURL)(b)}/rss`:null;return f[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("br",{}),i=(0,t.jsx)(a.default,{className:"font-bold",href:"https://leaflet.pub/reader",children:"Leaflet Reader"}),l=(0,t.jsx)("span",{className:"text-tertiary text-sm",children:"or any standard.site enabled reader!"}),o=(0,t.jsx)("hr",{className:"my-4 border-border-light"}),f[0]=n,f[1]=i,f[2]=l,f[3]=o):(n=f[0],i=f[1],l=f[2],o=f[3]),f[4]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)("h4",{children:"Other ways to follow"}),f[4]=u):u=f[4],f[5]!==g?(d=g&&(0,t.jsx)("a",{href:g,target:"_blank",rel:"noopener noreferrer",children:"Get the RSS Feed"}),f[5]=g,f[6]=d):d=f[6],f[7]===Symbol.for("react.memo_cache_sentinel")?(m=(0,t.jsx)("a",{href:v.BLUESKY_SUBSCRIBED_FEED_U
32RL,target:"_blank",rel:"noopener noreferrer",children:"Pin Custom Feed in Bluesky"}),f[7]=m):m=f[7],f[8]!==d?(p=(0,t.jsxs)("div",{className:"flex flex-col",children:[u,d,m]}),f[8]=d,f[9]=p):p=f[9],f[10]!==e.publicationUri||f[11]!==p?(h=(0,t.jsxs)(I,{publicationUri:e.publicationUri,children:["You'll receive new posts in the ",n,i,l,o,p]}),f[10]=e.publicationUri,f[11]=p,f[12]=h):h=f[12],h},$=e=>{let n,i,a,l,s=(0,r.c)(9),c=e.email?e.email:"your email";return s[0]!==c?(n=(0,t.jsxs)("div",{children:["You'll receive new posts to"," ",(0,t.jsx)("em",{children:c})]}),s[0]=c,s[1]=n):n=s[1],s[2]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsxs)("div",{children:["and in the"," ",(0,t.jsx)(o.SpeedyLink,{href:"https://leaflet.pub/reader",children:"Leaflet Reader"})]}),s[2]=i):i=s[2],s[3]!==e.handle?(a=!e.handle&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("hr",{className:"my-4 border-border-light"}),(0,t.jsx)("div",{className:"accent-container p-3",children:(0,t.jsx)(y.LinkHandle,{compact:!0})})]}),s[3]=e.handle,s[4]=a):a=s[4],s[5]!==e.publicationUri||s[6]!==n||s[7]!==a?(l=(0,t.jsxs)(I,{publicationUri:e.publicationUri,children:[n,i,a]}),s[5]=e.publicationUri,s[6]=n,s[7]=a,s[8]=l):l=s[8],l}},909920,e=>{"use strict";
32e.s(["BLUESKY_SUBSCRIBED_FEED_URL",0,"https://bsky.app/profile/leaflet.pub/feed/subscribedPublications"])},937929,e=>{"use strict";e.s(["SUBSCRIBE_ERROR_MESSAGES",0,{invalid_email:"Please enter a valid email address.",newsletter_disabled:"This publication isn't accepting email subscriptions.",email_send_failed:"We couldn't send the confirmation email. Try again.",subscriber_not_found:"No pending subscription. Start over.",invalid_code:"That code didn't match. Try again.",database_error:"Something went wrong. Try again.",suppressed_spam_complaint:"This address was previously marked as spam and can't be resubscribed. Contact the publication to resolve.",suppression_delete_failed:"We couldn't clear a prior delivery issue on this address. Try again later.",link_invalid_state:"Couldn't link this email to your account. Try logging out and subscribing again.",email_belongs_to_other_account:"This email is already linked to a different Bluesky account. Log out to use that account instead."}])},279490,e=>{"use strict";var t=e.i(500932),r=e.i(283599),n=e.i(935593),i=e.i(95187);let a=(0,i.createServerReference)("407b8abd61967d3d6a61302a903397843623b28d1b",i.callServer,void 0,i.findSourceMapURL,"getPublicationsByUris");var l=e.i(66016);function o(e){let r,n=(0,t.c)(4),{data:i,isLoading:a}=(0,l.useStandardSitePublication)(e),{loading:o,listings:c}=s(e),u=a||o,d=i??void 0;return n[0]!==c||n[1]!==u||n[2]!==d?(r={loading:u,publication:d,listings:c},n[0]=c,n[1]=u,n[2]=d,n[3]=r):r=n[3],r}function s(e){let i,l,o,s,c,u,d,m,p=(0,t.c)(15);p[0]!==e?(i=e?["publication_recommendations",e]:null,p[0]=e,p[1]=i):i=p[1],p[2]!==e?(l=async()=>(await (0,n.callRPC)("get_publication_recommendations",{publication:e})).result.recommendations,p[2]=e,p[3]=l):l=p[3],p[4]===Symbol.for("react.memo_cache_sentinel")?(o={revalidateOnFocus:!1},p[4]=o):o=p[4];let{data:h,isLoading:f}=(0,r.default)(i,l,o);p[5]!==h?(s=h?.length?["recommended_pub_listings",h.join(",")]:null,p[5]=h,p[6]=s):s=p[6],p[7]!==h?(c=async()=>{let e=await a(h);return h.flatMap(t=>e.find(e=>e.uri===t)??[])},p[7]=h,p[8]=c):c=p[8],p[9]===Symbol.for("react.memo_cache_sentinel")?(u={revalidateOnFocus:!1},p[9]=u):u=p[9];let{data:b,isLoading:g}=(0,r.default)(s,c,u),x=f||g;return p[10]!==b?(d=b??[],p[10]=b,p[11]=d):d=p[11],p[12]!==x||p[13]!==d?(m={loading:x,listings:d},p[12]=x,p[13]=d,p[14]=m):m=p[14],m}e.s(["SubscribeSuccessPrefetch",0,function(e){return o(e.publicationUri),null},"usePublicationRecommendationListings",0,s,"useSubscribeSuccessData",0,o],279490)},545850,e=>{"use strict";var t=e.i(500932),r=e.i(806398),n=e.i(192506);function i(e,t,r){let n=e.publication_email_subscribers??=[],i=n.filter(e=>e.publication===t);if(0===i.length){"confirmed"===r&&n.push({publication:t,state:r});return}for(let e of i)e.state=r}function a(e,t){let r=e.publication_subscriptions??=[];if(r.some(e=>e.publication===t))return;let n={publication:t,identity:e.atp_did??"",uri:"",record:{},created_at:new Date().toISOString()};r.push(n)}e.s(["markLocalEmailEnabled",0,function(e,t){(0,r.updateIdentityData)(r=>i(r,e,t?"confirmed":"unsubscribed"))},"markLocallySubscribed",0,function(e,t){(0,r.updateIdentityData)(r=>{"email"===t?(i(r,e,"confirmed"),r.atp_did&&a(r,e)):a(r,e)})},"markLocallyUnsubscribed",0,function(e){(0,r.updateIdentityData)(t=>{let r=t.publication_subscriptions??[];for(let t=r.length-1;t>=0;t--)r[t].publication===e&&r.splice(t,1);for(let r of(i(t,e,"unsubscribed"),t.publication_memberships??[]))r.publication===e&&(r.status="canceled")})},"useViewerSubscription",0,function(e){let i,a,l=(0,t.c)(10),{identity:o}=(0,r.useIdentityData)(),s=o?.publication_subscriptions,c=o?.publication_email_subscribers,u=o?.publication_memberships;if(l[0]!==e||l[1]!==s||l[2]!==c||l[3]!==u){var d;let t,r,a,o;t=((d={subscriptions:s,emailSubscribers:c,memberships:u}).subscriptions??[]).some(t=>t.publication===e),r=(d.emailSubscribers??[]).some(t=>t.publication===e&&"confirmed"===t.state),a=(d.memberships??[]).find(t=>t.publication===e&&(0,n.isActiveMembership)(t))??null,i={subscribed:o=t||r||!!a,atprotoSubscribed:t,emailEnabled:r,membership:(0,n.resolvePublicationMembership)({isSubscriber:o,paidMembership:a})},l[0]=e,l[1]=s,l[2]=c,l[3]=u,l[4]=i}else i=l[4];let m=i,p=!!o,h=o?.email??void 0,f=o?.bsky_profiles?.handle??void 0;return l[5]!==m||l[6]!==p||l[7]!==h||l[8]!==f?(a={loggedIn:p,email:h,handle:f,...m},l[5]=m,l[6]=p,l[7]=h,l[8]=f,l[9]=a):a=l[9],a}],545850)},103136,e=>{"use strict";var t=e.i(843476),r=e.i(500932),n=e.i(885718);let i=e=>{let i,a,l,o,s,c=(0,r.c)(16),u=`toggle flex gap-2 text-left ${e.fullWidth?"
32justify-between flex-row-reverse":"items-start justify-start "}`;c[0]!==e?(i=()=>{e.onToggle()},c[0]=e,c[1]=i):i=c[1];let d=e.toggle?"1px solid "+n.theme.colors["accent-2"]:"1px solid "+e.disabledColor2,m=e.toggle?"flex-end":"flex-start",p=e.toggle?n.theme.colors["accent-1"]:e.disabledColor1||n.theme.colors.tertiary;c[2]!==d||c[3]!==m||c[4]!==p?(a={border:d,justifyContent:m,background:p},c[2]=d,c[3]=m,c[4]=p,c[5]=a):a=c[5];let h=e.toggle?n.theme.colors["accent-2"]:e.disabledColor2||n.theme.colors["border-light"];return c[6]!==h?(l=(0,t.jsx)("div",{className:"h-[14px] w-[10px] m-0.5 rounded-[2px]",style:{background:h}}),c[6]=h,c[7]=l):l=c[7],c[8]!==a||c[9]!==l?(o=(0,t.jsx)("div",{className:"h-6 flex place-items-center",children:(0,t.jsx)("div",{className:"selected-outline transparent-outline flex items-center h-[20px] w-6 rounded-md border-border",style:a,children:l})}),c[8]=a,c[9]=l,c[10]=o):o=c[10],c[11]!==e.children||c[12]!==u||c[13]!==i||c[14]!==o?(s=(0,t.jsxs)("button",{type:"button",className:u,onClick:i,children:[o,e.children]}),c[11]=e.children,c[12]=u,c[13]=i,c[14]=o,c[15]=s):s=c[15],s};e.s(["Toggle",0,i,"ToggleWithLabel",0,e=>{let n,a,l,o,s=(0,r.c)(14),c=`font-bold leading-snug ${e.toggle?"":"text-tertiary"}`;return s[0]!==e.label||s[1]!==c?(n=(0,t.jsx)("div",{className:c,children:e.label}),s[0]=e.label,s[1]=c,s[2]=n):n=s[2],s[3]!==e.helpText?(a=e.helpText&&(0,t.jsx)("div",{className:"text-sm text-tertiary leading-snug",children:e.helpText}),s[3]=e.helpText,s[4]=a):a=s[4],s[5]!==n||s[6]!==a?(l=(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[n,a]}),s[5]=n,s[6]=a,s[7]=l):l=s[7],s[8]!==e.disabledColor1||s[9]!==e.disabledColor2||s[10]!==e.onToggle||s[11]!==e.toggle||s[12]!==l?(o=(0,t.jsx)(i,{fullWidth:!0,toggle:e.toggle,onToggle:e.onToggle,disabledColor1:e.disabledColor1,disabledColor2:e.disabledColor2,children:l}),s[8]=e.disabledColor1,s[9]=e.disabledColor2,s[10]=e.onToggle,s[11]=e.toggle,s[12]=l,s[13]=o):o=s[13],o}])},268046,e=>{"use strict";var t=e.i(843476),r=e.i(500932),n=e.i(186336),i=e.i(979944),a=e.i(885718),l=e.i(970827);e.s(["Tooltip",0,e=>{let o,s,c,u,d,m=(0,r.c)(18),p=e.delayDuration??600,h=e.skipDelayDuration??300;m[0]!==e.asChild||m[1]!==e.disabled||m[2]!==e.trigger?(o=(0,t.jsx)(n.Trigger,{disabled:e.disabled,asChild:e.asChild,children:e.trigger}),m[0]=e.asChild,m[1]=e.disabled,m[2]=e.trigger,m[3]=o):o=m[3];let f=` 33 portalStyles 34 z-20 bg-bg-page 35 px-3 py-2 36 max-w-(--radix-popover-content-available-width) 37 max-h-(--radix-popover-content-available-height) 38 light-container 39 border border-border rounded-md shadow-md 40 overflow-y-scroll no-scrollbar 41 ${e.className} 42 `,b=e.align?e.align:"center";return m[4]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(n.Arrow,{asChild:!0,width:16,height:8,viewBox:"0 0 16 8",children:(0,t.jsx)(i.PopoverArrow,{arrowFill:a.theme.colors.border,arrowStroke:"transparent"})}),m[4]=s):s=m[4],m[5]!==e.children||m[6]!==e.side||m[7]!==f||m[8]!==b?(c=(0,t.jsx)(n.Portal,{children:(0,t.jsx)(l.NestedCardThemeProvider,{children:(0,t.jsxs)(n.Content,{className:f,side:e.side,align:b,sideOffset:4,collisionPadding:16,children:[e.children,s]})})}),m[5]=e.children,m[6]=e.side,m[7]=f,m[8]=b,m[9]=c):c=m[9],m[10]!==e.onOpenChange||m[11]!==o||m[12]!==c?(u=(0,t.jsxs)(n.Root,{onOpenChange:e.onOpenChange,children:[o,c]}),m[10]=e.onOpenChange,m[11]=o,m[12]=c,m[13]=u):u=m[13],m[14]!==p||m[15]!==h||m[16]!==u?(d=(0,t.jsx)(n.Provider,{delayDuration:p,skipDelayDuration:h,children:u}),m[14]=p,m[15]=h,m[16]=u,m[17]=d):d=m[17],d}])},470152,e=>{"use strict";e.s(["clamp",0,function(e,[t,r]){return Math.min(r,Math.max(t,e))}])},573687,e=>{"use strict";var t=e.i(142598),r=e.i(820783),n=e.i(369340),i=e.i(981140),a=e.i(252514),l=e.i(423540),o=e.i(92330),s=e.i(271645),c=e.i(174080),u=e.i(461901),d=e.i(95702),m=e.i(470152),p=e.i(683986),h=e.i(843476),f={numeric:{type:"numeric",regexp:/[^\d]/g,pattern:"\\d{1}",inputMode:"numeric"},alpha:{type:"alpha",regexp:/[^a-zA-Z]/g,pattern:"[a-zA-Z]{1}",inputMode:"text"},alphanumeric:{type:"alphanumeric",regexp:/[^a-zA-Z0-9]/g,pattern:"[a-zA-Z0-9]{1}",inputMode:"text"},none:null},b="OneTimePasswordField",[g,{useCollection:x,createCollectionScope:y,useInitCollection:v}]=(0,a.unstable_createCollection)(b),[C]=(0,u.createContextScope)(b,[y,l.createRovingFocusGroupScope]),w=(0,l.createRovingFocusGroupScope)(),[j,S]=C(b),k=s.forwardRef(function({__scopeOneTimePasswordField:e,defaultValue:a,value:u,onValueChange:m,autoSubmit:b=!1,children:x,onPaste:y,onAutoSubmit:C,disabled:S=!1,readOnly:k=!1,autoComplete:N="one-time-code",autoFocus:_=!1,form:U,name:M,placeholder:E,type:L="text",orientation:A="horizontal",dir:T,validationType:I="numeric",sanitizeV
42alue:O,...D},B){let $=w(e),F=(0,d.useDirection)(T),H=v(),[W]=H,z=f[I]?f[I]:null,G=s.useCallback(e=>{if(e=Array.isArray(e)?e.map(P).join(""):P(e),z){let t=new RegExp(z.regexp);e=e.replace(t,"")}else O&&(e=O(e));return e.split("")},[z,O]),Z=s.useMemo(()=>null!=u?G(u):void 0,[u,G]),[V,q]=(0,n.useControllableState)({caller:"OneTimePasswordField",prop:Z,defaultProp:null!=a?G(a):[],onChange:s.useCallback(e=>m?.(e.join("")),[m])}),Y=(0,p.useEffectEvent)(e=>{switch(e.type){case"SET_CHAR":{let{index:t,char:r}=e,n=W.at(t)?.element;if(V[t]===r)return void R(n&&W.from(n,1)?.element);if(""===r)return;if(z){let e=new RegExp(z.regexp);if(r.replace(e,"")!==r)return}if(V.length>=W.size){let e=[...V];e[t]=r,(0,c.flushSync)(()=>q(e)),R(n&&W.from(n,1)?.element);return}let i=[...V];i[t]=r;let a=W.at(-1)?.element;(0,c.flushSync)(()=>q(i)),n!==a?R(n&&W.from(n,1)?.element):n?.select();return}case"CLEAR_CHAR":{let{index:t,reason:r}=e;if(!V[t])return;let n=V.filter((e,r)=>r!==t),i=W.at(t)?.element,a=i&&W.from(i,-1)?.element;(0,c.flushSync)(()=>q(n)),"Backspace"===r?R(a):("Delete"===r||"Cut"===r)&&R(i);return}case"CLEAR":if(0===V.length)return;"Backspace"===e.reason||"Delete"===e.reason?((0,c.flushSync)(()=>q([])),R(W.at(0)?.element)):q([]);return;case"PASTE":{let{value:t}=e,r=G(t);if(!r)return;(0,c.flushSync)(()=>q(r)),R(W.at(r.length-1)?.element);return}}}),K=s.useRef(z);s.useEffect(()=>{z&&K.current?.type!==z.type&&(K.current=z,q(G(V.join(""))))},[G,q,z,V]);let J=s.useRef(null),X=s.useRef(null),Q=s.useRef(null),ee=(0,r.useComposedRefs)(B,Q),et=W.at(0)?.element,er=s.useCallback(()=>{let e;if(U){var t;let r=(Q.current?.ownerDocument??document).getElementById(U);t=r,t?.tagName==="FORM"&&(e=r)}else J.current?e=J.current.form:et&&(e=et.form);return e??null},[U,et]),en=s.useCallback(()=>{let e=er();e?.requestSubmit()},[er]);s.useEffect(()=>{let e=er();if(e){let t=()=>Y({type:"CLEAR",reason:"Reset"});return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[Y,er]);let ei=V.join(""),ea=s.useRef(ei),el=W.size;s.useEffect(()=>{let e=ea.current;ea.current=ei,e!==ei&&b&&V.every(e=>""!==e)&&V.length===el&&(C?.(V.join("")),en())},[en,b,ei,el,C,V]);let eo=(0,o.useIsHydrated)();return(0,h.jsx)(j,{scope:e,value:V,attemptSubmit:en,disabled:S,readOnly:k,autoComplete:N,autoFocus:_,form:U,name:M,placeholder:E,type:L,hiddenInputRef:J,userActionRef:X,dispatch:Y,validationType:I,orientation:A,isHydrated:eo,sanitizeValue:G,children:(0,h.jsx)(g.Provider,{scope:e,state:H,children:(0,h.jsx)(g.Slot,{scope:e,children:(0,h.jsx)(l.Root,{asChild:!0,...$,orientation:A,dir:F,children:(0,h.jsx)(t.Root.div,{...D,role:"group",ref:ee,onPaste:(0,i.composeEventHandlers)(y,e=>{e.preventDefault(),Y({type:"PASTE",value:e.clipboardData.getData("Text")})}),children:x})})})})})}),N=s.forwardRef(function({__scopeOneTimePasswordField:e,...t},n){let{value:i,hiddenInputRef:a,name:l}=S("OneTimePasswordFieldHiddenInput",e),o=(0,r.useComposedRefs)(a,n);return(0,h.jsx)("input",{ref:o,name:l,value:i.join("").trim(),autoComplete:"off",autoFocus:!1,autoCapitalize:"off",autoCorrect:"off",autoSave:"off",spellCheck:!1,...t,type:"hidden",readOnly:!0})}),_=s.forwardRef(function({__scopeOneTimePasswordField:e,onInvalidChange:n,index:a,...o},c){let u,{value:d,defaultValue:p,disabled:b,readOnly:y,autoComplete:v,autoFocus:C,form:j,name:k,placeholder:N,type:_,...P}=o,U=S("OneTimePasswordFieldInput",e),{dispatch:M,userActionRef:E,validationType:L,isHydrated:A,disabled:T}=U,I=x(e),O=w(e),D=s.useRef(null),[B,$]=s.useState(null),F=a??(B?I.indexOf(B):-1);(null!=a||A)&&U.placeholder&&0===U.value.length&&(u=U.placeholder[F]);let H=(0,r.useComposedRefs)(c,D,$),W=U.value[F]??"",z=s.useRef(null);s.useEffect(()=>()=>{z.current&&window.clearTimeout(z.current)},[]);let G=U.value.join("").trim(),Z=(0,m.clamp)(G.length,[0,I.size-1]),V=F<=Z,q=L in f?f[L]:void 0;return(0,h.jsx)(g.ItemSlot,{scope:e,children:(0,h.jsx)(l.Item,{...O,asChild:!0,focusable:!U.disabled&&V,active:F===Z,children:({hasTabStop:e,isCurrentTabStop:r})=>{let a=e?r:0===F;return(0,h.jsx)(t.Root.input,{ref:H,type:U.type,disabled:T,"aria-label":`Character ${F+1} of ${I.size}`,autoComplete:a?U.autoComplete:"off","data-1p-ignore":a?void 0:"true","data-lpignore":a?void 0:"true","data-protonpass-ignore":a?void 0:"true","data-bwignore":a?void 0:"true",inputMode:q?.inputMode,maxLength:a?I.size:1,pattern:q?.pattern,readOnly:U.readOnly,value:W,placeholder:u,"data-radix-otp-input":"","data-radix-index":F,...P,onFocus:(0,i.composeEventHandlers)(o.onFocus,e=>{e.currentTarget.select()}),onCut:(0,i.composeEventHandlers)(o.onCut,e=>{""!==e.currentTarget.value&&(E.current={type:"cut"},z.current=window.setTimeout(()=>{E.current=null},10))}),onInput:(0,i.composeEventHandlers)(o.onInput,e=>{let t=e.currentTarget.value;t.length>1&&(e.preventDefault(),E.current={type:"autocomplete-paste"},M({type:"PASTE",value:t}),z.current=window.setTimeout(()=>{E.current=null},10))}),onChange:(0,i.composeEventHandlers)(o.onChange,e=>{let t=e.target.value;e.preventDefault();let r=E.current;if(E.current=null,r)switch(r.type){case"cut":M({type:"CLEAR_CHAR",index:F,reason:"Cut"});return;case"autocomplete-paste":default:return;case"keydown":{if("Char"===r.key)return;let e="Backspace"===r.key&&(r.metaKey||r.ctrlKey);"Clear"===r.key||e?M({type:"CLEAR",reason:"Backspace"}):M({type:"CLEAR_CHAR",index:F,reason:r.key});return}}if(e.target.validity.valid)if(""===t){let t="Backspace";if("input"===e.nativeEvent.type){let r=e.nativeEvent.inputType;"deleteContentBackward"===r?t="Backspace":"deleteByCut"===r&&(t="Cut")}M({type:"CLEAR_CHAR",index:F,reason:t})}
42else M({type:"SET_CHAR",char:t,index:F,event:e});else{let t=e.target;n?.(t.value),requestAnimationFrame(()=>{t.ownerDocument.activeElement===t&&t.select()})}}),onKeyDown:(0,i.composeEventHandlers)(o.onKeyDown,e=>{switch(e.key){case"Clear":case"Delete":case"Backspace":if(""===e.currentTarget.value){if("Delete"===e.key)return;if("Clear"===e.key||e.metaKey||e.ctrlKey)M({type:"CLEAR",reason:"Backspace"});else{let t=e.currentTarget;requestAnimationFrame(()=>{R(I.from(t,-1)?.element)})}}else E.current={type:"keydown",key:e.key,metaKey:e.metaKey,ctrlKey:e.ctrlKey},z.current=window.setTimeout(()=>{E.current=null},10);return;case"Enter":e.preventDefault(),U.attemptSubmit();return;case"ArrowDown":case"ArrowUp":"horizontal"===U.orientation&&e.preventDefault();return;default:if(e.currentTarget.value===e.key){let t=e.currentTarget;e.preventDefault(),R(I.from(t,1)?.element);return}if(e.currentTarget.value&&!(0===e.currentTarget.selectionStart&&null!=e.currentTarget.selectionEnd&&e.currentTarget.selectionEnd>0)){let t=e.key;if(e.key.length>1||" "===e.key)return;{let r=I.from(e.currentTarget,1)?.element,n=I.at(-1)?.element;r!==n&&e.currentTarget!==n&&(0===e.currentTarget.selectionStart?M({type:"SET_CHAR",char:t,index:F,event:e}):M({type:"SET_CHAR",char:t,index:F+1,event:e}),E.current={type:"keydown",key:"Char",metaKey:e.metaKey,ctrlKey:e.ctrlKey},z.current=window.setTimeout(()=>{E.current=null},10))}}}}),onPointerDown:(0,i.composeEventHandlers)(o.onPointerDown,e=>{e.preventDefault();let t=Math.min(F,Z);R(I.at(t)?.element)})})}})})});function P(e){return e.replace(/\s/g,"")}function R(e){e&&(e.ownerDocument.activeElement===e?window.requestAnimationFrame(()=>{e.select?.()}):e.focus())}e.s(["HiddenInput",0,N,"Input",0,_,"Root",0,k])},142598,461901,252514,95702,423540,92330,e=>{"use strict";var t=e.i(271645);e.i(174080);var r=e.i(820783),n=e.i(843476),i=Symbol.for("react.lazy"),a=t[" use ".trim().toString()];function l(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===i&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}function o(e){var i;let o,s=(i=e,(o=t.forwardRef((e,n)=>{let{children:i,...o}=e;if(l(i)&&"function"==typeof a&&(i=a(i._payload)),t.isValidElement(i)){var s;let e,a,l=(s=i,(a=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(a=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),c=function(e,t){let r={...t};for(let n in t){let i=e[n],a=t[n];/^on[A-Z]/.test(n)?i&&a?r[n]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(r[n]=i):"style"===n?r[n]={...i,...a}:"className"===n&&(r[n]=[i,a].filter(Boolean).join(" "))}return{...e,...r}}(o,i.props);return i.type!==t.Fragment&&(c.ref=n?(0,r.composeRefs)(n,l):l),t.cloneElement(i,c)}return t.Children.count(i)>1?t.Children.only(null):null})).displayName=`${i}.SlotClone`,o),u=t.forwardRef((e,r)=>{let{children:i,...o}=e;l(i)&&"function"==typeof a&&(i=a(i._payload));let u=t.Children.toArray(i),d=u.find(c);if(d){let e=d.props.children,i=u.map(r=>r!==d?r:t.Children.count(e)>1?t.Children.only(null):t.isValidElement(e)?e.props.children:null);return(0,n.jsx)(s,{...o,ref:r,children:t.isValidElement(e)?t.cloneElement(e,void 0,i):null})}return(0,n.jsx)(s,{...o,ref:r,children:i})});return u.displayName=`${e}.Slot`,u}var s=Symbol("radix.slottable");function c(e){return t.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===s}var u=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{let i=o(`Primitive.${r}`),a=t.forwardRef((e,t)=>{let{asChild:a,...l}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,n.jsx)(a?i:r,{...l,ref:t})});return a.displayName=`Primitive.${r}`,{...e,[r]:a}},{});function d(e,r=[]){let i=[],a=()=>{let r=i.map(e=>t.createContext(e));return function(n){let i=n?.[e]||r;return t.useMemo(()=>({[`__scope${e}`]:{...n,[e]:i}}),[n,i])}};return a.scopeName=e,[function(r,a){let l=t.createContext(a);l.displayName=r+"Context";let o=i.length;i=[...i,a];let s=r=>{let{scope:i,children:a,...s}=r,c=i?.[e]?.[o]||l,u=t.useMemo(()=>s,Object.values(s));return(0,n.jsx)(c.Provider,{value:u,children:a})};return s.displayName=r+"Provider",[s,function(n,i){let s=i?.[e]?.[o]||l,c=t.useContext(s);if(c)return c;if(void 0!==a)return a;throw Error(`\`${n}\` must be used within \`${r}\``)}]},function(...e){let r=e[0];if(1===e.length)return r;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let i=n.reduce((t,{useScope:r,scopeName:n})=>{let i=r(e)[`__scope${n}`];return{...t,...i}},{});return t.useMemo(()=>({[`__scope${r.scopeName}`]:i}),[i])}};return n.scopeName=r.scopeName,n}(a,...r)]}function m(e){let i=e+"CollectionProvider",[a,l]=d(i),[s,c]=a(i,{collectionRef:{current:null},itemMap:new Map}),u=e=>{let{scope:r,children:i}=e,a=t.default.useRef(null),l=t.default.useRef(new Map).current;return(0,n.jsx)(s,{scope:r,itemMap:l,collectionRef:a,children:i})};u.displayName=i;let m=e+"CollectionSlot",p=o(m),h=t.default.forwardRef((e,t)=>
42{let{scope:i,children:a}=e,l=c(m,i),o=(0,r.useComposedRefs)(t,l.collectionRef);return(0,n.jsx)(p,{ref:o,children:a})});h.displayName=m;let f=e+"CollectionItemSlot",b="data-radix-collection-item",g=o(f),x=t.default.forwardRef((e,i)=>{let{scope:a,children:l,...o}=e,s=t.default.useRef(null),u=(0,r.useComposedRefs)(i,s),d=c(f,a);return t.default.useEffect(()=>(d.itemMap.set(s,{ref:s,...o}),()=>void d.itemMap.delete(s))),(0,n.jsx)(g,{...{[b]:""},ref:u,children:l})});return x.displayName=f,[{Provider:u,Slot:h,ItemSlot:x},function(r){let n=c(e+"CollectionConsumer",r);return t.default.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${b}]`));return Array.from(n.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[n.collectionRef,n.itemMap])},l]}e.s(["Primitive",0,u,"Root",0,u],142598),e.s(["createContextScope",0,d],461901);var p=new WeakMap,h=class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],p.set(this,!0)}set(e,t){return p.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let n,i=this.has(t),a=this.#e.length,l=b(e),o=l>=0?l:a+l,s=o<0||o>=a?-1:o;if(s===this.size||i&&s===this.size-1||-1===s)return this.set(t,r),this;let c=this.size+ +!i;l<0&&o++;let u=[...this.#e],d=!1;for(let e=o;e<c;e++)if(o===e){let a=u[e];u[e]===t&&(a=u[e+1]),i&&this.delete(t),n=this.get(a),this.set(t,r)}else{d||u[e-1]!==t||(d=!0);let r=u[d?e:e-1],i=n;n=this.get(r),this.delete(r),this.set(r,i)}return this}with(t,r,n){let i=new e(this);return i.insert(t,r,n),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let n=this.#e.indexOf(e);return -1===n?this:this.insert(n,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let n=this.#e.indexOf(e);return -1===n?this:this.insert(n+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=f(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=f(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return f(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.at(n)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.keyAt(n)}find(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return n;r++}}findIndex(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return r;r++}return -1}filter(t,r){let n=[],i=0;for(let e of this)Reflect.apply(t,r,[e,i,this])&&n.push(e),i++;return new e(n)}map(t,r){let n=[],i=0;for(let e of this)n.push([e[0],Reflect.apply(t,r,[e,i,this])]),i++;return new e(n)}reduce(...e){let[t,r]=e,n=0,i=r??this.at(0);for(let r of this)i=0===n&&1===e.length?r:Reflect.apply(t,this,[i,r,n,this]),n++;return i}reduceRight(...e){let[t,r]=e,n=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let i=this.at(r);n=r===this.size-1&&1===e.length?i:Reflect.apply(t,this,[n,i,r,this])}return n}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),n=this.get(r);t.set(r,n)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let n=new e,i=this.size-1;if(void 0===t)return n;t<0&&(t+=this.size),void 0!==r&&r>0&&(i=r-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),r=this.get(t);n.set(t,r)}return n}every(e,t){let r=0;for(let n of this){if(!Reflect.apply(e,t,[n,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return!0;r++}return!1}};function f(e,t){var r,n;let i,a,l;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let o=(r=e,n=t,i=r.length,(l=(a=b(n))>=0?a:i+a)<0||l>=i?-1:l);return -1===o?void 0:e[o]}function b(e){return e!=e||0===e?0:Math.trunc(e)}function g(e,t){var r;return e[1].element&&t[1].element?(r=e[1].element,t[1].element.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_PRECEDING)?-1:1:0}e.s(["createCollection",0,m,"unstable_createCollection",0,function(e){let i=e+"CollectionProvider",[a,l]=d(i),[s,c]=a(i,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new h,setItemMap:()=>void 0}),u=({state:e,...t})=>e?(0,n.jsx)(p,{...t,state:e}):(0,n.jsx)(m,{...t});u.displayName=i;let m=e=>{let t=w();return(0,n.jsx)(p,{...e,state:t})};m.displayName=i+"Init";let p=e=>{let{scope:i,children:a,state:l}=e,o=t.default.useRef(null),[c,u]=t.default.useState(null),d=(0,r.useComposedRefs)(o,u),[m,p]=l;return t.default.useEffect(()=>{var e;if(!c)return;let t=(e=()=>{},new MutationObserver(t=>{for(let r of t)if("childList"===r.type)return void e()}
42));return t.observe(c,{childList:!0,subtree:!0}),()=>{t.disconnect()}},[c]),(0,n.jsx)(s,{scope:i,itemMap:m,setItemMap:p,collectionRef:d,collectionRefObject:o,collectionElement:c,children:a})};p.displayName=i+"Impl";let f=e+"CollectionSlot",b=o(f),x=t.default.forwardRef((e,t)=>{let{scope:i,children:a}=e,l=c(f,i),o=(0,r.useComposedRefs)(t,l.collectionRef);return(0,n.jsx)(b,{ref:o,children:a})});x.displayName=f;let y=e+"CollectionItemSlot",v=o(y),C=t.default.forwardRef((e,i)=>{let{scope:a,children:l,...o}=e,s=t.default.useRef(null),[u,d]=t.default.useState(null),m=(0,r.useComposedRefs)(i,s,d),{setItemMap:p}=c(y,a),f=t.default.useRef(o);!function(e,t){if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null==e||null==t)return!1;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n of r)if(!Object.prototype.hasOwnProperty.call(t,n)||e[n]!==t[n])return!1;return!0}(f.current,o)&&(f.current=o);let b=f.current;return t.default.useEffect(()=>(p(e=>u?e.has(u)?e.set(u,{...b,element:u}).toSorted(g):(e.set(u,{...b,element:u}),e.toSorted(g)):e),()=>{p(e=>u&&e.has(u)?(e.delete(u),new h(e)):e)}),[u,b,p]),(0,n.jsx)(v,{"data-radix-collection-item":"",ref:m,children:l})});function w(){return t.default.useState(new h)}return C.displayName=y,[{Provider:u,Slot:x,ItemSlot:C},{createCollectionScope:l,useCollection:function(t){let{itemMap:r}=c(e+"CollectionConsumer",t);return r},useInitCollection:w}]}],252514);var x=e.i(981140),y=e.i(610772),v=e.i(30207),C=e.i(369340),w=t.createContext(void 0);function j(e){let r=t.useContext(w);return e||r||"ltr"}e.s(["useDirection",0,j],95702);var S="rovingFocusGroup.onEntryFocus",k={bubbles:!1,cancelable:!0},N="RovingFocusGroup",[_,P,R]=m(N),[U,M]=d(N,[R]),[E,L]=U(N),A=t.forwardRef((e,t)=>(0,n.jsx)(_.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,n.jsx)(_.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,n.jsx)(T,{...e,ref:t})})}));A.displayName=N;var T=t.forwardRef((e,i)=>{let{__scopeRovingFocusGroup:a,orientation:l,loop:o=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:m,onEntryFocus:p,preventScrollOnEntryFocus:h=!1,...f}=e,b=t.useRef(null),g=(0,r.useComposedRefs)(i,b),y=j(s),[w,_]=(0,C.useControllableState)({prop:c,defaultProp:d??null,onChange:m,caller:N}),[R,U]=t.useState(!1),M=(0,v.useCallbackRef)(p),L=P(a),A=t.useRef(!1),[T,I]=t.useState(0);return t.useEffect(()=>{let e=b.current;if(e)return e.addEventListener(S,M),()=>e.removeEventListener(S,M)},[M]),(0,n.jsx)(E,{scope:a,orientation:l,dir:y,loop:o,currentTabStopId:w,onItemFocus:t.useCallback(e=>_(e),[_]),onItemShiftTab:t.useCallback(()=>U(!0),[]),onFocusableItemAdd:t.useCallback(()=>I(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>I(e=>e-1),[]),children:(0,n.jsx)(u.div,{tabIndex:R||0===T?-1:0,"data-orientation":l,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:(0,x.composeEventHandlers)(e.onMouseDown,()=>{A.current=!0}),onFocus:(0,x.composeEventHandlers)(e.onFocus,e=>{let t=!A.current;if(e.target===e.currentTarget&&t&&!R){let t=new CustomEvent(S,k);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=L().filter(e=>e.focusable);B([e.find(e=>e.active),e.find(e=>e.id===w),...e].filter(Boolean).map(e=>e.ref.current),h)}}A.current=!1}),onBlur:(0,x.composeEventHandlers)(e.onBlur,()=>U(!1))})})}),I="RovingFocusGroupItem",O=t.forwardRef((e,r)=>{let{__scopeRovingFocusGroup:i,focusable:a=!0,active:l=!1,tabStopId:o,children:s,...c}=e,d=(0,y.useId)(),m=o||d,p=L(I,i),h=p.currentTabStopId===m,f=P(i),{onFocusableItemAdd:b,onFocusableItemRemove:g,currentTabStopId:v}=p;return t.useEffect(()=>{if(a)return b(),()=>g()},[a,b,g]),(0,n.jsx)(_.ItemSlot,{scope:i,id:m,focusable:a,active:l,children:(0,n.jsx)(u.span,{tabIndex:h?0:-1,"data-orientation":p.orientation,...c,ref:r,onMouseDown:(0,x.composeEventHandlers)(e.onMouseDown,e=>{a?p.onItemFocus(m):e.preventDefault()}),onFocus:(0,x.composeEventHandlers)(e.onFocus,()=>p.onItemFocus(m)),onKeyDown:(0,x.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var n;let i=(n=e.key,"rtl"!==r?n:"ArrowLeft"===n?"ArrowRight":"ArrowRight"===n?"ArrowLeft":n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(i))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(i)))return D[i]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let i=f().filter(e=>
42e.focusable).map(e=>e.ref.current);if("last"===t)i.reverse();else if("prev"===t||"next"===t){var r,n;"prev"===t&&i.reverse();let a=i.indexOf(e.currentTarget);i=p.loop?(r=i,n=a+1,r.map((e,t)=>r[(n+t)%r.length])):i.slice(a+1)}setTimeout(()=>B(i))}}),children:"function"==typeof s?s({isCurrentTabStop:h,hasTabStop:null!=v}):s})})});O.displayName=I;var D={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function B(e,t=!1){let r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}e.s(["Item",0,O,"Root",0,A,"createRovingFocusGroupScope",0,M],423540);var $=e.i(802239);function F(){return()=>{}}e.s(["useIsHydrated",0,function(){return(0,$.useSyncExternalStore)(F,()=>!0,()=>!1)}],92330)},90317,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={bindSnapshot:function(){return c},createAsyncLocalStorage:function(){return s},createSnapshot:function(){return u}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let a=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class l{disable(){throw a}getStore(){}run(){throw a}exit(){throw a}enterWith(){throw a}static bind(e){return e}}let o="u">typeof globalThis&&globalThis.AsyncLocalStorage;function s(){return o?new o:new l}function c(e){return o?o.bind(e):l.bind(e)}function u(){return o?o.snapshot():function(e,...t){return e(...t)}}},242344,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,e.r(90317).createAsyncLocalStorage)()},563599,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorage",{enumerable:!0,get:function(){return n.workAsyncStorageInstance}});let n=e.r(242344)},309885,(e,t,r)=>{"use strict";function n(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return n}})},667585,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return i}});let n=e.r(132061);function i({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new n.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},652157,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return s}});let n=e.r(843476),i=e.r(174080),a=e.r(563599),l=e.r(309885),o=e.r(543369);function s({moduleIds:e}){if("u">typeof window)return null;let t=a.workAsyncStorage.getStore();if(void 0===t)return null;let r=[];if(t.reactLoadableManifest&&e){let n=t.reactLoadableManifest;for(let t of e){if(!n[t])continue;let e=n[t].files;r.push(...e)}}if(0===r.length)return null;let c=(0,o.getAssetTokenQuery)();return(0,n.jsx)(n.Fragment,{children:r.map(e=>{let r=`${t.assetPrefix}/_next/${(0,l.encodeURIPath)(e)}${c}`;return e.endsWith(".css")?(0,n.jsx)("link",{precedence:"dynamic",href:r,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,i.preload)(r,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},869093,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return c}});let n=e.r(843476),i=e.r(271645),a=e.r(667585),l=e.r(652157);function o(e){return{default:e&&"default"in e?e.default:e}}let s={loader:()=>Promise.resolve(o(()=>null)),loading:null,ssr:!0},c=function(e){let t={...s,...e},r=(0,i.lazy)(()=>t.loader().then(o)),c=t.loading;function u(e){let o=c?(0,n.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,s=!t.ssr||!!t.loading,u=s?i.Suspense:i.Fragment,d=t.ssr?(0,n.jsxs)(n.Fragment,{children:["u"<typeof window?(0,n.jsx)(l.PreloadChunks,{moduleIds:t.modules}):null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(a.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(u,{...s?{fallback:o}:{},children:d})}return u.displayName="LoadableComponent",u}},770703,(e,t,r)=>{"use strict";
42Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return i}});let n=e.r(555682)._(e.r(869093));function i(e,t){let r={};"function"==typeof e&&(r.loader=e);let i={...r,...t};return(0,n.default)({...i,modules:i.loadableGenerated?.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},232189,(e,t,r)=>{"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},865156,(e,t,r)=>{"use strict";var n=e.r(232189);function i(){}function a(){}a.resetWarningCache=i,t.exports=function(){function e(e,t,r,i,a,l){if(l!==n){var o=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i}
42;return r.PropTypes=r,r}},745009,(e,t,r)=>{e.i(247167),t.exports=e.r(865156)()},241665,e=>{"use strict";var t=e.i(271645);e.s(["useDebouncedEffect",0,function(e,r,n=[]){(0,t.useEffect)(()=>{let t=setTimeout(()=>{e()},r);return()=>{clearTimeout(t)}},[...n,r])}])},192506,e=>{"use strict";var t=e.i(18262),r=e.i(615405);function n(e){return!(!e||"active"!==e.status&&"trialing"!==e.status||e.current_period_end&&new Date(e.current_period_end).getTime()<Date.now())}e.s(["buildMembershipTiers",0,function(e,t){return{subscriber:{name:e?.subscriber_tier_name??"Free",description:e?.subscriber_tier_description??null},paid:t.filter(e=>e.active).sort((e,t)=>e.sort_order-t.sort_order).map(e=>({id:e.id,name:e.name,description:e.description,monthly_price_cents:e.monthly_price_cents,annual_price_cents:e.annual_price_cents}))}},"getGatedPostPolicy",0,function(e){let n=e?(0,r.getDocumentPages)(e):void 0,i=n?.[0];var a=i?.blocks;let l=a?.find(e=>e?.block?.$type===t.ids.PubLeafletBlocksMembersOnlyDelimiter)?.block;if(!l)return null;if("subscribers"===l.audience)return{audience:"subscribers"};if("paid"===l.audience)return{audience:"paid"};if("tiers"===l.audience)return Array.isArray(l.tierIds)?{audience:"tiers",tierIds:[...new Set(l.tierIds.filter(e=>"string"==typeof e))]}:null;if(void 0!==l.audience)return null;if(void 0===l.tiers)return{audience:"paid"};if(!Array.isArray(l.tiers))return null;let o=[...new Set(l.tiers.filter(e=>"string"==typeof e))];return o.length>0?{audience:"tiers",tierIds:o}:{audience:"paid"}},"isActiveMembership",0,n,"membershipUnlocksGatedPost",0,function(e,t){return!!e&&!!t&&("subscribers"===t.audience||"paid"===e.kind&&("paid"===t.audience||t.tierIds.length>0&&t.tierIds.includes(e.tierId)))},"postHasMembersDelimiter",0,function(e){var n;let i,a=e?(0,r.getDocumentPages)(e):void 0;return!!a?.[0]&&(n=a[0],!!Array.isArray(i=n?.blocks)&&i.some(e=>e?.block?.$type===t.ids.PubLeafletBlocksMembersOnlyDelimiter))},"resolvePublicationMembership",0,function(e){let t=e.paidMembership;return t&&n(t)?{kind:"paid",tierId:t.tier}:e.isSubscriber?{kind:"free"}:null},"truncatePagesAtMembersDelimiter",0,function(e){let r=e[0];if(!r?.blocks)return;let n=r.blocks.findIndex(e=>e?.block?.$type===t.ids.PubLeafletBlocksMembersOnlyDelimiter);if(-1===n)return;r.blocks.splice(n+1);let i=new Set,a=t=>{for(let r of t.blocks??[]){let t=r?.block;if(t?.$type==="pub.leaflet.blocks.page"&&"string"==typeof t.id&&!i.has(t.id)){i.add(t.id);let r=e.find(e=>e?.id===t.id);r&&a(r)}}};a(r);for(let t=e.length-1;t>=1;t--){let r=e[t]?.id;r&&i.has(r)||e.splice(t,1)}}])},815255,e=>{"use strict";e.s(["viewerPostLangs",0,function(){return"u"<typeof navigator||!navigator.language?["en"]:[navigator.language]}])},393123,e=>{"use strict";function t(e){return e<=3?Math.max(e,1):4===e?2:3}e.s(["centeredGridCellStyle",0,function(e,r){let n=t(r),i=r%n,a=r-i;return!i||e<a?{gridColumn:"span 2"}:{gridColumn:`${n-i+1+(e-a)*2} / span 2`}},"centeredGridStyle",0,function(e){return{gridTemplateColumns:`repeat(${2*t(e)}, minmax(0, 1fr))`}}])},31234,e=>{"use strict";var t=e.i(72545);let r={version:1,docs:[]},n="homepageDocs-v1",i=new Map;function a(){return JSON.parse(window.localStorage.getItem(n)||JSON.stringify(r)).docs.map(e=>{let t=i.get(e.token.id);return t||(t=e.token,i.set(e.token.id,e.token)),{...e,token:t}})}e.s(["addDocToHome",0,function(e){let t=a();t.find(t=>t.token.id===e.id)||(t.push({token:e,added_at:new Date().toISOString()}),window.localStorage.setItem(n,JSON.stringify({version:1,docs:t})))},"getHomeDocs",0,a,"hideDoc",0,function(e){let r=a().filter(t=>t.token.id!==e.id);r.push({token:e,added_at:new Date().toISOString(),hidden:!0}),window.localStorage.setItem(n,JSON.stringify({version:1,docs:r})),(0,t.mutate)("leaflets")}])},794900,e=>{"use strict";e.s(["timeAgo",0,function(e,t){let{compact:r}=t??{},n=new Date,i=new Date(e),a=Math.floor(Math.floor((n.getTime()-i.getTime())/1e3)/60),l=Math.floor(a/60),o=Math.floor(l/24),s=Math.floor(o/7),c=Math.floor(o/30),u=Math.floor(o/365);if(r)if(u>0)return`${u}y`;else if(c>0)return`${c}mo`;else if(s>0)return`${s}w`;else if(o>0)return`${o}
42d`;else if(l>0)return`${l}h`;else if(a>0)return`${a}m`;else return"now";if(u>0)return`${u} year${1===u?"":"s"} ago`;if(c>0)return`${c} month${1===c?"":"s"} ago`;if(s>0)return`${s} week${1===s?"":"s"} ago`;if(o>0)return`${o} day${1===o?"":"s"} ago`;if(l>0)return`${l} hour${1===l?"":"s"} ago`;else if(a>0)return`${a} minute${1===a?"":"s"} ago`;else return"just now"}])},229008,e=>{"use strict";var t=e.i(500932),r=e.i(935593),n=e.i(283599);e.s(["useRecordFromDid",0,function(e){let i,a,l=(0,t.c)(4);return l[0]!==e?(i=e?["basic-profile",e]:null,l[0]=e,l[1]=i):i=l[1],l[2]!==e?(a=async()=>(await (0,r.callRPC)("get_profiles",{dids:[e]})).result.profiles[e]??void 0,l[2]=e,l[3]=a):a=l[3],(0,n.default)(i,a)}])}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.