"use strict";var core=require("@gem-sdk/core"),types=require("../../types.js");const getTemplateByWidget=e=>e?.feraVersion===types.FERA_VERSION.V3?liquidTemplateFeraV3(e):liquidTemplateFeraV2(e),liquidTemplateFeraV2=e=>{let a=core.template`class="gp-flex gp-items-center" style="${{...core.makeStyleResponsive("jc",e?.align)}}"`;switch(e?.widgetType){case"productReviews":return`<div ${a} data-fera-container="${e?.productReviewsCode}" data-product_id="{{ product.id }}"></div>`;case"testimonialCarousel":return`<div ${a} data-fera-container="${e?.testimonialCarouselCode}"></div>`;case"allReviews":return`<div ${a} data-fera-container="${e?.allReviewsCode}"></div>`;case"averageStoreRatingBadge":return`<div ${a} data-fera-container="${e?.averageStoreRatingBadgeCode}"></div>`;case"inStoreMedia":return`<div ${a} data-fera-container="${e?.inStoreMediaCode}"></div>`;case"averageRatingBadge":return`<div ${a} data-fera-container="${e?.averageRatingBadgeCode}" data-product_id="{{ product.id }}"></div>`;case"productPageMedia":return`<div ${a} data-fera-container="${e?.productPageMediaCode}" data-product_id="{{ product.id }}"></div>`}return""},liquidTemplateFeraV3=e=>{let a=core.template`class="gp-flex gp-items-center" style="${{...core.makeStyleResponsive("jc",e?.align)}}"`;switch(e?.widgetTypeV3){case"productReviews":return`<div ${a} class="gp-flex gp-items-center" data-fera-container="product_reviews" data-product-id="{{ product.id }}"></div>`;case"testimonialCarousel":return`<div ${a} data-fera-widget="testimonial_carousel"></div>`;case"allReviews":return`<div ${a} data-fera-container="all_reviews"></div>`;case"mediaGallery":return`<div ${a} data-fera-container="store_customer_media"></div>`;case"productCollectionRating":return'<div data-fera-widget="product_collection_rating" data-rating-count="{{ product.metafields.reviews.rating_count }}" data-rating-average="{{ product.metafields.reviews.rating.value }}" data-product-id="{{ product.id }}"></div>';case"productDetailRating":return`<div ${a} data-fera-container="product_reviews_summary" data-product-id="{{ product.id }}"></div>`;case"otherWidget":return`${e?.otherWidgetCode}`}return""};exports.getTemplateByWidget=getTemplateByWidget;
