(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[34],{351:function(t,e,n){"use strict";n.r(e),n.d(e,"Block",(function(){return m}));var c=n(0),a=n(1),r=n(4),s=n.n(r),o=n(26),i=n(89),l=n(51),u=n(86);n(381);const b=t=>({width:t/5*100+"%"}),p=t=>{let{parentClassName:e}=t;const n=b(0);return Object(c.createElement)("div",{className:s()("wc-block-components-product-rating__norating-container",e+"-product-rating__norating-container")},Object(c.createElement)("div",{className:"wc-block-components-product-rating__norating",role:"img"},Object(c.createElement)("span",{style:n})),Object(c.createElement)("span",null,Object(a.__)("No Reviews","woocommerce")))},d=t=>{const{rating:e,reviews:n,parentClassName:r}=t,o=b(e),i=Object(a.sprintf)(
/* translators: %f is referring to the average rating value */
Object(a.__)("Rated %f out of 5","woocommerce"),e),l={__html:Object(a.sprintf)(
/* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */
Object(a._n)("Rated %1$s out of 5 based on %2$s customer rating","Rated %1$s out of 5 based on %2$s customer ratings",n,"woocommerce"),Object(a.sprintf)('<strong class="rating">%f</strong>',e),Object(a.sprintf)('<span class="rating">%d</span>',n))};return Object(c.createElement)("div",{className:s()("wc-block-components-product-rating__stars",r+"__product-rating__stars"),role:"img","aria-label":i},Object(c.createElement)("span",{style:o,dangerouslySetInnerHTML:l}))},m=t=>{const{textAlign:e,shouldDisplayMockedReviewsWhenProductHasNoReviews:n}=t,a=Object(i.a)(t),{parentClassName:r}=Object(o.useInnerBlockLayoutContext)(),{product:l}=Object(o.useProductDataContext)(),b=(t=>{const e=parseFloat(t.average_rating);return Number.isFinite(e)&&e>0?e:0})(l),m=(t=>{const e=Object(u.a)(t.review_count)?t.review_count:parseInt(t.review_count,10);return Number.isFinite(e)&&e>0?e:0})(l),g=s()(a.className,"wc-block-components-product-rating",{[r+"__product-rating"]:r,["has-text-align-"+e]:e}),_=n?Object(c.createElement)(p,{parentClassName:r}):null,w=m?Object(c.createElement)(d,{rating:b,reviews:m,parentClassName:r}):_;return Object(c.createElement)("div",{className:g,style:a.style},Object(c.createElement)("div",{className:"wc-block-components-product-rating-stars__container"},w))};e.default=Object(l.withProductDataContext)(m)},381:function(t,e){}}]);