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