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