import{_ as L,bi as A,aY as b,o as n,c as o,i as m,b as w,d as T,a as y,F as C,r as D,n as h,k as U,t as S,v as _,l as x,f as F}from"./entry.DPwc-EV0.js";import{_ as B}from"./WebImage-BBQZzdK6.mjs";import{u as M}from"./useImageUrl-1XbeiwSF.mjs";const z={props:{imagePosition:{type:String,default:"none"},imageShaping:{type:String,default:"crop"},item:{type:Object,required:!0},showSummary:{type:Boolean,default:!0},hidePrimarySection:{type:Boolean},hidePublishedDate:{type:Boolean,default:!1},hideCompanyDate:{type:Boolean,default:!1},showDate:{type:Boolean,default:!0},displayFullHeadline:{type:Boolean,default:!1},itemMask:{type:Boolean,default:!1},pageCompanyName:{type:String},lazyLoadImage:{type:Boolean,default:!0},titleColor:{type:String,default:"#000000"},showUpcomingIndicator:{type:Boolean,default:!1}},data(){return{lockType:null}},computed:{cssVars(){return{"--image-width":this.imagePosition==="left"||this.imagePosition==="right"?`${this.$ss.contentStyle.smallImageWidth}px`:"100%","--image-height":this.imagePosition==="left"||this.imagePosition==="right"?"75px":"auto"}},containerQueryStyle(){const e=`${this.$ss.contentStyle.smallImageWidth+10}px`;return` `},upcoming(){const e=new Date().getTime();return this.showUpcomingIndicator&&this.item.startDate>e},useApStylePubDate(){return A},hasPrimarySection(){var e,a;return!!((a=(e=this.item)==null?void 0:e.primarySection)!=null&&a.alias)},companyAuthorLink(){var e,a,t,s,r,i;if(this.displayCompanyName&&!this.hideCompanyDate){const u=this.$ss.contentStyle.showCompanyDate;if(u==="author_company"){const c=((e=this.firstAuthor)==null?void 0:e.name)??((a=this.item.company)==null?void 0:a.name),d=c===((t=this.item.company)==null?void 0:t.name)?this.companyLink:(s=this.firstAuthor)==null?void 0:s.path;return{name:c,alias:d}}else if(u==="author_only"){const c=(r=this.firstAuthor)==null?void 0:r.name,d=(i=this.firstAuthor)==null?void 0:i.path;return{name:c,alias:d}}}return{}},imageAlt(){var e,a,t,s,r;return((a=(e=this==null?void 0:this.item)==null?void 0:e.primaryImage)==null?void 0:a.displayName)??((s=(t=this==null?void 0:this.item)==null?void 0:t.primaryImage)==null?void 0:s.alt)??((r=this.item)!=null&&r.nativeImagePath?this.item.nativeTitle:"")},imageUrl(){var t,s;if((t=this.item)!=null&&t.nativeImagePath)return this.item.nativeImagePath;const{src:e,isLogo:a}=((s=this.item)==null?void 0:s.primaryImage)??{};return e?M(e,this.imageShaping,a):""},primarySectionAlias(){var a,t,s,r;const e=(t=(a=this.item)==null?void 0:a.primarySection)==null?void 0:t.alias;return(!e.startsWith("http")&&!e.startsWith("/")?"/":"")+((r=(s=this.item)==null?void 0:s.primarySection)==null?void 0:r.alias)},firstAuthor(){var e,a,t;return(t=(a=(e=this.item)==null?void 0:e.authors)==null?void 0:a.edges[0])==null?void 0:t.node},firstContributor(){var e,a,t;return(t=(a=(e=this.item)==null?void 0:e.contributors)==null?void 0:a.edges[0])==null?void 0:t.node},title(){return this.item.nativeTitle??this.item.shortName??this.item.name},summary(){return this.item.nativeSummary??this.item.teaser},itemUrl(){var e,a,t,s;return((e=this.item)==null?void 0:e.nativeUrl)??((t=(a=this.item)==null?void 0:a.siteContext)==null?void 0:t.path)??((s=this.item)==null?void 0:s.alias)??`/${this.item.id}`??""},companyLink(){return this.item.company?`/${this.item.company.id}`:""},displayCompanyName(){var e;return((e=this.item.company)==null?void 0:e.name)!==this.pageCompanyName},getImagePosition(){return this.imagePosition||"none"}},async mounted(){var a,t,s,r,i,u;if((a=this.$ss.memberships)==null?void 0:a.showTitleLocks){const c=await b.membershipSystemActive();if(c){const d=c?b.isLoggedIn():!1;let g=!1;if(c&&((s=(t=this.item)==null?void 0:t.membership)!=null&&s.length)){const p=await b.getUserInfo();g=(d?(r=p==null?void 0:p.memberships)==null?void 0:r.filter(k=>{var l,I;const f=(I=(l=this.item)==null?void 0:l.membership)==null?void 0:I.map(P=>P.id);return f==null?void 0:f.includes(k)}):[]).length===0}await b.hasSiteLicenseCompany()&&(g=!1),this.lockType=(u=(i=this.item)==null?void 0:i.membership)!=null&&u.length?g?"lock":"unlock":null}}}},H={key:0,class:"mask"},N={key:2,class:"image-wrapper"},W={class:_(["text-box"])},V={key:0},O={key:0},Q=["href","target"],q=["href","target","rel"],E=["innerHTML"],R=["innerHTML"],j={key:0,class:"name"},G=["href"],Y=["innerHTML"];function J(e,a,t,s,r,i){var g,p,v,k,f;const u=x,c=B,d=F;return n(),o("div",{ref:"item",class:_(["ebm-content-item",i.imageUrl?"image-"+i.getImagePosition:"","section-"+e.$ss.contentStyle.sectionLocation]),style:h({display:i.getImagePosition==="above"||i.getImagePosition==="behind"?"block":"flex",flexDirection:i.getImagePosition==="right"?"row-reverse":"row",...i.cssVars})},[t.itemMask?(n(),o("div",H)):m("",!0),(g=t.item)!=null&&g.nativeImpressionTrackerUrl?(n(),w(u,{key:1,href:t.item.nativeImpressionTrackerUrl},null,8,["href"])):m("",!0),i.getImagePosition!=="none"&&i.imageUrl?(n(),o("div",N,[T(c,{image:i.imageUrl,alt:i.imageAlt,credit:t.item.primaryImage?t.item.primaryImage.credit:"","credit-position":"top","content-type":t.item.contentType||t.item.type,"image-link":i.itemUrl,"lazy-load":t.lazyLoadImage,"aspect-ratio":i.getImagePosition==="left"||i.getImagePosition==="right"?"small-teaser":"full-teaser"},null,8,["image","alt","credit","content-type","image-link","lazy-load","aspect-ratio"])])):m("",!0),y("div",W,[(n(!0),o(C,null,D((p=t.item)==null?void 0:p.labels,l=>(n(),o("div",{key:l,class:"sponsored",style:h({color:e.$ss.contentStyle.sponsoredTextColor,fontFamily:e.$ss.primaryFontFamily})},[l==="Sponsored"||l==="Members Only"||l==="Supported"||l==="Sponsored Video Training"||l==="Opinion"?(n(),o("span",V,[U(S(l)+" ",1),l!=="Opinion"?(n(),o("span",O,"Content")):m("",!0)])):m("",!0)],4))),128)),y("div",{style:h({display:"flex",flexDirection:e.$ss.contentStyle.sectionLocation==="top"?"column":"column-reverse"})},[i.hasPrimarySection&&!t.hidePrimarySection&&e.$ss.contentStyle.sectionLocation!=="none"?(n(),o("a",{key:0,class:"section-name",href:i.primarySectionAlias,target:i.primarySectionAlias.startsWith("http")?"_blank":"_self",style:h({fontFamily:e.$ss.primaryFontFamily,color:e.$ss.contentStyle.sectionColor})},S((v=t.item)==null?void 0:v.primarySection.name),13,Q)):m("",!0),y("div",null,[y("a",{href:i.itemUrl,target:i.itemUrl.startsWith(`https://www.${e.$ss.general.rootDomain}`)||i.itemUrl.startsWith("/")?"_self":"_blank",class:"title-wrapper",rel:(f=(k=t.item)==null?void 0:k.labels)!=null&&f.includes("Sponsored")?"sponsored":null,style:h({color:t.titleColor})},[y("h3",{class:_(["title-text-wrapper",[t.displayFullHeadline?"":"clamp-headline"]]),style:h({fontFamily:e.$ss.primaryFontFamily})},[r.lockType?(n(),w(d,{key:0,icon:`noto:${r.lockType}ed`,class:"lock","icon-color":"gold",width:18},null,8,["icon"])):m("",!0),!i.imageUrl&&i.getImagePosition!=="above"?(n(),o("div",{key:1,innerHTML:i.containerQueryStyle},null,8,E)):m("",!0),y("div",{class:_(["title-text",!i.imageUrl&&i.getImagePosition!=="above"?"items-with-images":""]),innerHTML:i.title},null,10,R)],6)],12,q),y("div",{style:h({display:"flex",flexDirection:e.$ss.contentStyle.dateLocation==="above_summary"?"column":"column-reverse"})},[i.useApStylePubDate(t.item)&&t.showDate&&e.$ss.contentStyle.dateLocation!=="none"?(n(),o("div",{key:0,class:"name-and-date",style:h({color:e.$ss.contentStyle.dateTextColor,fontFamily:e.$ss.primaryFontFamily})},[i.companyAuthorLink.name?(n(),o("div",j,[y("a",{href:i.companyAuthorLink.alias,style:h({color:e.$ss.baseStyles.linkColor})},S(i.companyAuthorLink.name),13,G)])):m("",!0),i.useApStylePubDate(t.item)&&!t.hidePublishedDate?(n(),o("div",{key:1,class:_(["date",i.upcoming?"upcoming":""]),style:h({backgroundColor:i.upcoming?e.$ss.baseStyles.primaryColor:"inherit"})},S(i.useApStylePubDate(t.item))+" "+S(`${i.upcoming?"- Upcoming":""}`),7)):m("",!0)],4)):m("",!0),t.showSummary?(n(),o("div",{key:1,class:"teaser-text",innerHTML:i.summary??""},null,8,Y)):m("",!0)],4)])],4)])],6)}const $=L(z,[["render",J]]);export{$ as _};