"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),Row_liquid=require("../../grid/components/row/Row.liquid.js"),system=require("@gem-sdk/system"),AdaptiveImage_liquid=require("../../image/components/AdaptiveImage.liquid.js"),HTML5Embed_liquid=require("../../video/components/HTML5Embed.liquid.js"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),helpers=require("../common/helpers.js"),helpers$2=require("../../image/common/helpers.js"),NextImage_liquid=require("../../image/components/NextImage.liquid.js"),LiteYouTubeEmbed_liquid=require("../../video/components/LiteYouTubeEmbed.liquid.js"),helpers$4=require("../../video/common/helpers.js"),helpers$3=require("../../grid/components/row/common/helpers.js"),constants=require("../../image/constants.js"),helpers$1=require("../../helpers.js");const HeroBannerItem=e=>{let{enableLazyLoadImage:s=!0,translatedBackground:t,setting:l,styles:a,children:r,builderProps:i,rawChildren:o,pageContext:d}=e,{layout:u,verticalAlign:c,enableParallax:n,alt:m,title:g,preload:p,isYoutubeVideoMigrated:y}=l??{},{background:h,overlayColor:C,verticalGutter:v,sizeSetting:q,contentWidth:S,hoverEffect:I,contentPosition1Col:b,contentPosition2Col:$,videoObjectFit:f}=a??{},T=!p&&s,j=helpers.getAspectRatio(q,h),R=helpers.getYoutubeAspectRatio(h,f,j),B=helpers.getResponsiveSetting(t||{}),k=B.desktop,A=system.createStyle({...styles.getContainerStyle(a)}),_=system.createClass({...classes.getContainerClasses(l,a)}),w=system.createStyle({...styles.getOverlayStyle(a)}),H=system.createClass({...classes.getOverlayClasses(a)}),V=system.createStyle({...styles.getRowStyle(a)}),x=system.createClass({...classes.getRowClasses(a,l)}),L=system.createStyle({...styles.getAdaptiveStyle(a)}),E=system.createClass({...classes.getAdaptivePictureClasses()}),Y=system.createClass({...classes.getAdaptiveClasses()}),N=system.createClass({...classes.getBackgroundClasses(I,T)}),z=system.createStyle({...helpers.getBackgroundImageHeroBanner(t,T,!1),...styles.getBackgroundStyle(a,n,"")}),O=system.createClass({...classes.getContainBackgroundClasses()}),D=system.createStyle({...styles.getContainBackgroundStyle(a)}),M=system.createClass({...classes.getHtml5VideoClasses(!1)}),P=system.createStyle({...styles.getYoutubeIframeStyle(R,f)}),W=system.createClass({...classes.getWrapperYoutubeClasses(y)}),G=system.createStyle({...styles.getHtml5VideoStyle(j,f,h)}),U=system.createClass({...classes.getIframeYoutubeClasses()}),F=e=>system.createClass({...classes.getLazyBackgroundClasses(e)}),J=()=>{if(!p)return core.DEVICES.map(e=>system.If(helpers.getEnableBgImageByDevice(e,t),NextImage_liquid.default({src:helpers$2.getImageSrc(core.getResponsiveValueByScreen(helpers.getBgImage(t),e),e),alt:helpers$1.getSeoTranslated({valueTranslate:m,uid:i?.uid,settingId:"alt",pageContext:d??{}}),title:helpers$1.getSeoTranslated({valueTranslate:g,uid:i?.uid,settingId:"title",pageContext:d??{}}),className:F(e),isDisableAspectStyle:!0,enableLazyLoadImage:s}))).join("")},K=()=>{if(!helpers.showVideoType(h))return;if(helpers$3.isRenderHtmlVideo(h))return HTML5Embed_liquid.default({uid:i?.uid,muted:!0,loop:k?.loop,controls:!1,autoplay:!0,src:k?.videoHtml5||"",title:"Video",style:G,className:M});let e=k?.video??"",s=helpers$4.getYoutubeVideoId(e),t=`&loop=false&playlist=${s}&showinfo=0&rel=0&fs=0&enablejsapi=1`,l=core.hasTranslatedLiquid(e);if(k?.type==="video"&&k?.videoType==="youtube"&&s&&helpers$4.youtubeVideoRegex.test(e)||l)return LiteYouTubeEmbed_liquid.default({uid:i?.uid,id:s??"",translatedVideoUrl:l?e:"",isHeroBanner:!0,autoplay:!0,title:"Video",controls:!1,params:t,adNetwork:!1,noCookie:!0,muted:!0,lazy:k?.lazyLoad??!0,preload:!0,style:P,wrapperClass:W,iframeClass:U})};return core.template`
  <div class="${_}" style="${A}">
      <div
        class="${O}"
        style="${D}"
      >
        <div class="${N}" style="${z}">
          ${J()}
          ${K()}
        </div>
        ${system.If(!!C,core.template`<div aria-label="Overlay" class="${H}" style="${w}"> </div>`)}
      </div>
      ${Row_liquid.default({className:x,style:V,setting:{layout:u,horizontalAlign:helpers.horizontalAlign(u,b,$),verticalAlign:c},styles:{verticalGutter:v,width:helpers.getWidth(S),fullWidth:{desktop:!1,tablet:!1,mobile:!1}},children:r,rawChildren:o})}
        ${AdaptiveImage_liquid.default({pictureClass:E,srcSet:helpers.getBgImage(t),className:Y,...p&&constants.PRIORITY_LOAD_ATTRS,aspectRatio:core.getAspectRatioGlobalSize(q),style:L,alt:helpers$1.getSeoTranslated({valueTranslate:m,uid:i?.uid,settingId:"alt",pageContext:d??{}}),title:helpers$1.getSeoTranslated({valueTranslate:g,uid:i?.uid,settingId:"title",pageContext:d??{}}),enableLazyLoadImage:s,fallbackImg:helpers.fallbackImg})}
  </div>
`};exports.default=HeroBannerItem;
