(self.webpackChunkwebpackWcBlocksFrontendJsonp=self.webpackChunkwebpackWcBlocksFrontendJsonp||[]).push([[462],{8757:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Block:()=>g,default:()=>v});var o=n(1609),r=n(7723),s=n(851),a=n(2796),l=n(3566),c=n(1616),i=n(3993);n(7067);const u=e=>({width:e/5*100+"%"}),d=({parentClassName:e})=>{const t=u(0);return(0,o.createElement)("div",{className:(0,s.A)("wc-block-components-product-rating__norating-container",`${e}-product-rating__norating-container`)},(0,o.createElement)("div",{className:"wc-block-components-product-rating__norating",role:"img"},(0,o.createElement)("span",{style:t})),(0,o.createElement)("span",null,(0,r.__)("No Reviews","woocommerce")))},m=e=>{const{rating:t,reviews:n,parentClassName:a}=e,l=u(t),c=(0,r.sprintf)(/* translators: %f is referring to the average rating value */ /* translators: %f is referring to the average rating value */
(0,r.__)("Rated %f out of 5","woocommerce"),t),i={__html:(0,r.sprintf)(/* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */ /* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */
(0,r._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"),(0,r.sprintf)('<strong class="rating">%f</strong>',t),(0,r.sprintf)('<span class="rating">%d</span>',n))};return(0,o.createElement)("div",{className:(0,s.A)("wc-block-components-product-rating__stars",`${a}__product-rating__stars`),role:"img","aria-label":c},(0,o.createElement)("span",{style:l,dangerouslySetInnerHTML:i}))},p=e=>{const{reviews:t}=e,n=(0,r.sprintf)(/* translators: %s is referring to the total of reviews for a product */ /* translators: %s is referring to the total of reviews for a product */
(0,r._n)("(%s customer review)","(%s customer reviews)",t,"woocommerce"),t);return(0,o.createElement)("span",{className:"wc-block-components-product-rating__reviews_count"},n)},g=e=>{const{textAlign:t,isDescendentOfSingleProductBlock:n,shouldDisplayMockedReviewsWhenProductHasNoReviews:r}=e,c=(0,l.p)(e),{parentClassName:u}=(0,a.useInnerBlockLayoutContext)(),{product:g}=(0,a.useProductDataContext)(),v=(e=>{const t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0})(g),f=(e=>{const t=(0,i.isNumber)(e.review_count)?e.review_count:parseInt(e.review_count,10);return Number.isFinite(t)&&t>0?t:0})(g),y=(0,s.A)(c.className,"wc-block-components-product-rating",{[`${u}__product-rating`]:u,[`has-text-align-${t}`]:t}),b=r?(0,o.createElement)(d,{parentClassName:u}):null,_=f?(0,o.createElement)(m,{rating:v,reviews:f,parentClassName:u}):b;if(f||r)return(0,o.createElement)("div",{className:y,style:c.style},(0,o.createElement)("div",{className:"wc-block-components-product-rating__container"},_,f&&n?(0,o.createElement)(p,{reviews:f}):null))},v=(0,c.withProductDataContext)(g)},3566:(e,t,n)=>{"use strict";n.d(t,{p:()=>l});var o=n(851),r=n(3993),s=n(92),a=n(6032);const l=e=>{const t=(e=>{const t=(0,r.isObject)(e)?e:{style:{}};let n=t.style;return(0,r.isString)(n)&&(n=JSON.parse(n)||{}),(0,r.isObject)(n)||(n={}),{...t,style:n}})(e),n=(0,a.BK)(t),l=(0,a.aR)(t),c=(0,a.fo)(t),i=(0,s.x)(t);return{className:(0,o.A)(i.className,n.className,l.className,c.className),style:{...i.style,...n.style,...l.style,...c.style}}}},92:(e,t,n)=>{"use strict";n.d(t,{x:()=>r});var o=n(3993);const r=e=>{const t=(0,o.isObject)(e.style.typography)?e.style.typography:{},n=(0,o.isString)(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:n,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}}},6032:(e,t,n)=>{"use strict";n.d(t,{BK:()=>i,aR:()=>u,fo:()=>d});var o=n(851),r=n(1194),s=n(9786),a=n(3993);function l(e={}){const t={};return(0,s.getCSSRules)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function c(e,t){return e&&t?`has-${(0,r.c)(t)}-${e}`:""}function i(e){var t,n,r,s,i,u,d;const{backgroundColor:m,textColor:p,gradient:g,style:v}=e,f=c("background-color",m),y=c("color",p),b=function(e){if(e)return`has-${e}-gradient-background`}(g),_=b||(null==v||null===(t=v.color)||void 0===t?void 0:t.gradient);return{className:(0,o.A)(y,b,{[f]:!_&&!!f,"has-text-color":p||(null==v||null===(n=v.color)||void 0===n?void 0:n.text),"has-background":m||(null==v||null===(r=v.color)||void 0===r?void 0:r.background)||g||(null==v||null===(s=v.color)||void 0===s?void 0:s.gradient),"has-link-color":(0,a.isObject)(null==v||null===(i=v.elements)||void 0===i?void 0:i.link)?null==v||null===(u=v.elements)||void 0===u||null===(d=u.link)||void 0===d?void 0:d.color:void 0}),style:l({color:(null==v?void 0:v.color)||{}})}}function u(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:function(e){var t;const{borderColor:n,style:r}=e,s=n?c("border-color",n):"";return(0,o.A)({"has-border-color":!!n||!(null==r||null===(t=r.border)||void 0===t||!t.color),[s]:!!s})}(e),style:l({border:n})}}function d(e){var t;return{className:void 0,style:l({spacing:(null===(t=e.style)||void 0===t?void 0:t.spacing)||{}})}}},7067:()=>{}}]);