(()=>{"use strict";var e={n:n=>{var o=n&&n.__esModule?()=>n.default:()=>n;return e.d(o,{a:o}),o},d:(n,o)=>{for(var t in o)e.o(o,t)&&!e.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:o[t]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n)};const n=window.wp.blocks,o=window.wp.i18n,t=window.wp.element,a=window.wp.blockEditor,i=window.wp.components,l=window.wp.serverSideRender;var r=e.n(l);const c=JSON.parse('{"UU":"maxmegamenu/location"}'),s=window.ReactJSXRuntime,{UU:m}=c;(0,n.registerBlockType)(c.UU,{edit:function({setAttributes:e,attributes:n,isSelected:l}){if(0===window.max_mega_menu_locations.length)return(0,s.jsx)("div",{...(0,a.useBlockProps)(),children:(0,o.__)("Error: max_mega_menu_locations missing.","megamenu")});const c=Object.keys(window.max_mega_menu_locations).map(e=>({value:e,label:window.max_mega_menu_locations[e]}));if(1===c.length){const e=window.max_mega_menu_block_admin?.menu_locations_url||"#";return(0,s.jsx)("div",{...(0,a.useBlockProps)(),children:(0,t.createInterpolateElement)((0,o.__)("No locations found. Go to <a>Mega Menu > Menu Locations</a> to create a new menu location.","megamenu"),{a:(0,s.jsx)("a",{href:e})})})}return(0,s.jsx)("div",{...(0,a.useBlockProps)(),children:l||!n.location||""===n.location?(0,s.jsx)(i.Placeholder,{label:(0,o.__)("Max Mega Menu","megamenu"),children:(0,s.jsx)(i.SelectControl,{label:(0,o.__)("Select a location","megamenu"),options:c,value:n.location,onChange:n=>{e({location:String(n)})}})}):(0,s.jsx)(i.Disabled,{children:(0,s.jsx)(r(),{block:m,attributes:n})})})}})})();