import{d as h,a as S,r as $,e as l,t as C,x as b,g as n,C as w,bj as T,z as _,aW as F,o as d,h as m,f as B,v as E,$ as M,n as N,a0 as z,_ as A}from"./BxiWQxwE.js";import{u as D}from"./BIxNlpeR.js";const I=["src","alt"],V=["target","aria-label"],i="640",j=h({__name:"banner-content",props:{content:{type:Object,required:!0}},setup(v){const e=v,k=z,{$messages:c}=S(),s=$(null),p=l(()=>{var a,o;return(a=t.value)!=null&&a.buttonText?{}:(o=t.value)!=null&&o.link?{to:t.value.link,target:t.value.target}:{}}),f=l(()=>{var a,o,r;return(a=t.value)!=null&&a.buttonText?"article":(o=e.content)!=null&&o.internal_link.value||(r=e.content)!=null&&r.external_link.value?k:"article"}),u=async()=>{var a,o,r,g;await N((a=t.value)==null?void 0:a.link,{external:!!((r=(o=e.content)==null?void 0:o.external_link)!=null&&r.value),open:{target:String((g=t.value)==null?void 0:g.target)}})},t=l(()=>{var a,o,r;return e.content?{id:e.content.banner_id.value,link:e.content.internal_link.value?String(e.content.internal_link.value):String(e.content.external_link.value),target:e.content.internal_link.value?"_self":"_blank",image:{src:{mobile:`${String(e.content.image_mobile.value)}?width=${i}`,desktop:`${String(e.content.image.value)}?width=${i}`},alt:{mobile:String((a=e.content.image_mobile.file)==null?void 0:a.description),desktop:String((o=e.content.image.file)==null?void 0:o.description)}},buttonText:e.content.button_text.value?String(e.content.button_text.value):null,colors:{banner:{background:(r=e.content.banner_background_color)!=null&&r.value?String(e.content.banner_background_color.value):"#FFFFFF"},button:{text:String(e.content.button_text_color.value),background:String(e.content.button_background_color.value)}}}:null}),{bannerClick:x}=D([s.value],"Content banner"),y=async()=>{if(!t.value)return null;x(String(t.value.id),t.value.image.src.desktop??t.value.image.src.desktop),t.value.link&&await u()};return(a,o)=>{var r;return n(t)?(d(),C(F(n(f)),T({key:0},n(p),{ref_key:"bannerElement",ref:s,class:"banner__highlight","data-banner-id":n(t).id,style:[`background-color: ${(r=n(t))==null?void 0:r.colors.banner.background}`],onClick:_(y,["stop"])}),{default:w(()=>[m("img",{loading:"lazy",width:i,src:a.$device.isMobile?n(t).image.src.mobile:n(t).image.src.desktop,alt:a.$device.isMobile?n(t).image.alt.mobile:n(t).image.alt.desktop},null,8,I),n(t).buttonText?(d(),B("button",{key:0,type:"button",style:M([`background-color: ${n(t).colors.button.background}`,`color: ${n(t).colors.button.text}`]),target:n(t).target,"aria-label":n(c)("aria.banner",{prefix:n(c)("common.vendor")??""}),onClick:_(u,["prevent"])},[m("span",null,E(n(t).buttonText),1)],12,V)):b("",!0)]),_:1},16,["data-banner-id","style"])):b("",!0)}}}),q=A(j,[["__scopeId","data-v-57392378"]]);export{q as default};
