import{_ as S,Z as w,c as s,o as l,a as n,v as y,f as p,e as b,V as c,E as g,$ as k,a0 as D,J as x,n as m,t as _}from"./C9ygSJ6z.js";const B={components:{DsCta:w},props:{attributes:{type:Object,default:null},image:{type:Object,default:null},id:{type:String,default:null},media:{type:Object,default:null},isNested:{type:Boolean,default:!1},equalHeight:{type:Boolean,default:!1},video:{type:Object,default:null},functions:{type:Object,required:!0},layoutSize:{type:String,default:"large"}},data(){return{track:{category:"",action:"",label:"",tintValue:""},isBanner:!1,isBannerSmall:!1,uri:"",isPlaying:!0}},computed:{viewMode(){var e,i;return((i=(e=this.meta)==null?void 0:e.options)==null?void 0:i.view_mode)||"default"},alignText(){var e;return(e=this.attributes)!=null&&e.field_text_alignment?`align-${this.attributes.field_text_alignment.toLowerCase()}`:"align-left"},heading(){return this.$getHeadingLevel(this.isNested)||""},bgProps(){var i,a,u,r,t,o,h,d,f,v;const e=(a=(i=this.video)==null?void 0:i.uri)!=null&&a.url?(u=this.video)==null?void 0:u.uri.url:(r=this.image)!=null&&r.meta&&this.isBanner?this.image.meta.derivatives.banner.url:(t=this.image)!=null&&t.meta&&this.isBannerSmall?(f=(d=(h=(o=this.image)==null?void 0:o.meta)==null?void 0:h.derivatives)==null?void 0:d.banner_small)==null?void 0:f.url:null;return this.$mxGetDynamicStyles({bgUrl:e||"",tintValue:(v=this.attributes)!=null&&v.field_opacity?this.attributes.field_opacity/10:0},"background-image")},bgImageUrl(){var a,u,r,t;let e;return(t=(r=(u=(a=this.image)==null?void 0:a.meta)==null?void 0:u.derivatives)==null?void 0:r.highlight)!=null&&t.url?e=this.image.meta.derivatives.highlight.url:this.image!=null&&this.image.uri.url&&this.image.uri.url!=null&&(e=this.image.uri.url),this.image&&this.image.filemime=="image/gif"?this.image.uri.url:e},videoAvailable(){var i,a;let e;return(a=(i=this.video)==null?void 0:i.uri)!=null&&a.url?e=!0:e=!1,e},videoDuration(){var e,i;return(e=this.media)!=null&&e.field_video_duration&&((i=this.media)==null?void 0:i.field_video_duration)||""},videoTitle(){var e;return(e=this.media)!=null&&e.field_video_label&&this.media.field_video_label||""},setVideoSrc(){var e,i;return this.videoAvailable?this.$normalizedAssetUrl((i=(e=this.video)==null?void 0:e.uri)==null?void 0:i.url):""},colorScheme(){return this.functions.colorScheme()}},created(){this.tintValue=this.attributes.field_opacity?this.attributes.field_opacity/10:0},mounted(){this.$applyTrackingToDescription(this.$refs.description),this.checkDerivative()},methods:{togglePlay(){const e=this.$refs.videoBanner;e&&(e.paused?(e.play(),this.isPlaying=!0):(e.pause(),this.isPlaying=!1),this.$mxDsEvents("accessibility","highlight-video",`${this.isPlaying?"play":"pause"}`))},checkDerivative(){this.layoutSize=="large"||this.layoutSize=="x-large"||this.layoutSize=="full-width"?(this.isBanner=window.innerWidth>=992,this.isBannerSmall=window.innerWidth<992):this.layoutsize=="medium"?(this.isbanner=window.innerwidth>=1600,this.isBannerSmall=window.innerWidth<1600):(this.layoutsize=="small"||this.layoutsize=="x-small")&&(this.isbannersmall=!0)},ctaaction(e,i){this.$mxdsevents(i.category,".pdf",this.attributes.title),window.open(e)}}},z=["poster","src"],c=["innerhtml"],p={key:0,class:"icon Icon--pause text-[var(--color-white)]"},V={key:1,class:"Icon Icon--play text-[var(--color-white)]"};function A(e,i,a,u,r,t){const o=_("DsCta"),h=_("GlobalEvents");return l(),s("div",{style:c([t.bgProps,t.colorScheme]),class:m([[{"default-full-isVideo":""],"ds-highlight-default"])},[t.videoAvailable?(l(),s("video",{key:0,ref:"videoBanner",poster:e.$normalizedAssetUrl(t.bgImageUrl),src:t.setVideoSrc,class:"ds-default-video-bg",autoplay:"",muted:"",loop:"","aria-hidden":"true"},null,8,z)):n("",!0),y("div",{class:m([t.alignText,"ds-highlight__wrapper-default"])},[y("div",null,[a.attributes.field_info1_label?(l(),s("div",{key:0,style:c(t.colorScheme),class:"ds-highlight-category"},g(a.attributes.field_info1_label),5)):n("",!0),e.$hide(a.attributes.title)?(l(),b(x(t.heading),{key:1,class:"ds-highlight-title"},{default:k(()=>[D(g(e.$isParenthesis(a.attributes.title)),1)]),_:1})):n("",!0),a.attributes.field_body&&a.attributes.field_body.processed?(l(),s("div",{key:2,ref:"description",class:"ds-highlight-desc",innerHTML:a.attributes.field_body.processed},null,8,C)):n("",!0),t.videoDuration!=""&&t.videoDuration!=null?(l(),s("div",{key:3,style:c(t.colorScheme),class:"ds-highlight-duration"}," Duration "+g(t.videoDuration),5)):n("",!0)]),a.attributes.field_ctas&&a.attributes.field_ctas.length>0?(l(),b(o,{key:0,attributes:a.attributes,class:m([t.alignText,"ds-highlight-cta"])},null,8,["attributes","class"])):n("",!0)],2),t.videoAvailable?(l(),s("button",{key:1,class:"play-pause-highlight absolute inline-flex size-[32px] items-center justify-center self-end rounded-full border-[2px] bg-transparent text-[var(--color-white)] !outline-none hover:bg-[var(--color-white)]",onClick:i[0]||(i[0]=(...d)=>t.togglePlay&&t.togglePlay(...d))},[r.isPlaying?(l(),s("i",P)):(l(),s("i",V))])):n("",!0),p(h,{target:"window",onResize:i[1]||(i[1]=d=>t.checkDerivative())})],6)}const I=S(B,[["render",A]]);export{I as default};