import{_ as C,$ as H,C as M,v as D,u as F,o as n,c as o,n as s,s as i,B as l,g as _,t as u,d as h,q as y,y as T,F as N,h as R,z as S,x as $}from"./entry.5126f3ef.js";const E=["aria-label"],U=["innerHTML"],V={key:0,class:"element-image-wrapper"},q=["src","alt"],I=["src","alt"],P=["innerHTML"],j=["innerHTML"],A={__name:"TeaserDefault",props:{slug:{type:String,required:!0}},setup(L){const d=L,t=H({title:"",slug:d.slug,text:"",background_image:{url:""},cta:{url:"",text:"",style:"",target_blank:""},elements:[{image:[],cta:{url:"",text:"",style:"",target_blank:""}}]});return M(async()=>{const w=`/api/teasers?filters[slug][$contains]=${d.slug}&populate[0]=background_image&populate=template.content&populate=template.teaser_elements.image&populate=template.teaser_options.background_image`,{data:g,error:r}=await D(()=>w,{baseURL:F().textContentBaseUri,key:"teaser-default-"+d.slug},"$ER02ltd1bh");if(!r._value&&g.value){const e=g.value.data[0].attributes;let c="",p="",v="";e.template[0].content!==null&&(t.title=e.template[0].content.title,t.subline=e.template[0].content.subline,t.text=e.template[0].content.text,c=e.template[0].content.text_font_size,p=e.template[0].content.text_align,v=e.template[0].content.text_full_width,e.template[0].content.cta_text!=null&&(t.cta.url=e.template[0].content.cta_url,t.cta.text=e.template[0].content.cta_text,t.cta.target_blank=e.template[0].content.cta_target_blank,e.template[0].content.cta_style_border&&(t.cta.style="border-white"),e.template[0].content.cta_style_shadow&&(t.cta.style+=" btn-shadow "))),t.elements=e.template[0].teaser_elements,t.elements.forEach(a=>{if(a.text_align!=null){const B={links:"text-left",zentriert:"text-center"};a.css_classes+=" "+B[a.text_align]}a.image_behaviour===null||a.image_behaviour===""?(a.image_behaviour="normal",a.image_classes=""):a.image_behaviour==="responsive"&&(a.image_classes="object-fluid"),a.title_classes="title-big",a.headline_size==="klein"&&(a.title_classes="title-small"),a.cta={},(a.cta_text!==null||a.cta_text!=="")&&(a.cta.text=a.cta_text,a.cta.url=a.cta_url,a.cta.target_blank=a.cta_target_blank,a.cta_style_border&&(a.cta.style="border-white"),a.cta_style_shadow&&(a.cta.style+=" btn-shadow "))}),e.template[0].teaser_options==null&&(e.template[0].teaser_options.container_width="mittel",e.template[0].teaser_options.background_color="weiss",e.template[0].teaser_options.background_image=null,e.template[0].teaser_options.background_darken="none",e.template[0].teaser_options.font_color="schwarz",e.template[0].teaser_options.text_font_size="normal",e.template[0].teaser_options.padding_top="mittel",e.template[0].teaser_options.padding_bottom="mittel");const m=e.template[0].teaser_options.container_width;if(m!==""&&m!==null){const a={breit:"container",mittel:"container-middle",schmal:"container-narrow"};t.container=a[m]}else t.container="container";const b=e.template[0].teaser_options.padding_top;if(t.padding_top="pt-20 pt-lg-40",b!==""&&b!==null){const a={klein:"pt-20",mittel:"pt-40 pt-lg-40",gross:"pt-60 pt-lg-90"};t.padding_top=a[b]}const k=e.template[0].teaser_options.padding_bottom;if(t.padding_bottom="pt-20 pt-lg-40",k!==""&&k!==null){const a={klein:"pb-20",mittel:"pb-40 pb-lg-40",gross:"pb-60 pb-lg-90"};t.padding_bottom=a[k]}const f=e.template[0].teaser_options.background_color;if(f!==""&&f!==null){const a={weiss:"bg-white",hellblau:"bg-blue-light","verlauf gruen":"bg-green-gradient"};t.background_color=a[f]}else t.background_color="bg-white";const z=e.template[0].teaser_options.background_image.data;z!==null?t.background_image=z.attributes:t.background_image=null,e.template[0].teaser_options.background_darken===null||e.template[0].teaser_options.background_darken==="none"?(t.background_darken=!1,t.background_darken_classes=""):(t.background_darken=!0,e.template[0].teaser_options.background_darken==="light 0.2"?t.background_darken_classes="background-darken-light":e.template[0].teaser_options.background_darken==="middle 0.4"?t.background_darken_classes="background-darken-middle":t.background_darken_classes="background-darken"),t.title_css="title-display",t.subline_css="title-subline";const x=e.template[0].teaser_options.font_color;if(x!==""){const a={schwarz:"",grau:"color-gray",weiss:"color-white"};t.font_color=a[x],x==="weiss"&&(t.title_css="title-display-white",t.subline_css="title-subline-white")}else t.font_color="";if(t.text_font_size="",c!==""){const a={normal:"",gross:"font-size-copy-big",klein:"font-size-small"};t.text_font_size=a[c]}if(t.text_align="",p!==""){const a={links:"text-left",zentriert:"text-center"};t.text_align=a[p]}t.full_width="",t.full_width=v?"100%":"50%",t.section_classes="teaser-"+t.slug+" "+t.background_color,t.container_classes=t.container+" "+t.font_color+" "+t.padding_top+" "+t.padding_bottom+" "+t.text_align,t.text_classes=t.text_font_size}else console.error("is error",r)}),(w,g)=>{const r=$;return n(),o("section",{id:"teaser-default",style:S([s(t).background_image!=null?{"background-image":"url("+s(t).background_image.url+")"}:null]),class:l(["teaser-base",s(t).section_classes])},[s(t).background_image!=null&&s(t).background_image.alternativeText!=null?(n(),o("span",{key:0,role:"img","aria-label":s(t).background_image.alternativeText},null,8,E)):i("",!0),s(t).background_darken?(n(),o("div",{key:1,class:l(s(t).background_darken_classes)},null,2)):i("",!0),_("div",{class:l(s(t).container_classes)},[_("div",{class:l(["teaser-top-wrapper",{"half-width":s(t).full_width==="50%"}])},[s(t).subline?(n(),o("div",{key:0,class:l(["teaser-subline font-size-copy-big mb-10",s(t).subline_css])},u(s(t).subline),3)):i("",!0),s(t).title?(n(),o("h3",{key:1,class:l(["teaser-title font-size-26 font-size-md-34 mb-30",s(t).title_css])},u(s(t).title),3)):i("",!0),s(t).text?(n(),o("div",{key:2,class:l(["teaser-text",s(t).text_classes]),innerHTML:s(t).text},null,10,U)):i("",!0),s(t).cta.text!=""?(n(),h(r,{key:3,class:l(["teaser-cta btn-primary",s(t).cta.style]),to:s(t).cta.url,target:s(t).cta.target_blank?"_blank":"_self"},{default:y(()=>[T(u(s(t).cta.text),1)]),_:1},8,["to","class","target"])):i("",!0)],2),_("div",{class:l(["elements row","row-"+s(t).elements.length])},[(n(!0),o(N,null,R(s(t).elements,(e,c)=>(n(),o("div",{key:c,class:l(["element",e.css_classes])},[e.image.data!=null?(n(),o("div",V,[e.img_link?(n(),h(r,{key:0,href:e.img_link},{default:y(()=>[_("img",{src:e.image.data.attributes.url,class:l(["element-image",e.image_classes]),alt:e.image.data.attributes.alternativeText??""},null,10,q)]),_:2},1032,["href"])):(n(),o("img",{key:1,src:e.image.data.attributes.url,class:l(["element-image",e.image_classes]),alt:e.image.data.attributes.alternativeText??""},null,10,I))])):i("",!0),e.title?(n(),o("h4",{key:1,class:l(["element-title font-size-26 font-size-md-34 mb-20",[e.title_classes,s(t).title_css]]),innerHTML:e.title},null,10,P)):i("",!0),_("div",{class:"element-text",innerHTML:e.text},null,8,j),e.cta.text!==""&&e.cta.text!==null?(n(),h(r,{key:2,class:l(["element-cta btn-primary",e.cta.style]),to:e.cta.url,target:e.cta.target_blank?"_blank":"_self"},{default:y(()=>[T(u(e.cta.text),1)]),_:2},1032,["to","class","target"])):i("",!0)],2))),128))],2)],2)],6)}}},G=C(A,[["__scopeId","data-v-bf15a2aa"]]);export{G as T};