(()=>{"use strict";var e,t,r,o={1787:(e,t,r)=>{const o=window.wp.blocks;var n=r(9187);const i=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"woocommerce/product-review-rating","title":"Review Rating","category":"woocommerce","ancestor":["woocommerce/product-reviews"],"description":"Displays the rating of a product review.","textdomain":"woocommerce","usesContext":["commentId"],"attributes":{"textAlign":{"type":"string"}},"supports":{"interactivity":{"clientNavigation":true},"color":{"gradients":true,"__experimentalDefaultControls":{"background":true,"text":true}}}}');var c=r(4921),a=r(7723);const s=window.wp.blockEditor,l=window.wp.data,u=window.wc.data;var p=r(790);(0,o.registerBlockType)(i,{edit:function({context:{commentId:e},attributes:t,setAttributes:r}){const{textAlign:o}=t,n=(0,c.A)("wc-block-product-review-rating",{[`has-text-align-${o}`]:o}),i=(0,s.useBlockProps)({className:n}),d=(0,l.useSelect)(t=>{const{getReview:r}=t(u.REVIEWS_STORE_NAME),o=e?r(Number(e)):null;return o?.rating??4},[e]),w={width:d/5*100+"%"},f=(0,a.sprintf)(/* translators: %f is referring to the average rating value */ /* translators: %f is referring to the average rating value */ (0,a.__)("Rated %f out of 5","woocommerce"),d),g={__html:(0,a.sprintf)(/* translators: %s is the rating value wrapped in HTML strong tags. */ /* translators: %s is the rating value wrapped in HTML strong tags. */ (0,a.__)("Rated %s out of 5","woocommerce"),(0,a.sprintf)('%f',d))};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(s.BlockControls,{children:(0,p.jsx)(s.AlignmentToolbar,{value:t.textAlign,onChange:e=>{r({textAlign:e||""})}})}),(0,p.jsx)("div",{...i,children:(0,p.jsx)("div",{className:"wc-block-product-review-rating__stars",role:"img","aria-label":f,children:(0,p.jsx)("span",{style:w,dangerouslySetInnerHTML:g})})})]})},icon:n.A})},790:e=>{e.exports=window.ReactJSXRuntime},7723:e=>{e.exports=window.wp.i18n},5573:e=>{e.exports=window.wp.primitives}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return o[e](r,r.exports,i),r.exports}i.m=o,e=[],i.O=(t,r,o,n)=>{if(!r){var c=1/0;for(u=0;u=n)&&Object.keys(i.O).every(e=>i.O[e](r[s]))?r.splice(s--,1):(a=!1,n0&&e[u-1][2]>n;u--)e[u]=e[u-1];e[u]=[r,o,n]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var n=Object.create(null);i.r(n);var c={};t=t||[null,r({}),r([]),r(r)];for(var a=2&o&&e;"object"==typeof a&&!~t.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach(t=>c[t]=()=>e[t]);return c.default=()=>e,i.d(n,c),n},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.j=8833,(()=>{var e={8833:0};i.O.j=t=>0===e[t];var t=(t,r)=>{var o,n,[c,a,s]=r,l=0;if(c.some(t=>0!==e[t])){for(o in a)i.o(a,o)&&(i.m[o]=a[o]);if(s)var u=s(i)}for(t&&t(r);li(1787));c=i.O(c),((this.wc=this.wc||{}).blocks=this.wc.blocks||{})["product-review-rating"]=c})();