"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),helpers$1=require("../../helpers.js"),AdaptiveImage_liquid=require("./AdaptiveImage.liquid.js"),NextImage_liquid=require("./NextImage.liquid.js"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),attrs=require("../common/attrs.js"),helpers=require("../common/helpers.js");const Image=({style:e,styles:s,setting:t,advanced:a,className:r,pageContext:l,builderAttrs:i,builderProps:m})=>{let g=helpers.getSettingTranslatedImageAndSeo({setting:t,uid:m?.uid,pageContext:l}),{imageLink:d,isAdaptive:u,enableImageLink:y}=g??{},{enableLazyLoadImage:c}=l??{},{Wrapper:p,urlData:n}=helpers$1.getLinkData({defaultWrap:"div",setting:d,enableImageLink:y,isLiquid:!0}),o=system.createStyle(styles.getWrapperStyles(s)),q=system.createStyle(styles.getImageStyles(s,m)),I=system.createStyle(styles.getContainerStyles(e,s)),A=system.createClass(classes.getWrapperClasses()),$=system.createClass(classes.getImageClasses(r,s)),C=system.createClass(classes.getContainerClasses(m?.uid,a?.cssClass,s?.shape)),v=system.createAttr(attrs.getContainerAttrs(i,m?.uid)),j=attrs.getLinkWrapperAttrs({urlData:n,imageLink:d,title:g?.title,isLiquid:!0}),S=attrs.getAdaptiveImageAttrs({styles:s,setting:g,isLiquid:!0}),h=attrs.getNextImageAttrs({styles:s,setting:g}),f=attrs.getImageLiquidAttrs({pageContext:l,enableLazyLoadImage:c}),x=()=>system.If(u,AdaptiveImage_liquid.default({...f,...S,style:q,className:$}),NextImage_liquid.default({...f,...h,style:q,className:$})),L=()=>x();return core.template`
    <div
      role="presentation"
      ${{...v}}
      style="${I}"
      class="${C}"
    >
      <${p}
        ${j}
        style="${o}"
        class="${A}"
      >
        ${L()}
      </${p}>
    </div>
  `};exports.default=Image;
