"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),b=require("react"),o=require("@devgateway/wp-react-lib"),I=require("react-intl"),i=require("semantic-ui-react"),f=require("../utils/parseUtils.js"),g=(n,t)=>n?n.substr(n.indexOf("/wp")+3).startsWith("/"+t)?n.substr(n.indexOf("/wp")+3):"/"+t+n.substr(n.indexOf("/wp")+3):"",M=I.injectIntl(n=>{const{menu:t,locale:r,match:u,selected:a,active:d,showIcons:c,onSetSelected:l}=n;return e.jsx(e.Fragment,{children:t&&t.items.map((s,h)=>e.jsxs(i.Menu.Item,{className:`divided ${s.child_items?"has-child-items":""} 
                    ${a&&a.ID==s.ID?"selected":""}  
                    ${d==s.slug?"active":""}`,children:[e.jsx("span",{children:e.jsx("a",{href:g(s.url,r),children:s.title})}),s.child_items&&s.child_items.map((m,x)=>e.jsx(i.Menu.Item,{children:" "}))]}))})}),w=n=>{const{intl:t,parent:r,editing:u=!1,unique:a,onChange:d,"data-name":c="main","data-label":l,"data-icon":s,"data-icon-id":h,"data-show-icons":m,"data-show-labels":x,locale:j}=n,[S,p]=b.useState(null);return e.jsx(i.Container,{fluid:!0,textAlign:"right",children:c&&c!=""&&e.jsxs(i.Menu,{className:"inline",size:"small",children:[e.jsxs(i.Menu.Item,{header:!0,children:[s&&e.jsx("img",{src:f.decode(s),className:"icon"}),l&&e.jsx("span",{className:"label",children:l})]}),e.jsx(o.MenuProvider,{slug:c,locale:j,children:e.jsx(o.MenuConsumer,{children:e.jsx(M,{onSetSelected:p})})})]})})};exports.default=w;
