(()=>{var t,e={1516:(t,e,r)=>{"use strict";const n=window.wp.blocks,i=JSON.parse('{"UU":"snow-monkey-blocks/rating-box"}'),o=window.ReactJSXRuntime,s=(0,o.jsxs)("svg",{viewBox:"0 0 24 24",children:[(0,o.jsx)("rect",{x:"5",y:"6.75",width:"8",height:"1.5"}),(0,o.jsx)("rect",{x:"5",y:"9.75",width:"14",height:"1.5"}),(0,o.jsx)("rect",{x:"5",y:"12.75",width:"8",height:"1.5"}),(0,o.jsx)("rect",{x:"5",y:"15.75",width:"14",height:"1.5"})]});var a=r(6942),l=r.n(a);const c=window.wp.blockEditor,d=window.wp.data,u=["snow-monkey-blocks/rating-box-item"],b=[["snow-monkey-blocks/rating-box-item"]],g=window.lodash,m=[{save:()=>(0,o.jsx)("div",{className:"smb-rating-box",children:(0,o.jsx)("div",{className:"smb-rating-box__body",children:(0,o.jsx)(c.InnerBlocks.Content,{})})})},{attributes:{ratings:{type:"array",source:"query",selector:".smb-rating-box__item",default:[],query:{title:{source:"html",selector:".smb-rating-box__item__title"},rating:{type:"number",source:"attribute",attribute:"data-rating",default:0},color:{type:"string",source:"attribute",attribute:"data-color"}}},rows:{type:"number",default:1}},migrate:t=>[{},(()=>{const e=void 0===t.ratings?0:t.ratings.length;return(0,g.times)(e,(e=>{const r=(0,g.get)(t.ratings,[e,"title"],""),i=(0,g.get)(t.ratings,[e,"rating"],0),o=(0,g.get)(t.ratings,[e,"color"],"");return(0,n.createBlock)("snow-monkey-blocks/rating-box-item",{title:r,rating:Number(i),color:o})}))})()],save({attributes:t}){const{ratings:e}=t,r=void 0===t.ratings?0:t.ratings.length;return(0,o.jsx)("div",{className:"smb-rating-box",children:(0,o.jsx)("div",{className:"smb-rating-box__body",children:(0,g.times)(r,(t=>{const r=(0,g.get)(e,[t,"title"],""),n=(0,g.get)(e,[t,"rating"],0),i=(0,g.get)(e,[t,"color"],"");return(0,o.jsxs)("div",{className:"smb-rating-box__item","data-rating":n,"data-color":i,children:[(0,o.jsx)("div",{className:"smb-rating-box__item__title",children:(0,o.jsx)(c.RichText.Content,{value:r})}),(0,o.jsx)("div",{className:"smb-rating-box__item__evaluation",children:(0,o.jsxs)("div",{className:"smb-rating-box__item__evaluation__bar",children:[(0,o.jsx)("div",{className:"smb-rating-box__item__evaluation__numeric",children:n}),(0,o.jsx)("div",{className:"smb-rating-box__item__evaluation__rating",style:{width:10*n+"%",backgroundColor:i}})]})})]})}))})})}}];(0,n.registerBlockType)(i.UU,{icon:{foreground:"#cd162c",src:s},edit:function({attributes:t,className:e,clientId:r}){const{templateLock:n}=t,i=(0,d.useSelect)((t=>!!t("core/block-editor").getBlock(r)?.innerBlocks?.length),[r]),s=l()("smb-rating-box",e),a=(0,c.useBlockProps)({className:s}),g=(0,c.useInnerBlocksProps)({className:"smb-rating-box__body"},{allowedBlocks:u,template:b,templateLock:n,renderAppender:i?void 0:c.InnerBlocks.ButtonBlockAppender});return(0,o.jsx)("div",{...a,children:(0,o.jsx)("div",{...g})})},save:function({className:t}){const e=l()("smb-rating-box",t);return(0,o.jsx)("div",{...c.useBlockProps.save({className:e}),children:(0,o.jsx)("div",{...c.useInnerBlocksProps.save({className:"smb-rating-box__body"})})})},deprecated:m})},6942:(t,e)=>{var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var t="",e=0;e<arguments.length;e++){var r=arguments[e];r&&(t=s(t,o(r)))}return t}function o(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return i.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var e="";for(var r in t)n.call(t,r)&&t[r]&&(e=s(e,r));return e}function s(t,e){return e?t?t+" "+e:t+e:t}t.exports?(i.default=i,t.exports=i):void 0===(r=function(){return i}.apply(e,[]))||(t.exports=r)}()}},r={};function n(t){var i=r[t];if(void 0!==i)return i.exports;var o=r[t]={exports:{}};return e[t](o,o.exports,n),o.exports}n.m=e,t=[],n.O=(e,r,i,o)=>{if(!r){var s=1/0;for(d=0;d<t.length;d++){for(var[r,i,o]=t[d],a=!0,l=0;l<r.length;l++)(!1&o||s>=o)&&Object.keys(n.O).every((t=>n.O[t](r[l])))?r.splice(l--,1):(a=!1,o<s&&(s=o));if(a){t.splice(d--,1);var c=i();void 0!==c&&(e=c)}}return e}o=o||0;for(var d=t.length;d>0&&t[d-1][2]>o;d--)t[d]=t[d-1];t[d]=[r,i,o]},n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t={3441:0,1333:0};n.O.j=e=>0===t[e];var e=(e,r)=>{var i,o,[s,a,l]=r,c=0;if(s.some((e=>0!==t[e]))){for(i in a)n.o(a,i)&&(n.m[i]=a[i]);if(l)var d=l(n)}for(e&&e(r);c<s.length;c++)o=s[c],n.o(t,o)&&t[o]&&t[o][0](),t[o]=0;return n.O(d)},r=globalThis.webpackChunk=globalThis.webpackChunk||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})();var i=n.O(void 0,[1333],(()=>n(1516)));i=n.O(i)})();