const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B7qwhRTg.js","assets/vendor-CsGITfgk.js","assets/vendor-DXOeSP1F.css","assets/index-Dd5T_0C2.css"])))=>i.map(i=>d[i]);
import{M as E,aK as O,N as r,W as v,R as c,a8 as u,X as T,Y as i,P as W,Q as q,U as p,V as $,Z as N,e as m,aA as x,b1 as z,O as s,$ as Y,r as V,E as f,bV as F,ad as G,an as X,ak as j,ai as H}from"./vendor-CsGITfgk.js";import{g as J,r as Q,I as C,j as Z,J as ee,U as te,K as se,N as b}from"./index-B7qwhRTg.js";import{u as ae}from"./useBreadcrumbs-CLanN9FL.js";import{N as ne,i as oe}from"./index-Pcib4pjH.js";async function le(d){const{storeId:_,cultureName:l}=J,{data:w}=await Q.query({query:ne,variables:{storeId:_,languageCode:l,...d}});return w.newsArticle}const ce={class:"news-article-content"},ie={class:"news-article-content__title"},re={class:"news-article-content__tags"},ue={key:1,class:"news-article-content__citation"},de={key:0,class:"news-article-content__citation-author"},_e={key:1,class:"news-article-content__citation-publish-date"},ve=E({__name:"news-article-content",props:{newsArticle:{}},emits:["tag:click","author:click"],setup(d,{emit:_}){const l=_,e=O(d,"newsArticle");return(t,a)=>{const k=p("VcChip"),g=p("VcImage");return s(),r("div",ce,[v("div",ie,i(e.value.title),1),v("div",re,[(s(!0),r(W,null,q(e.value.tags,n=>(s(),c(k,{key:n,color:"secondary",variant:"outline-dark",class:"news-article-content__tag",clickable:"",onClick:y=>l("tag:click",n)},{default:$(()=>[N(i(n),1)]),_:2},1032,["onClick"]))),128))]),e.value.contentPreview?(s(),c(m(C),{key:0,class:x(m(oe)(e.value.contentPreview)?"news-article-content__preview-image":"news-article-content__preview"),src:e.value.contentPreview},null,8,["class","src"])):u("",!0),e.value.author||e.value.publishDate?(s(),r("div",ue,[e.value.author?(s(),r("div",de,[e.value.author.iconUrl?(s(),c(g,{key:0,src:e.value.author.iconUrl,lazy:"",class:"news-article-content__citation-author-image"},null,8,["src"])):u("",!0),v("span",null,[N(i(t.$t("news.details.written-by"))+" ",1),v("button",{class:"news-article-content__citation-author-name",type:"button",onClick:a[0]||(a[0]=n=>l("author:click",e.value.author.id)),onKeyup:a[1]||(a[1]=z(n=>l("author:click",e.value.author.id),["enter"]))},i(e.value.author.name),33)])])):u("",!0),a[2]||(a[2]=v("div",null,null,-1)),e.value.publishDate?(s(),r("div",_e,i(t.$t("news.details.last-updated"))+" "+i(t.$d(e.value.publishDate,"short")),1)):u("",!0)])):u("",!0),T(m(C),{src:e.value.content??"",class:"news-article-content__content"},null,8,["src"])])}}}),pe={class:"news-article"},fe=E({__name:"news-article",props:{articleId:{}},setup(d){const _=d,l=X(()=>j(()=>import("./index-B7qwhRTg.js").then(o=>o.dn),__vite__mapDeps([0,1,2,3]))),{t:w}=Y(),e=V(!1),t=V(),{getSettingValue:a}=Z(ee),k=a(te),g=f(()=>t.value?.seoInfo?.pageTitle||t.value?.title),{title:n}=se(g),y=f(()=>t.value?.seoInfo?.metaDescription),S=f(()=>t.value?.seoInfo?.metaKeywords),U=f(()=>t.value?.seoInfo?.semanticUrl?k?`${window.location.host}/${b.LINK_SEGMENT}/${t.value?.seoInfo?.semanticUrl}`:`${window.location.host}/${t.value?.seoInfo?.semanticUrl}`:window.location.toString()),D=ae(()=>[{title:w("news.details.breadcrumbs.news"),route:"/news"},{title:g.value??""}]),A=H();function B(o){A.push({name:b.ARTICLES_BY_TAG.NAME,params:{tag:o}})}function P(o){A.push({name:b.ARTICLES_BY_AUTHOR.NAME,params:{authorId:o}})}const R=async()=>{e.value=!0;const o=await le({id:_.articleId});t.value=o,e.value=!1};return F({title:()=>n.value,keywords:()=>S.value,description:()=>y.value,ogUrl:()=>U.value,ogTitle:()=>n.value,ogDescription:()=>y.value,ogType:()=>"website"}),G(R),(o,h)=>{const K=p("VcBreadcrumbs"),L=p("VcWidgetSkeleton"),M=p("VcContainer");return s(),r("div",pe,[!e.value&&!t.value?(s(),c(m(l),{key:0})):(s(),c(M,{key:1},{default:$(()=>[T(K,{class:"news-article__breadcrumbs",items:m(D)},null,8,["items"]),e.value?(s(),c(L,{key:0,head:"",size:"lg"})):t.value?(s(),c(ve,{key:1,"news-article":t.value,"onTag:click":h[0]||(h[0]=I=>B(I)),"onAuthor:click":h[1]||(h[1]=I=>P(I))},null,8,["news-article"])):u("",!0)]),_:1}))])}}});export{fe as default};
//# sourceMappingURL=news-article-TZQW_gy4.js.map
