"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./HeroBannerItem.liquid.js"),t=require("../common/attrs.js"),r=require("../common/styles.js"),s=require("../common/classes.js"),a=require("@gem-sdk/system"),i=require("@gem-sdk/core"),n=require("../../helpers.js"),o=require("../common/helpers.js"),l=require("../settings/configs/translate.js");exports.default=d=>{let{builderAttrs:c,builderProps:g,setting:u,styles:p,style:f,children:v,advanced:b,pageContext:h}=d,{enableLink:S,enableParallax:m}=u??{},k=n.getBackgroundTranslated({background:p?.background,uid:g?.uid,enableTranslate:!!l.HeroBanner?.background?.id,pageContext:h??{},isTranslateVideo:!0}),y=o.getBannerLink(u),{cssClass:C}=b??{},{urlData:$}=n.getInsertLinkData("",y),j=a.createStateOrContext({background:o.getResponsiveSetting(k||{}),uid:g?.uid,enableParallax:m&&Number(u?.speedParallax||0)>0,speedParallax:Number(u?.speedParallax)||0,hoverEffect:p?.hoverEffect,hoverEffectScale:p?.hoverEffectScale,layout:u?.layout,contentPosition1Col:p?.contentPosition1Col,contentPosition2Col:p?.contentPosition2Col,aspectRatio:u?.aspectRatio,sizeSetting:o.getResponsiveSetting(p?.sizeSetting||{}),videoObjectFit:o.getResponsiveSetting(p?.videoObjectFit||{}),target:y?.target??"_self",href:$?.href??"",linkType:y?.type??"",hoverEffectDuration:p?.hoverEffectDuration,isYoutubeVideoMigrated:u?.isYoutubeVideoMigrated}),P=!!y?.link&&S,E=a.createAttr({...t.getAttr({uid:g?.uid||""})}),q=a.createAttr(t.getAttrLink()),x=a.createStyle({...r.getStyle(p,u,f)}),R=a.createClass({...s.getClasses({setting:u,builderProps:g,advancedCssClass:C})}),A=a.createClass({...s.getLinkClasses()}),I=()=>e.default({setting:u,translatedBackground:k,styles:p,children:v,rawChildren:d.rawChildren,builderProps:g,pageContext:h});return i.template`
      <gp-hero-banner
        ${{...c}}
        ${{...E}}
        class="${R}"
        style="${x}"
        gp-data='${i.dataStringify(j)}'
      >
        ${a.If(!P,I())}
        ${a.If(P,i.template`
          <div
            ${{...q}}
            aria-hidden="true"
            class="${A}"
          >
            ${I()}
          </div>`)}
      </gp-hero-banner>
       ${i.RenderIf(i.isLocalEnv,`<script ${n.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-hero-banner-v2-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${n.getSettingPreloadData('class="gps-link" delay',"src")}="${i.baseAssetURL}/assets-v2/gp-hero-banner-v2-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>
`)}
  `};
