import{D as F,e as O,w as B,X as m,o as s,c as y,f as o,m as t,u as a,a as u,Y as g,d as i,F as U,Z as Y,a9 as L,b as v,l as ,ドルai as G,ay as X,j as N,_ as Z}from"./nzYCXBUX.js";import J from"./NP3ogLne.js";import Q from"./DAGTali_.js";import{u as A}from"./BrqJzIY8.js";import{q as I}from"./CVSdRl81.js";import{u as W}from"./CJhE7i-9.js";const ee={key:0,class:"slp-flex slp-flex-column slp-px-md-16"},ae=["href","data-ga-name","onMouseover","onMouseleave"],te={class:"ts-landing-category__details"},oe={class:"slp-flex"},ne=["href","data-ga-name"],se={class:"ts-landing-category__btn-group"},re={key:0,class:"separator"},ce=F({__name:"LandingCategory",props:{config:{}},async setup(w){let c,S;const f=w,{locale:d}=O(),C=d.value.toLowerCase(),h=d.value==="en-us"?"":`/${d.value}`,x=N([]),p=N();let T=[];const{data:_}=([c,S]=B(()=>A(`the-source-${f.config.category}-landing-category-${d.value}`,()=>I("pages").where("path","LIKE",`/${C}/the-source/%`).where("type","=","category").where("slug","=",f.config.category).first())),c=await c,S(),c),{data:H}=([c,S]=B(async()=>A(`${f.config.category}-landing-most-recent-articles-${d.value}`,async()=>(await I("theSource").where("path","LIKE",`/${C}/the-source/%`).where("category","=",f.config.category).all()).filter(l=>!!l.content?.date).sort((l,r)=>new Date(r.content?.date||0).getTime()-new Date(l.content?.date||0).getTime()).slice(0,3))),c=await c,S(),c),{data:M}=W(),{content:E}=_.value;p.value=E[0].componentContent,T=E[1].componentContent.config.sourceCTAs;const{data:R}=A(`the-source-${f.config.category}-landing-resources-${d.value}`,()=>T?.length?I("shared").where("stem","LIKE",`shared/${C}/the-source/source-lp-ctas/%`).all().then(n=>n.map(l=>l.meta??{})).then(n=>n.filter(l=>T.includes(l?.config?.slug))):Promise.resolve([]),{lazy:!0,default:()=>[]});return x.value=H.value?.map(n=>({...n,isHighlighted:!1})),(n,l)=>{const r=m("SlpTypography"),b=m("SlpButton"),V=G,z=m("SlpIcon"),D=m("SlpColumn"),K=J,P=m("SlpRow"),j=m("SlpContainer");return s(),y("div",{class:L(["ts-landing-category",{"ts-landing-category--surface-bg":w.config?.theme==="surface"}])},[o(j,null,{default:t(()=>[a(_)?(s(),y("div",ee,[o(r,{id:`category-${a(_).slug}`,tag:"span",variant:"all-caps",class:"slp-mb-8"},{default:t(()=>[u(g(n.$t("theSource.category")),1)]),_:1},8,["id"]),o(b,{href:`${a(h)}/the-source/${a(_).slug}/`,variant:"tertiary","data-ga-name":a(p).title,"data-ga-location":"theSource","aria-labelledby":`category-${a(_).slug}`},{default:t(()=>[o(r,{tag:"h2",variant:"heading2-bold",class:"slp-mb-8"},{default:t(()=>[u(g(a(p).title),1)]),_:1})]),_:1},8,["href","data-ga-name","aria-labelledby"])])):i("",!0),o(P,null,{default:t(()=>[o(D,{cols:8,class:"slp-pr-md-24"},{default:t(()=>[(s(!0),y(U,null,Y(a(x),(e,k)=>(s(),y("div",{key:e.content.title,class:L(k===0?"ts-landing-category__most-recent":"ts-landing-category__article")},[v("a",{href:`${a(h)}/the-source/${e.category}/${e.slug}/`,class:"ts-landing-category__image","data-ga-name":e.slug,"data-ga-location":"theSource",onMouseover:q=>e.isHighlighted=!0,onMouseleave:q=>e.isHighlighted=!1},[e.content?.heroImage?(s(),$(V,{key:0,src:e.content.heroImage,alt:"",provider:"cloudinary",sizes:"400px md:900px"},null,8,["src"])):i("",!0)],40,ae),v("div",te,[v("div",oe,[e.type!==a(X).REGULAR?(s(),$(z,{key:0,icon:a(Q),class:"slp-mr-4",alt:""},null,8,["icon"])):i("",!0),o(r,{tag:"span",variant:"all-caps"},{default:t(()=>[u(g(n.$t(`theSource.types.${e.type}`)),1)]),_:2},1024)]),v("a",{href:`${a(h)}/the-source/${e.category}/${e.slug}/`,class:L(["ts-landing-category__headline-link",{"ts-landing-category--active":e.isHighlighted}]),"data-ga-name":e.slug,"data-ga-location":"theSource"},[o(r,{tag:"h3",variant:`${k===0?"heading3-bold":"heading5-bold"}`,class:"ts-landing-category__headline"},{default:t(()=>[u(g(e.content?.title),1)]),_:2},1032,["variant"])],10,ne),e.content?.description&&k===0?(s(),$(r,{key:0,tag:"p",variant:"body1",class:"slp-mb-8"},{default:t(()=>[u(g(e.content.description),1)]),_:2},1024)):i("",!0),v("div",se,[o(b,{href:`${a(h)}/the-source/${e.category}/`,variant:"tertiary","data-ga-name":e.category,"data-ga-location":"theSource"},{default:t(()=>[o(r,{tag:"span",variant:"body3-bold"},{default:t(()=>[u(g(a(p).title),1)]),_:1})]),_:1},8,["href","data-ga-name"]),e.config.author?(s(),y("span",re)):i("",!0),e.config?.author?(s(),$(b,{key:1,href:`${a(h)}/the-source/authors/${e.config.author}/`,variant:"tertiary","data-ga-name":e.config.author,"data-ga-location":"theSource"},{default:t(()=>[o(r,{tag:"span",variant:"body3-bold"},{default:t(()=>[u(g(a(M)[e.config?.author]),1)]),_:2},1024)]),_:2},1032,["href","data-ga-name"])):i("",!0)])])],2))),128)),o(b,{class:"ts-landing-category__browse",variant:"primary",href:`${a(h)}/the-source/${a(_).slug}/`,"data-ga-name":a(p).title,"data-ga-location":"theSource","aria-label":n.$t("theSource.browseAriaLabel",{category:a(p).title})},{default:t(()=>[u(g(n.$t("theSource.browse")),1)]),_:1},8,["href","data-ga-name","aria-label"])]),_:1}),a(R)?.length?(s(),$(D,{key:0,cols:4,class:"w-100"},{default:t(()=>[o(K,{resources:a(R),"surface-bg":w.config?.theme!=="surface"},null,8,["resources","surface-bg"])]),_:1})):i("",!0)]),_:1})]),_:1})],2)}}}),pe=Object.assign(Z(ce,[["__scopeId","data-v-6db14854"]]),{__name:"TheSourceLandingCategory"});export{pe as default};