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

  `};export{v as default};
