"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),t=require("./common/styles.js"),i=require("./common/classes.js"),s=require("./common/attrs.js"),r=require("./ProductListGridItem.liquid.js"),d=require("../../../helpers.js");exports.default=o=>{let{setting:a,builderProps:l,styles:n,productListId:u,productSrc:c}=o,{gridLayoutStyle:p}=t.getStyle(o),{gridLayoutClass:g}=i.getClass(o),{productListAttr:m}=s.getAttr(o),f=()=>e.template`
      {%- assign count = 0 -%}
      {%- for product in products limit: limit -%}
      {%- if product.id != empty -%}
      {%- assign count = count | plus: 1 -%}
      {%- assign variant = product.selected_or_first_available_variant -%}
      {%- assign product_form_id = 'product-form-' | append: "${l?.uid}" | append: product.id -%}
        ${r.default({...o})}
      {%- endif -%}
      {% endfor %}
      {%- if count == 0 and ${u?.length} == 0 -%}
        {% if '${c}' == 'RelatedProduct' -%}
          <div>${d.getStaticLocale("ProductList","no_related_products")}</div>
        {% else %}
          <div>${d.getStaticLocale("ProductList","no_products_found")}</div>
        {%- endif -%}
      {%- endif -%}
    `;return e.template`
    <div
      ${m}
      style="${p}"
      class="${g}"
    >
      ${e.RenderIf(a?.sameHeight,e.template`
      <gp-same-height
        class="gp-contents"
        style="visibility: hidden"
        gp-data='${JSON.stringify({targetUid:l?.builderData?.childrens?.[0],slidesToShow:a?.slidesToShow,rowGap:n?.horizontalGutter})}'>
        ${`${f()}`}
      </gp-same-height>
    `)}
      ${e.RenderIf(!a?.sameHeight,e.template`${f()}`)}
    </div>
  `};
