import{Q as z,s as v,x as C,y as I,H as R,d as a,c as d,f as r,n as g,l as s,t as x,m as _,q as k,j as b,i as y,C as O,_ as D,F as V,z as j,J as E,R as H,S as A,U as S,V as U,A as T,u as Q,N as M,O as W,W as N,w as L,b as J,X,Y}from"./entry.4d7b4fe3.js";import{S as G,a as K,_ as F,b as Z,u as tt}from"./useFetchByUID.311c9267.js";import{_ as et}from"./PageLayout.7931c648.js";const nt={class:"c-story-hero-text"},ot=["textContent"],at=["textContent"],st={key:1,class:"relative >=960:w-8/12col mx-auto"},ct=["textContent"],it={class:g(["flex items-center justify-between",">=960:grid >=960:grid-cols-12 gap-layout-gutter","uppercase text-button font-gt-america-extended"])},rt=["textContent"],lt={class:g([">=960:col-start-8 col-span-5","flex gap-x-[4px] >=960:gap-x-[8px] items-center","opacity-60 >=960:opacity-100"])},ut={class:"mx-[8px] hidden >=960:block"},mt=["textContent"],dt=["textContent"],xt=["textContent"],_t={class:"w-12/12col >=960:w-8/12col mx-auto mt-md u-direction-based"},pt=["textContent"],gt={__name:"StoryHeroText",props:{name:{type:String,default:null},byline:{type:String,default:null},location:{type:String,default:null},quote:{type:String,default:null},image:{type:Object,default:()=>({})}},setup(t){var p;const n=t,o=z(),c=v(),e=(p=C(v()))==null?void 0:p.dir,l=I("2");R("resize",()=>{const{innerWidth:i}=window;l.value=i<=1280?".75":"2"},!0);function u(){const i=encodeURIComponent(`https://afteraugust.org${o.path}`),h=c.t("share-message").replaceAll("(0)",n.name);window.open(`https://www.facebook.com/sharer/sharer.php?u=${i}&t=${h}`,"_blank","menubar=no,toolbar=no,resizable=yes,scrollbars=yes,width=550,height=600")}function m(){const i=encodeURIComponent(`https://afteraugust.org${o.path}`),h=c.t("share-message").replaceAll("(0)",n.name);window.open(`https://twitter.com/intent/tweet?text=${h}%0A%0A&url=${i}`,"_blank","width=550,height=600")}return(i,h)=>{var $,w;const f=O,B=F;return a(),d("div",nt,[r("div",{class:g(["c-story-hero-text__content","u-direction-based","max-w-layout-max px-layout-margin","flex flex-col justify-end","pt-3xl >=960:pt-[240px]",{"pb-md gap-y-md >=960:gap-y-xl":t.quote&&t.quote.length,"pb-xl gap-y-md":!(t.quote&&t.quote.length)}])},[t.quote&&t.quote.length?(a(),d("div",{key:0,class:g(["relative flex flex-col gap-y-xs pt-md",{">=960:pr-2/12col":s(e)=="ltr"||!s(e),">=960:pl-2/12col":s(e)=="rtl"}])},[t.quote?(a(),d("h1",{key:0,class:g(["font-gt-america-extended font-medium","text-h1 uppercase"]),textContent:x(t.quote)},null,8,ot)):_("",!0),t.name?(a(),d("span",{key:1,class:g(["c-story-hero-text__name","font-nola-tenley-script text-name","absolute text-green-500",{"left-1/12col >=960:left-2/12col":s(e)=="ltr"||!s(e),"right-3/12col >=960:right-2/12col":s(e)=="rtl"}]),textContent:x(t.name)},null,10,at)):_("",!0)],2)):(a(),d("div",st,[t.name?(a(),d("h1",{key:0,class:g(["font-gt-america-extended font-medium","text-h1 uppercase"]),textContent:x(t.name)},null,8,ct)):_("",!0)])),r("div",it,[t.byline?(a(),d("span",{key:0,class:">=960:col-start-3 col-span-5",textContent:x(`${t.byline}${t.location?`, ${t.location}`:""}`)},null,8,rt)):_("",!0),r("div",lt,[k(f,{size:"sm",onClick:u},{icon:b(()=>[k(s(G))]),_:1}),k(f,{size:"sm",onClick:m},{icon:b(()=>[k(s(K))]),_:1}),r("div",ut,[r("span",{textContent:x(`${i.$t("share")} `)},null,8,mt),r("span",{textContent:x(`${t.name}${i.$t("name-prefix")}`)},null,8,dt),r("span",{textContent:x(` ${i.$t("story")}`)},null,8,xt)])])])],2),($=t.image)!=null&&$.url?(a(),y(B,{key:0,class:"aspect-[3/4] >=960:aspect-[16/9]",src:t.image.url,alt:t.image.alt},null,8,["src","alt"])):_("",!0),r("div",_t,[(w=t.image)!=null&&w.copyright?(a(),d("span",{key:0,class:"bg-opacity-100 text-copyright",textContent:x(`© ${t.image.copyright}`)},null,8,pt)):_("",!0)])])}}},ht=gt,yt={BlockListRichText:A(()=>S(()=>import("./BlockListRichText.1be5b123.js"),["./BlockListRichText.1be5b123.js","./entry.4d7b4fe3.js","./entry.d77cd58c.css","./BlockListRichText.d48c7e3d.css"],import.meta.url)),BlockListImage:A(()=>S(()=>import("./BlockListImage.99bd816a.js"),["./BlockListImage.99bd816a.js","./useFetchByUID.311c9267.js","./entry.4d7b4fe3.js","./entry.d77cd58c.css","./useFetchByUID.5fb78b37.css","./BlockListImage.4184a9fa.css"],import.meta.url)),BlockListQuote:A(()=>S(()=>import("./BlockListQuote.92989170.js"),["./BlockListQuote.92989170.js","./useFetchByUID.311c9267.js","./entry.4d7b4fe3.js","./entry.d77cd58c.css","./useFetchByUID.5fb78b37.css","./BlockListQuote.d93d1d70.css"],import.meta.url))},ft={rich_text:"BlockListRichText",image:"BlockListImage",quote:"BlockListQuote"},wt={name:"BlockList",inheritAttrs:!1,props:{items:{type:Array,default:()=>[]}},computed:{computedBlocks(){return this.items.filter(({slice_type:t})=>this.getBlockFromAlias(t)).map(t=>({alias:t.slice_type,attrs:{items:t==null?void 0:t.items,...t.primary??{}}}))}},methods:{getBlockFromAlias(t){return yt[ft[t]]}}},$t={class:"c-block-list space-y-2xl"};function kt(t,n,o,c,e,l){return a(),d("div",$t,[(a(!0),d(V,null,j(l.computedBlocks,(u,m)=>(a(),y(H(l.getBlockFromAlias(u.alias)),E({key:`block-${m}`},u.attrs),null,16))),128))])}const vt=D(wt,[["render",kt]]),bt={class:"relative h-[100vh] overflow-clip bg-dimmed u-direction-based"},Ct={class:"text-button font-gt-america-extended"},Bt=["textContent"],At={__name:"StoryNext",props:{item:{type:Object,required:!0}},setup(t){var c;const n=(c=C(v()))==null?void 0:c.dir,o=U();return(e,l)=>{const u=F,m=Z;return a(),y(m,{class:"c-story-next",tag:"NuxtLink",mode:"visibility",to:s(o)(t.item.url)},{default:b(({percentageY:p})=>{var i;return[r("div",bt,[r("div",{class:"absolute bottom-[0px] w-full h-[200vh]",style:T({opacity:`${p*.75+.25}`})},[r("div",{class:g(["flex flex-col justify-center gap-[48px]","sticky top-[0px] w-12/12col >=960:w-10/12col h-[100vh]","mx-auto"]),style:T({transform:`translateY(${20-p*20}vh)`})},[r("div",{class:g(["space-y-[24px] uppercase",{">=960:pr-2/12col":s(n)=="ltr"||!s(n),">=960:pl-2/12col":s(n)=="rtl"}])},[r("div",Ct,x(e.$t("next-story")),1),r("div",{class:"font-gt-america-extended font-medium text-quote",textContent:x(t.item.data.teaser)},null,8,Bt)],2),(i=t.item.data.image)!=null&&i.url?(a(),y(u,{key:0,class:"w-full >=960:w-4/12col aspect-[16/10]",src:t.item.data.image.url,alt:t.item.data.image.alt},null,8,["src","alt"])):_("",!0)],4)],4)])]}),_:1},8,["to"])}}},St=At;async function Lt(t,n,o,c){var e;return await t.client.get({filters:[N.at("document.type",o)],orderings:{field:"document.first_publication_date"},lang:(e=C(n))==null?void 0:e.iso,after:c,pageSize:1})}async function qt(t,n,o){var c;return await t.client.get({filters:[N.at("document.type",o)],orderings:{field:"document.first_publication_date"},lang:(c=C(n))==null?void 0:c.iso,pageSize:1})}async function Pt(t,n,o={},c=!0){var p,i;const e=Q(),l=v(),u=[t,n,o],m=await M(`next__${t}-${n}`,async()=>{const h=await Lt(e,l,...u),f=await qt(e,l,...u);return h.results[0]||f.results[0]});if(c&&((p=m.error)!=null&&p.value))throw W({statusCode:404,statusMessage:"Page not found"});return(i=m.data)==null?void 0:i.value}const Tt={class:"max-w-layout-max px-layout-margin mx-auto pt-2xl pb-3xl"},Ft={__name:"[uid]",async setup(t){let n,o;const c=z(),{data:e,uid:l,id:u}=([n,o]=L(()=>tt("story",c.params.uid)),n=await n,o(),n),m=([n,o]=L(()=>Pt("story",u)),n=await n,o(),n);return l&&l!==c.params.uid&&([n,o]=L(()=>X({path:`/story/${l}`})),await n,o()),e&&J({meta:[{name:"title",content:`${e.name} - After August`},{name:"description",content:e.teaser},{name:"image",content:`${e.image.url}&w=1920&h=1080&fit=crop&q=80`},{name:"og:title",content:e.name},{name:"og:description",content:e.teaser},{name:"og:image",content:`${e.image.url}&w=1920&h=1080&fit=crop&q=80`},{name:"og:image:alt",content:`Portrait of ${e.name}`},{name:"og:url",content:`https://afteraugust.org/${c.path}`},{name:"twitter:card",content:"summary_large_image"},{name:"twitter:title",content:e.name},{name:"twitter:description",content:e.teaser},{name:"twitter:image",content:`${e.image.url}&w=1920&h=1080&fit=crop&q=80`},{name:"twitter:image:alt",content:`Portrait of ${e.name}`}]}),(p,i)=>{const h=ht,f=vt,B=St,$=et;return a(),y($,{class:"p-story"},{default:b(()=>{var w,q,P;return[((q=(w=s(e).slices)==null?void 0:w[0])==null?void 0:q.slice_type)==="hero_text"?(a(),y(h,Y(E({key:0},s(e).slices[0].primary)),null,16)):_("",!0),r("div",Tt,[(P=s(e).slices2)!=null&&P.length?(a(),y(f,{key:0,items:s(e).slices2},null,8,["items"])):_("",!0)]),s(m)?(a(),y(B,{key:1,item:s(m)},null,8,["item"])):_("",!0)]}),_:1})}}};export{Ft as default};