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

  `};export{f as default};
