var StampedCarouselFn = function (C, E) { var F, z, P, N, T, q, D, V = [], W = /iPhone|iPod|Android/i.test(navigator.userAgent); return String.prototype.format = function () { for (var t = this, a = 0; a < arguments.length; a++)var e = new RegExp("\\{" + a + "\\}", "gi"), t = t.replace(e, arguments[a]); return t }, { init: function (t, a, e) { q = e, F = (D = a).data("per-slide"), z = 1 == a.data("auto-play"), P = (P = a.data("auto-play-speed") || 1e4) < 1e3 ? 1e3 * P : P; var r = a.attr("data-store-url"), s = (a.attr("data-show-avatar"), a.data("hi-res") || "high" == a.data("resolution")), l = 1 == a.data("is-widget-total"), i = a.data("random"), o = "true" == a.attr("data-rich-snippet-force"); a.attr("data-rating-all", t.ratingAll); var d = a.data("take"), p = '#stamped-reviews-widget[data-widget-type="carousel"]', c = a.data("style-color-title"), n = a.data("style-color-text"), m = a.data("style-color-link"), u = a.data("style-color-star"), h = !1; if (C.LazyLoadStamped && LazyLoadStamped.update && 1 != C.LazyLoadStampedDisabled && (h = !0), e = "", c && (e += p + " .stamped-style-color-title { color:" + c + " !important; }"), n && (e += p + " .stamped-style-color-text { color:" + n + " !important; }"), m && (e += p + " .stamped-style-color-link { color:" + m + " !important; }"), u && (e += p + " .stamped-style-color-star i { color:" + u + " !important; }"), e && q(a).append(""), T = a.data("link"), F = F || 3, V = t.data, i && (V = function (t) { for (var a = t.length - 1; 0 < a; a--) { var e = Math.floor(Math.random() * (a + 1)), r = t[a]; t[a] = t[e], t[e] = r } return t }(V)), V.length <= 0) q(a).hide(); else { var i = t.totalAllWithNPS, g = t.ratingAll; 1 == l && (i = t.total, g = t.rating), 1 == o && (o = "/" == location.pathname, 0 < i && !o && (o = { "@context": "http://schema.org", "@type": "Product", aggregateRating: { "@type": "AggregateRating", bestRating: "5", worstRating: "1", reviewCount: i, ratingValue: t.rating, itemReviewed: t.shop }, name: t.shop }, (t = E.createElement("script")).type = "application/ld+json", t.innerHTML = JSON.stringify(o), E.getElementsByTagName("head")[0].appendChild(t))); var v = Math.floor(100 / F), f = "", d = d || 30, w = V.length >= d ? d : V.length, y = 0, k = 100, d = q(a).attr("data-title"); d && q(".stamped-carousel-title", a).html(d); for (var S = "", b = 5; .01 <= g || 0 < b;)S += .9 <= g ? '' : .5 <= g && g < .9 ? '' : '', g--, b--; q(".stamped-carousel-stars-wrapper", a).html(""), q(".stamped-carousel-stars-wrapper", a).html(S); for (var x, I = 0; I < w; I++) { ++y == F ? (v = k, k = 100, y = 0) : k -= v = Math.floor(100 / F); for (var L = '
{7}
{0}
Product Image
{4}
{5}
{6}
', S = "", M = parseInt(V[I].reviewRating); 0 < M;)S += '', M--; for (var U = 5 - parseInt(V[I].reviewRating); 0 < U;)S += '', U--; r && (V[I].productUrl = V[I].productUrl + "?storeUrl=" + r), V[I].productImageUrl && (1 == s && (V[I].productImageUrl = V[I].productImageLargeUrl), V[I].productImageUrl = V[I].productImageUrl.replace("%3F", "?")), f += L.format(S, V[I].reviewTitle, V[I].productUrl, V[I].productImageUrl, V[I].productName, V[I].reviewMessage, V[I].author, V[I].reviewDate, V[I].reviewVerifiedType, V[I].location, V[I].source) } q(".stamped-carousel-scroll-wrapper", a).html(f), q(".stamped-carousel-subtitle span.stamped-carousel-subtitle-count", a).html(i), T && (i = q(".stamped-carousel-subtitle", a).html(), i = '' + i + "", q(".stamped-carousel-subtitle", a).html(i)), W || 1 == F ? (x = q(".block", a).eq(0).height(), q(".stamped-carousel-scroll", a).attr("style", "height: " + (x + 50) + "px")) : (x = Math.max.apply(null, q(".block", a).slice(0, 2).map(function () { return q(this).height() }).get()), q(".stamped-carousel-scroll", a).attr("style", "height: " + (x + 70) + "px")); try {q("#stamped-carousel-scroll-wrapper .block[data-review-source='5']").each(function () { var blockElement = q(this); var shopAppVerifiedImage = blockElement.find(".shopapp-verified"); shopAppVerifiedImage.show(); }); } catch { console.log("Shop Verified not loaded")} try { StampedFn.triggerEvent("stamped:widget:carousel:loaded") } catch (t) { } 1 == z && (N = setInterval(function () { StampedCarouselFn.switchSlide(a, 1) }, P)); q(a)[0].addEventListener("touchstart", function (t) { if (!q(t.target).closest('#stamped-reviews-widget[data-widget-type="carousel"]').length) return; R = t.touches[0].clientX, A = t.touches[0].clientY }, !1), q(a)[0].addEventListener("touchmove", function (t) { if (!R || !A) return; var a = t.touches[0].clientX, e = t.touches[0].clientY, a = R - a, e = A - e; Math.abs(a) > Math.abs(e) && (0 < a ? StampedCarouselFn.switchSlide(t.target, 1, !0) : StampedCarouselFn.switchSlide(t.target, -1, !0)); A = R = null }, !1); var R = null, A = null; h && LazyLoadStamped.update() } }, switchSlide: function (t, a, e) { 1 == e && clearInterval(N); var r = 1, s = q(t).closest("#stamped-reviews-widget"), l = s.find("#stamped-carousel-scroll-wrapper"); F = q(s).data("per-slide") || 3; var i = q(s).attr("data-rtl"); if (q(s).attr("data-page") && (r = parseInt(q(s).attr("data-page"))), e = q('div[class="block"]', l).length, t = 0 < e ? Math.ceil(e / F) : 0, W && (t = e), r == t && 1 == a) return D.find("#stamped-carousel-scroll-wrapper").attr("style", "left: 0px"), void D.attr("data-page", 1); 0 == (r += a) && (r = 1), q(s).attr("data-page", r); var o, a = l[0].offsetWidth * (r - 1); l.attr("style", "left: " + ("true" == i ? "" : "-") + a + "px"), W || 1 == F ? (o = q(".block", s).eq(r - 1).height(), q(".stamped-carousel-scroll", s).attr("style", "height: " + (o + 50) + "px")) : (o = (r - 1) * F, r = r * F, r = Math.max.apply(null, q(".block", s).slice(o, r).map(function () { return q(this).height() }).get()), q(".stamped-carousel-scroll", s).attr("style", "height: " + (r + 70) + "px")) } } }(window, document);