import{template as o,WrapRenderChildren as r,RenderChildren as s,RenderIf as e,isLocalEnv as t,baseAssetURL as i}from"@gem-sdk/core";import a from"../arrow/Arrow.liquid.js";import l from"../dot/Dots.liquid.js";import{mappingNavigationCarousel as d}from"../arrow/common/helpers.js";import{getData as p}from"./common/helpers.js";import{getClass as n}from"./common/classes.js";import{getStyle as m}from"./common/styles.js";import{getAttr as c}from"./common/attrs.js";import{getStaticLocale as u,getSettingPreloadData as $}from"../../../helpers.js";let v=v=>{let{children:f,builderAttrs:g,builderProps:w,styles:h,isHiddenArrowWhenDisabled:S=!0,hiddenDotWhenOnlyOne:y,rootId:C,rawChildren:j,conditionAppendJs:k,productBadgeLiquid:E}=v,I=d(v.setting),A={...v,setting:I},{arrowButtonSize:G,arrowBackgroundColor:P,arrowGapToEachSide:T="16",roundedArrow:b,arrowIconSize:q,arrowCustomColor:x,arrowBorder:z,arrowShadow:B,showWhenHover:D}=I??{},{uniqueComponentId:O,loopConfig:W,arrowShowConfig:_,stateData:H}=p(A),{rootClassRender:M,wrapperClassRender:N,wrapperInnerClass:R,sliderClass:U}=n(A),{sliderWrapperStyle:V,rootStyleRender:F,wrapperStyleRender:J,wrapperInnerStyle:K}=m(A),{rootAttrRender:L,sliderAttr:Q}=c(A),X=()=>e(t,`<script ${$('class="gps-link" delay',"src")}="{{ 'gp-carousel-v3-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${$('class="gps-link" delay',"src")}="${i}/assets-v2/gp-carousel-v3-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`),Y=o=>a({uid:w?.uid,componentId:O,custom:I?.arrowCustom??"",showArrow:_,arrowButtonSize:G||{},arrowIconSize:q||{},arrowBackgroundColor:P??"",arrowCustomColor:x,gapToEachSize:T,showWhenHover:D,arrowBorder:z||{},arrowCorner:b||{},arrowShadow:B||{},left:"next"!==o,onClick:o=>{o.stopPropagation()},vertical:I?.vertical,isHiddenWhenDisabled:S,rootId:C});return o`
    <gp-carousel-v3 gp-data='${H}' ${L} style="${F}" class="${M}">
      <div
        ${g}
        class="${N}"
        style="${J}"
      >
        <div class="${R}" style="${K}">
          ${E??""}
          ${Y("prev")}
          <div ${Q} style="${V}">
            <div class="${U}">
              ${o`
    ${j?.length?r({uid:w?.uid??"",customProps:j[0]?.customProps},j.map((r,e)=>{if(r)return o`${s({...r,index:e,parentSettings:I,parentStyle:h,background:I?.background,parentUid:w?.uid})}`})):f??`<div>${u("Carousel","no_slider")}</div>`}`}
            </div>
          </div>
          ${Y("next")}
        </div>
        ${l({loop:W,showDots:I?.dot,dotStyle:I?.dotStyle,dotGapToCarousel:I?.dotGapToCarousel,vertical:I?.vertical,uniqueComponentId:O,hiddenWhenOnlyOne:y})}
      </div>
    </gp-carousel-v3>
    ${k?`{% if ${k} %} ${X()} {% endif %}`:X()}

  `};export{v as default};
