1import{V as Z,b5 as E,P as M,O as z,ak as T,ce as Q,aj as R,_ as Y,r as y,o as h,c as v,F as k,e as F,l as L,h as q,$ as _,t as C,aP as J,a as P,w as g,U as K,g as $,cV as X,G as N,j as x,N as ee,aY as te,p as G,by as se,cQ as ae,a5 as ie,bu as ne,aE as oe,bd as re,E as de,bY as le,S as ce,Z as pe,am as ue}from"./index-D-iuxWOd.js";import{P as ge}from"./PaginationWrapper-DjmXJtp0.js";import{P as he,A as me,a as fe,b as Ae,c as ve}from"./adsOverviewPage.types-XI6zmTNg.js";var ye=Object.defineProperty,_e=Object.getOwnPropertyDescriptor,I=(t,e,s,a)=>{for(var i=a>1?void 0:a?_e(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&ye(e,s,i),i};let w=class extends Z{get adsToDisplay(){const e=[...this.ads];return this.max?e.slice(0,this.max):e}getTimestamp(e){return Math.floor(E(e).valueOf()/1e3)}formatDate(e){if(!e)return"-";const s=this.getTimestamp(e);return E(s*1e3).format("DD.MM.YYYY")}onAdClick(e){this.$emit("onAdClick",e)}getAdLabel(e){return e.category===he?this.$t("adsOverviewPage.politicalAdLabel").toString():this.$t("adsOverviewPage.adLabel").toString()}};I([M({default:()=>[]})],w.prototype,"ads",2);I([M({default:void 0})],w.prototype,"max",2);w=I([z({name:"AdsGrid",components:{DnmDivider:T,DnmCard:Q,DnmPicture:R}})],w);const Ce={class:"adsGrid","data-testid":"adsGrid"},Pe={class:"adsGrid__adItem"},De={class:"adsGrid__adLabel","data-testid":"ad-label"},we=["onClick"],Oe={class:"adsGrid__caption","data-testid":"ad-card-caption"};function be(t,e,s,a,i,r){const n=y("DnmDivider"),u=y("DnmPicture"),c=y("DnmCard");return h(),v("div",Ce,[(h(!0),v(k,null,F(t.adsToDisplay,(p,f)=>(h(),v(k,{key:`ad-${f}`},[f>0?(h(),L(n,{key:0,class:"adsGrid__divider"})):q("",!0),_("div",Pe,[_("p",De,C(t.getAdLabel(p)),1),_("a",{onClick:J(A=>t.onAdClick(p),["prevent"])},[P(c,{class:"adsGrid__card","data-testid":"ad-card","full-width":""},{picture:g(()=>{var A;return[P(u,{image:(A=p==null?void 0:p.images)==null?void 0:A.free,"aspect-ratio":"3/3","data-testid":"ads-grid-image",width:"100%","lazy-load":""},null,8,["image"])]}),icon:g(()=>[...e[0]||(e[0]=[_("span",null,null,-1)])]),bottom:g(()=>[_("p",Oe,[K(t.$slots,"prefix",{},void 0,!0),$(" "+C(t.formatDate(p.date)),1)])]),_:2},1024)],8,we)])],64))),128))])}const ke=Y(w,[["render",be],["__scopeId","data-v-d76631bd"]]);var H;try{"__c"in w&&((H=w.__c).componentFileName??(H.componentFileName=Object.create(null)),Object.defineProperty(w.__c,"componentFileName",{value:"app/components/adsGrid/AdsGrid.vue"}))}catch(t){console.error("injectFileNamePlugin",t)}class $e extends X{mapSingle(e){var f,A,b,D,o,l;if(!e.id||!e.fields)return;const s=((A=(f=e.images)==null?void 0:f.base)==null?void 0:A.href_full)??"",a=((D=(b=e.images)==null?void 0:b.square200)==null?void 0:D.href_full)??"",i=((l=(o=e.images)==null?void 0:o.base_free)==null?void 0:l.href_full)??"",r=e.fields.caption??"",n=e.fields.category??"",u=e.fields.title??"",c=e.updated??"",p=e.href??"";return{id:e.id,href:p,type:e.__typename,caption:r,category:n,title:u,date:c,images:{base:s,square200:a,free:i}}}mapAds(e){const{items:s}=e.ads;return s&&Array.isArray(s)?s.map(i=>{if(i.content&&i.content.__typename==="Ad")return this.mapSingle(i.content)}).filter(i=>i!==void 0):[]}}var Fe=Object.defineProperty,Be=Object.getOwnPropertyDescriptor,m=(t,e,s,a)=>{for(var i=a>1?void 0:a?Be(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(i=(a?n(e,s,i):n(i))||i);return a&&i&&Fe(e,s,i),i};const O=N("adsBlock"),Ge=N("contentPage"),U=N("edition");let d=class extends x(ee,te){constructor(){super(...arguments),this.selectedAdsDate="Aktuell",this.fetchingData=!1,this.selectedAdsCategory="Alle",this.AdsDates=me,this.AdsCategories=fe,this.initialAdsCount=3,this.adsPerPage=6}async mounted(){var e;(e=this.latestAdBlocks)!=null&&e.length||await this.initiallyLoadAds()}get sectionHeaderActions(){var i,r,n,u,c;if(!((n=(r=(i=this.sectionConfiguration)==null?void 0:i.fields)==null?void 0:r.activeEditions)!=null&&n.includes(this.currentEdition.shortcut))||this.myNewsDisabled||!this.isWebApp)return;const e=((c=(u=this.sectionConfiguration)==null?void 0:u.fields)==null?void 0:c.category)||"";let s="";e&&this.$t(`sectionPage.follow.${e.toLowerCase()}`)?s=this.$t(`sectionPage.follow.${e.toLowerCase()}`).toString():G.warn(`Missing text label for sectionPage.follow. Missing translation: ${e==null?void 0:e.toLowerCase()}`);const a=this.isFavorite(this.favorite)?this.$t("sectionPage.unfollow"):s;return se(e,a,this.isFavorite(this.favorite))}get favorite(){var e,s,a;return{url:((e=this.metaData)==null?void 0:e.href)||"",uniqueId:((s=this.metaData)==null?void 0:s.id)||"",editionShortcut:this.currentEdition.shortcut||"az",name:((a=this.metaData)==null?void 0:a.name)||""}}toggleCurrentFavorite(){this.toggleFavorite(this.favorite)}get secondaryActions(){return ae(this.sectionConfiguration,this.currentEdition)}get sectionConfiguration(){var s,a;const e=(a=(s=this.currentPageContent)==null?void 0:s.resolution)==null?void 0:a.section.sectionConfiguration;if(e&&"type"in e)return e}get metaData(){var e,s,a,i,r,n,u,c,p,f,A,b,D,o,l,B,S,V,j;return{id:((a=(s=(e=this.currentPageContent)==null?void 0:e.resolution)==null?void 0:s.section)==null?void 0:a.uniqueName)||"",href:((n=(r=(i=this.currentPageContent)==null?void 0:i.resolution)==null?void 0:r.section)==null?void 0:n.href)||"",name:((u=this.sectionConfiguration)==null?void 0:u.title)||((f=(p=(c=this.currentPageContent)==null?void 0:c.resolution)==null?void 0:p.section)==null?void 0:f.name)||"",title:((D=(b=(A=this.section)==null?void 0:A.resolution)==null?void 0:b.section)==null?void 0:D.title)||"",description:((l=(o=this.sectionConfiguration)==null?void 0:o.fields)==null?void 0:l.description)||"",type:((j=(V=(S=(B=this.currentPageContent)==null?void 0:B.resolution)==null?void 0:S.section)==null?void 0:V.__typename)==null?void 0:j.toLowerCase())||"section"}}get content(){return this.section.sectionConfiguration.length&&"tags"in this.section.sectionConfiguration[0]?this.section.sectionConfiguration[0]:null}get description(){var e,s;return((s=(e=this.content)==null?void 0:e.fields)==null?void 0:s.description)||""}async beforeUnmount(){await this.clearState()}async serverPrefetch(){var e;(e=this.latestAdBlocks)!=null&&e.length||await this.initiallyLoadAds()}async searchAdsWithFilters(){await this.clearState(),await this.initiallyLoadAds()}async initiallyLoadAds(){this.fetchingData=!0;const s=(await this.retrieveAds(this.cursor,this.initialAdsCount)).splice(0,this.initialAdsCount);s.length>0&&await this.appendAdBlocks([s]),this.fetchingData=!1}handleAdClick(e){e.href&&this.navigate(e.href)}async retrieveAds(e,s){try{const a=await this.getPartialContent({name:"ads",parameters:{count:s,cursorMark:e,dateOffset:this.getDateOffset(this.selectedAdsDate),category:this.getCategoryFilter()}});if(!(a!=null&&a.ads))return G.error("Invalid or missing ads data in response"),await this.setAllAdsFetched(!0),[];const i=new $e,{count:r,total:n,cursorMark:u,items:c}=a.ads;if(c&&c.length>0){u&&await this.setCursor(u);const p=Math.ceil(n/this.adsPerPage),f=this.latestAdBlocks.length+Math.ceil(r/this.adsPerPage);return await this.setAllAdsFetched(p<=f),i.mapAds(a)}return G.error("Invalid or empty response from ads"),await this.setAllAdsFetched(!0),[]}catch(a){return await this.setAllAdsFetched(!0),G.error("Failed to fetch ads",{error:a}),[]}}getDateOffset(e){return Ae[e]}getCategoryFilter(){return ve[this.selectedAdsCategory]}async handleLoadNextAds(){if(this.fetchingData)return;this.fetchingData=!0;const e=await this.retrieveAds(this.cursor,this.adsPerPage);await this.appendAdBlock(e),this.fetchingData=!1}};m([M({required:!0})],d.prototype,"section",2);m([O.Action("clearState")],d.prototype,"clearState",2);m([O.Action("setCursor")],d.prototype,"setCursor",2);m([O.Getter("getCursor")],d.prototype,"cursor",2);m([O.Getter("getAllAdsFetched")],d.prototype,"allAdsFetched",2);m([U.Getter("isMyNewsDisabled")],d.prototype,"myNewsDisabled",2);m([O.Getter("getAdBlocks")],d.prototype,"latestAdBlocks",2);m([Ge.Getter("currentPageContent")],d.prototype,"currentPageContent",2);m([U.Getter("getEdition")],d.prototype,"currentEdition",2);m([O.Action("setAllAdsFetched")],d.prototype,"setAllAdsFetched",2);m([O.Action("appendAdBlocks")],d.prototype,"appendAdBlocks",2);m([O.Action("appendAdBlock")],d.prototype,"appendAdBlock",2);m([ie("getPartialContent")],d.prototype,"getPartialContent",2);d=m([z({name:"AdsOverviewPage",components:{DnmIconLink:ne,DnmIcon:oe,DnmTeaserGrid:re,PaginationWrapper:ge,DnmContentWrapper:de,DnmDivider:T,DnmInputSelect:le,DnmButton:ce,AdsGrid:ke,DnmContentHeader:pe}})],d);const Se={class:"adsOverviewPage","data-testid":"ads-page-container"},Le={class:"adsOverviewPage__filterContainer"},Me=["value","selected"],Ne=["value","selected"];function Ie(t,e,s,a,i,r){var D;const n=y("DnmButton"),u=y("DnmContentHeader"),c=y("DnmInputSelect"),p=y("DnmDivider"),f=y("AdsGri
1d"),A=y("PaginationWrapper"),b=y("DnmContentWrapper");return h(),v(k,null,[_("header",null,[P(u,{"crop-description":!1,"has-stack":!!(t.sectionHeaderActions||t.secondaryActions.length),description:t.metaData.description,title:t.metaData.name,"primary-action":t.sectionHeaderActions,"render-logo":!((D=t.currentEdition)!=null&&D.hideVrmEndorsement),onOnPrimaryAction:t.toggleCurrentFavorite,class:"adsOverviewPage__header","data-testid":"ads-overview-page-header"},ue({_:2},[t.secondaryActions.length?{name:"secondaryActions",fn:g(({brightness:o})=>[(h(!0),v(k,null,F(t.secondaryActions,(l,B)=>(h(),L(n,{brightness:o,key:`adsOverviewPage-header-secondaryAction-${B}`,url:l.href,onOnClick:S=>t.navigate(l.href,l.newTab),size:"medium","icon-position-left":"","button-style":"tertiary"},{default:g(()=>[$(C(l.text),1)]),_:2},1032,["brightness","url","onOnClick"]))),128))]),key:"0"}:void 0]),1032,["has-stack","description","title","primary-action","render-logo","onOnPrimaryAction"])]),_("main",null,[_("section",Se,[P(b,{size:"large"},{default:g(()=>[_("div",Le,[P(c,{modelValue:t.selectedAdsDate,"onUpdate:modelValue":e[0]||(e[0]=o=>t.selectedAdsDate=o),class:"adsOverviewPage__dateInput"},{options:g(()=>[(h(!0),v(k,null,F(t.AdsDates,(o,l)=>(h(),v("option",{key:l,value:o,selected:o===t.selectedAdsDate,"data-testid":"fontSizeFlyout-font-size-items"},C(o),9,Me))),128))]),default:g(()=>[$(C(t.$t("adsOverviewPage.date"))+" ",1)]),_:1},8,["modelValue"]),P(c,{modelValue:t.selectedAdsCategory,"onUpdate:modelValue":e[1]||(e[1]=o=>t.selectedAdsCategory=o),class:"adsOverviewPage__categoryInput"},{options:g(()=>[(h(!0),v(k,null,F(t.AdsCategories,(o,l)=>(h(),v("option",{key:l,value:o,selected:o===t.selectedAdsCategory,"data-testid":"fontSizeFlyout-font-size-items"},C(o),9,Ne))),128))]),default:g(()=>[$(C(t.$t("adsOverviewPage.category"))+" ",1)]),_:1},8,["modelValue"]),P(n,{onOnClick:t.searchAdsWithFilters,class:"userCommentInfo__button","data-testid":"user-comment-info-login-button",size:"medium","icon-position-left":""},{icon:g(()=>[...e[2]||(e[2]=[_("span",null,null,-1)])]),default:g(()=>[$(C(t.$t("adsOverviewPage.filter"))+" ",1)]),_:1},8,["onOnClick"])]),P(A,{onOnButtonClick:t.handleLoadNextAds,"button-label":t.$t("adsOverviewPage.loadMore"),"hide-button":t.allAdsFetched,loading:t.fetchingData,class:"adsOverviewPage__paginationWrapper","content-wrapper-size":"large","data-testid":"latest-stories-pagination-wrapper","animate-new-elements":""},{default:g(()=>[(h(!0),v(k,null,F(t.latestAdBlocks,(o,l)=>(h(),v("div",{key:l},[l>0?(h(),L(p,{key:0,class:"adsOverviewPage__divider"})):q("",!0),P(f,{onOnAdClick:t.handleAdClick,ads:o,max:t.adsPerPage,class:"adsOverviewPage__adsContent"},{prefix:g(()=>[$(C(t.$t("adsOverviewPage.release")),1)]),_:1},8,["onOnAdClick","ads","max"])]))),128))]),_:1},8,["onOnButtonClick","button-label","hide-button","loading"])]),_:1})])])],64)}const ze=Y(d,[["render",Ie],["__scopeId","data-v-387f634f"]]);var W;try{"__c"in d&&((W=d.__c).componentFileName??(W.componentFileName=Object.create(null)),Object.defineProperty(d.__c,"componentFileName",{value:"app/pages/adsOverviewPage/AdsOverviewPage.vue"}))}catch(t){console.error("injectFileNamePlugin",t)}export{ze as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.