(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[73],{113:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(24),o=n(22);const c=t=>Object(r.a)(t)?JSON.parse(t)||{}:Object(o.a)(t)?t:{}},22:function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return o}));const r=t=>!(t=>null===t)(t)&&t instanceof Object&&t.constructor===Object;function o(t,e){return r(t)&&e in t}},285:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(64),o=n(22),c=n(113);const s=t=>{const e=Object(o.a)(t)?t:{},n=Object(c.a)(e.style);return Object(r.__experimentalUseColorProps)({...e,style:n})}},289:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(22),o=n(24),c=n(113);const s=t=>{const e=Object(r.a)(t)?t:{},n=Object(c.a)(e.style),s=Object(r.a)(n.typography)?n.typography:{},a=Object(o.a)(s.fontFamily)?s.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:a,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight,letterSpacing:s.letterSpacing,lineHeight:s.lineHeight,textDecoration:s.textDecoration,textTransform:s.textTransform}}}},306:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(64),o=n(22),c=n(113);const s=t=>{if("function"!=typeof r.__experimentalGetSpacingClassesAndStyles)return{style:{}};const e=Object(o.a)(t)?t:{},n=Object(c.a)(e.style);return Object(r.__experimentalGetSpacingClassesAndStyles)({...e,style:n})}},355:function(t,e){},384:function(t,e,n){"use strict";n.r(e),n.d(e,"Block",(function(){return d}));var r=n(0),o=n(1),c=n(6),s=n.n(c),a=n(51),i=n(285),u=n(289),l=n(306),f=n(133),p=n(89);n(355);const b=t=>{const{rating:e,reviews:n,parentClassName:c}=t,a={width:e/5*100+"%"},i=Object(o.sprintf)(
/* translators: %f is referring to the average rating value */
Object(o.__)("Rated %f out of 5","woocommerce"),e),u={__html:Object(o.sprintf)(
/* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */
Object(o._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(o.sprintf)('<strong class="rating">%f</strong>',e),Object(o.sprintf)('<span class="rating">%d</span>',n))};return Object(r.createElement)("div",{className:s()("wc-block-components-product-rating__stars",c+"__product-rating__stars"),role:"img","aria-label":i},Object(r.createElement)("span",{style:a,dangerouslySetInnerHTML:u}))},g=t=>{const{href:e}=t,n=Object(o.__)("Add review","woocommerce");return e?Object(r.createElement)("a",{className:"wc-block-components-product-rating__link",href:e},n):null},d=t=>{const{textAlign:e}=t,{parentClassName:n}=Object(a.useInnerBlockLayoutContext)(),{product:o}=Object(a.useProductDataContext)(),c=(t=>{const e=parseFloat(t.average_rating);return Number.isFinite(e)&&e>0?e:0})(o),f=Object(i.a)(t),d=Object(u.a)(t),j=Object(l.a)(t),O=(t=>{const e=Object(p.a)(t.review_count)?t.review_count:parseInt(t.review_count,10);return Number.isFinite(e)&&e>0?e:0})(o),m=(t=>{const{permalink:e}=t;return e+"#reviews"})(o),y=s()(f.className,"wc-block-components-product-rating",{[n+"__product-rating"]:n,["has-text-align-"+e]:e}),_=O?Object(r.createElement)(b,{rating:c,reviews:O,parentClassName:n}):Object(r.createElement)(g,{href:m});return Object(r.createElement)("div",{className:y,style:{...f.style,...d.style,...j.style}},_)};e.default=Object(f.withProductDataContext)(d)},6:function(t,e,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var t=[],e=0;e<arguments.length;e++){var r=arguments[e];if(r){var c=typeof r;if("string"===c||"number"===c)t.push(r);else if(Array.isArray(r)){if(r.length){var s=o.apply(null,r);s&&t.push(s)}}else if("object"===c)if(r.toString===Object.prototype.toString)for(var a in r)n.call(r,a)&&r[a]&&t.push(a);else t.push(r.toString())}}return t.join(" ")}t.exports?(o.default=o,t.exports=o):void 0===(r=function(){return o}.apply(e,[]))||(t.exports=r)}()}}]);