(()=>{var e={6942:(e,t)=>{var i;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e="",t=0;t<arguments.length;t++){var i=arguments[t];i&&(e=l(e,r(i)))}return e}function r(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return o.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var i in e)n.call(e,i)&&e[i]&&(t=l(t,i));return t}function l(e,t){return t?e?e+" "+t:e+t:e}e.exports?(o.default=o,e.exports=o):void 0===(i=function(){return o}.apply(t,[]))||(e.exports=i)}()}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.blocks,t=JSON.parse('{"UU":"snow-monkey-blocks/price-menu-item"}'),n=window.ReactJSXRuntime,o=(0,n.jsxs)("svg",{viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{d:"M12,3a9,9,0,1,0,9,9A9,9,0,0,0,12,3Zm0,17a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"}),(0,n.jsx)("path",{d:"M12.33,11.34c-.76-.29-1.42-.54-1.42-1s.45-.85,1.17-.85a2.31,2.31,0,0,1,1.63.63l.06.06.61-.69-.06,0a2.82,2.82,0,0,0-1.79-.89V7h-.86V8.52A1.89,1.89,0,0,0,9.8,10.33c0,1.14,1.12,1.58,2.1,2,.79.31,1.54.61,1.54,1.2s-.49.9-1.29.9a3.45,3.45,0,0,1-2.08-.76L10,13.57l-.54.81.06,0a4.17,4.17,0,0,0,2.16.9V17h.86V15.32c1.23-.16,2-.9,2-1.9C14.55,12.18,13.37,11.73,12.33,11.34Z"})]});var r=i(6942),l=i.n(r);const s=window.wp.blockEditor,c=window.wp.components,a=window.wp.i18n;(0,e.registerBlockType)(t.UU,{icon:{foreground:"#cd162c",src:o},edit:function({attributes:e,setAttributes:i,className:o,clientId:r}){const{title:u,price:p,titleFontSizeSlug:S,titleFontSize:d,priceFontSizeSlug:m,priceFontSize:z}=e,[g]=(0,s.useSettings)("typography.fontSizes"),_=l()("smb-price-menu__item",o),F=(0,s.useBlockProps)({className:_}),v=g.find((e=>!!S&&e.slug===S))?.size||d,x=g.find((e=>!!m&&e.slug===m))?.size||z,f=S?(0,s.getFontSizeClass)(S):void 0,h=m?(0,s.getFontSizeClass)(m):void 0;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(s.InspectorControls,{group:"typography",children:[(0,n.jsx)(c.__experimentalToolsPanelItem,{panelId:r,hasValue:()=>S!==t.titleFontSizeSlug||d!==t.titleFontSize,isShownByDefault:!0,label:(0,a.__)("Title font size","snow-monkey-blocks"),resetAllFilter:()=>({titleFontSizeSlug:t.titleFontSizeSlug,titleFontSize:t.titleFontSize}),onDeselect:()=>{i({titleFontSizeSlug:t.titleFontSizeSlug,titleFontSize:t.titleFontSize})},children:(0,n.jsx)(c.BaseControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Title","snow-monkey-blocks"),id:"snow-monkey-blocks/price-menu-item/title-font-size",children:(0,n.jsx)(s.FontSizePicker,{__next40pxDefaultSize:!0,value:v,onChange:e=>{const t=(0,s.getFontSizeObjectByValue)(g,e).slug;i({titleFontSizeSlug:t||void 0,titleFontSize:t?void 0:e})},withReset:!1,withSlider:!0})})}),(0,n.jsx)(c.__experimentalToolsPanelItem,{panelId:r,hasValue:()=>m!==t.priceFontSizeSlug||z!==t.priceFontSize,isShownByDefault:!0,label:(0,a.__)("Price font size","snow-monkey-blocks"),resetAllFilter:()=>({priceFontSizeSlug:t.priceFontSizeSlug,priceFontSize:t.priceFontSize}),onDeselect:()=>{i({priceFontSizeSlug:t.priceFontSizeSlug,priceFontSize:t.priceFontSize})},children:(0,n.jsx)(c.BaseControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Price","snow-monkey-blocks"),id:"snow-monkey-blocks/price-menu-item/price-font-size",children:(0,n.jsx)(s.FontSizePicker,{__next40pxDefaultSize:!0,value:x,onChange:e=>{const t=(0,s.getFontSizeObjectByValue)(g,e).slug;i({priceFontSizeSlug:t||void 0,priceFontSize:t?void 0:e})},withReset:!1,withSlider:!0})})})]}),(0,n.jsxs)("div",{...F,children:[(0,n.jsx)(s.RichText,{className:l()("smb-price-menu__item__title",f),placeholder:(0,a.__)("Write title…","snow-monkey-blocks"),value:u,onChange:e=>i({title:e}),style:{fontSize:d||void 0}}),(0,n.jsx)(s.RichText,{className:l()("smb-price-menu__item__price",h),placeholder:(0,a.__)("Write price…","snow-monkey-blocks"),value:p,onChange:e=>i({price:e}),style:{fontSize:z||void 0}})]})]})},save:function({attributes:e,className:t}){const{title:i,price:o,titleFontSizeSlug:r,titleFontSize:c,priceFontSizeSlug:a,priceFontSize:u}=e,p=l()("smb-price-menu__item",t),S=r?(0,s.getFontSizeClass)(r):void 0,d=a?(0,s.getFontSizeClass)(a):void 0;return(0,n.jsxs)("div",{...s.useBlockProps.save({className:p}),children:[(0,n.jsx)("div",{className:l()("smb-price-menu__item__title",S),style:{fontSize:c||void 0},children:(0,n.jsx)(s.RichText.Content,{value:i})}),(0,n.jsx)("div",{className:l()("smb-price-menu__item__price",d),style:{fontSize:u||void 0},children:(0,n.jsx)(s.RichText.Content,{value:o})})]})}})})()})();