"use strict";const t=`
  {% assign random_number = "now" | date: "%N" | modulo: 1000 | plus: 0 %}
  <script>
    var sectionConfig = (typeof sectionConfig == "undefined" || sectionConfig == null) ? {} : sectionConfig;
    var scmCustomData = (typeof scmCustomData == "undefined" || scmCustomData == null) ? {} : scmCustomData;
    var scmCustomDataWigetAll = (typeof scmCustomDataWigetAll == "undefined" || scmCustomDataWigetAll == null) ? [] : scmCustomDataWigetAll;
    scmCustomDataWigetAll['{{ random_number }}'] = {
      "id_iframe" : "{{ random_number }}",
      "productId" : "{{ product.id }}",
      "typePage" : 'productPage',
      "sectionConfig" : JSON.stringify(sectionConfig),
      "scmCustomData" : JSON.stringify(scmCustomData),
      'dataProduct' : []
    };
    sectionConfig= null;
    scmCustomData= null;
    scmCustomDataWigetAll['{{ random_number }}'].dataProduct['product']= {{ product | json }};
    {% for metafieldValue in product.metafields.scm_review_importer %}
      scmCustomDataWigetAll['{{ random_number }}'].dataProduct['{{ metafieldValue[0] }}'] = \`{{ metafieldValue[1] | json }}\`;
    {% endfor %}
  </script>
  <div class="scm-container" style="display: none;">
      <div class="scm-reviews-importer" data-product-id="{{ product.id }}">
          <iframe class="scm-reviews-importer-iframe" width="100%" title="Sma reviews section Product page" data-idIframe="{{ random_number }}"></iframe>
      </div>
  </div>
`,e=`
  <div class="scm-reviews-rate" data-rate-version2="{{ product.metafields.scm_review_importer.reviewsData.reviewCountInfo | json | escape}}" data-product-id="{{ product.id }}"></div>
`,a=`
  <script>var sectionConfig={ "type_layout" : "cardCarousel", "source" : "default_layout"};</script>{% assign random_number = "now" | date: "%N" | modulo: 1000 | plus: 0 %}<script>var sectionConfig=  (typeof sectionConfig == "undefined" || sectionConfig == null) ? {} : sectionConfig;var scmCustomData= (typeof scmCustomData == "undefined" || scmCustomData == null) ? {} : scmCustomData;var scmCustomDataWigetAll= (typeof scmCustomDataWigetAll == "undefined" || scmCustomDataWigetAll == null) ? [] : scmCustomDataWigetAll; scmCustomDataWigetAll['{{ random_number }}'] ={ "id_iframe" : "{{ random_number }}","productId" : "","typePage" : 'homePage',"sectionConfig" : JSON.stringify(sectionConfig),"scmCustomData" : JSON.stringify(scmCustomData),'dataProduct' : []};sectionConfig= null;scmCustomData= null;</script><div class="scm-container" style="display: none;"><div class="scm-reviews-importer"><iframe class="scm-reviews-importer-iframe" width="100%" title="Sma reviews section Home Page" data-idIframe="{{ random_number }}"></iframe></div></div>
`,s=`
  <script>var sectionConfig={ "type_layout" : "testimonial", "source" : "default_layout"};</script>{% assign random_number = "now" | date: "%N" | modulo: 1000 | plus: 0 %}<script>var sectionConfig=  (typeof sectionConfig == "undefined" || sectionConfig == null) ? {} : sectionConfig;var scmCustomData= (typeof scmCustomData == "undefined" || scmCustomData == null) ? {} : scmCustomData;var scmCustomDataWigetAll= (typeof scmCustomDataWigetAll == "undefined" || scmCustomDataWigetAll == null) ? [] : scmCustomDataWigetAll; scmCustomDataWigetAll['{{ random_number }}'] ={ "id_iframe" : "{{ random_number }}","productId" : "","typePage" : 'homePage',"sectionConfig" : JSON.stringify(sectionConfig),"scmCustomData" : JSON.stringify(scmCustomData),'dataProduct' : []};sectionConfig= null;scmCustomData= null;</script><div class="scm-container" style="display: none;"><div class="scm-reviews-importer"><iframe class="scm-reviews-importer-iframe" width="100%" title="Sma reviews section Home Page" data-idIframe="{{ random_number }}"></iframe></div></div>
`,i=`
  <script>var sectionConfig={ "type_layout" : "gallery", "source" : "default_layout"};</script>{% assign random_number = "now" | date: "%N" | modulo: 1000 | plus: 0 %}<script>var sectionConfig=  (typeof sectionConfig == "undefined" || sectionConfig == null) ? {} : sectionConfig;var scmCustomData= (typeof scmCustomData == "undefined" || scmCustomData == null) ? {} : scmCustomData;var scmCustomDataWigetAll= (typeof scmCustomDataWigetAll == "undefined" || scmCustomDataWigetAll == null) ? [] : scmCustomDataWigetAll; scmCustomDataWigetAll['{{ random_number }}'] ={ "id_iframe" : "{{ random_number }}","productId" : "","typePage" : 'homePage',"sectionConfig" : JSON.stringify(sectionConfig),"scmCustomData" : JSON.stringify(scmCustomData),'dataProduct' : []};sectionConfig= null;scmCustomData= null;</script><div class="scm-container" style="display: none;"><div class="scm-reviews-importer"><iframe class="scm-reviews-importer-iframe" width="100%" title="Sma reviews section Home Page" data-idIframe="{{ random_number }}"></iframe></div></div>
`,o=`
  <script>var sectionConfig={ "type_layout" : "grid", "source" : "default_layout"};</script>{% assign random_number = "now" | date: "%N" | modulo: 1000 | plus: 0 %}<script>var sectionConfig=  (typeof sectionConfig == "undefined" || sectionConfig == null) ? {} : sectionConfig;var scmCustomData= (typeof scmCustomData == "undefined" || scmCustomData == null) ? {} : scmCustomData;var scmCustomDataWigetAll= (typeof scmCustomDataWigetAll == "undefined" || scmCustomDataWigetAll == null) ? [] : scmCustomDataWigetAll; scmCustomDataWigetAll['{{ random_number }}'] ={ "id_iframe" : "{{ random_number }}","productId" : "","typePage" : 'homePage',"sectionConfig" : JSON.stringify(sectionConfig),"scmCustomData" : JSON.stringify(scmCustomData),'dataProduct' : []};sectionConfig= null;scmCustomData= null;</script><div class="scm-container" style="display: none;"><div class="scm-reviews-importer"><iframe class="scm-reviews-importer-iframe" width="100%" title="Sma reviews section Home Page" data-idIframe="{{ random_number }}"></iframe></div></div>
`,n=`
  {% capture laisnippet %}
    {% render "lai-home-page" %}
  {% endcapture %}
  {% unless laisnippet contains "Liquid error" %}
      {{ laisnippet }}
  {% endunless %}
`,m=`
  {% capture laisnippet %}
    {% render "reviews-happy-page" %}
  {% endcapture %}
  {% unless laisnippet contains "Liquid error" %}
      {{ laisnippet }}
  {% endunless %}
`,r=`
  <div class="scm-reviews-rate"
    data-rate-version2="{{ product.metafields.scm_review_importer.reviewsData.reviewCountInfo | json | escape }}"
    data-product-id="{{ product.id }}"></div>
`;exports.getTemplateByWidget=c=>{let d=c?.widgetType??"reviews_widget",u=c?.advancedWidgetType??"mediaGallery";return"advanced_widget"===d?({cardCarousel:a,testimonialCarousel:s,mediaGallery:i,cardGrid:o})[u]:({reviews_widget:t,star_ratings:e,homepage_reviews:n,happy_customer_reviews:m,star_ratings_in_list:r})[d]};
