import o from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/regenerator";import{useState as s}from"react";import e from"prop-types";import{MenuItem as i,Icon as c,ListItemText as r}from"@material-ui/core";import m from"./NonPriorityMenus.css.js";import u from"../../../../IconButton/index.js";import a from"../../../../IconMenu/index.js";import{HamburgerButtonIcon as p,FullScreenOneIcon as l,SettingTwoIcon as d}from"../../../../../icons/iconParkIcons.js";import"../../../../../icons/customIcons/icons/AddMessage.js";import"../../../../../icons/customIcons/icons/Attention.js";import"../../../../../icons/customIcons/icons/Collapse.js";import"../../../../../icons/customIcons/icons/Dashboard.js";import"../../../../../icons/customIcons/icons/Expand.js";import"../../../../../icons/customIcons/icons/FolderClosed.js";import"../../../../../icons/customIcons/icons/FolderClosedFilled.js";import"../../../../../icons/customIcons/icons/FolderOpened.js";import"../../../../../icons/customIcons/icons/GreaterOrEqual.js";import"../../../../../icons/customIcons/icons/LessOrEqual.js";import"../../../../../icons/customIcons/icons/Search.js";import"../../../../../icons/customIcons/icons/Wellhub.js";import"../../../../../icons/customIcons/icons/MultiRuler.js";import"../../../../../icons/customIcons/icons/Checkbox.js";import"../../../../../icons/customIcons/icons/CheckboxChecked.js";import"../../../../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../../../../icons/customIcons/icons/Radio.js";import"../../../../../icons/customIcons/icons/RadioChecked.js";import"../../../../../icons/customIcons/icons/SimulFrac.js";import"../../../../../icons/customIcons/icons/ZipperFrac.js";import"../../../../../icons/customIcons/icons/CautionFilled.js";import"../../../../../icons/customIcons/icons/MoreApp.js";import{jsxs as f,jsx as I}from"react/jsx-runtime";var h="DevCenter_AppPriorityMenu",j=function(e){var j,g,C,x=e.toggleAppSettingsDialog,b=e.devCenterRouter,k=e.isMaximized,M=e.setIsMaximized,y=e.menuItems,v=e.isMobileView,w=e.setIsFullscreenModalMode,F=s(!1),R=n(F,2),A=R[0],O=R[1],P=s(null),S=n(P,2),q=S[0],z=S[1],E=(j=o(t.mark((function o(){var n;return t.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(!(n=!A)){o.next=7;break}return o.next=4,w(n);case 4:O(n),o.next=9;break;case 7:O(n),w(n);case 9:case"end":return o.stop()}}),o)}))),function(){return j.apply(this,arguments)}),N=(g=o(t.mark((function o(n){return t.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,w(!0);case 2:null==n||n(!0);case 3:case"end":return o.stop()}}),o)}))),function(o){return g.apply(this,arguments)});return f(a,{"data-testid":"".concat(h,"_menu"),IconElement:I(p,{}),className:m.menuIcon,IconButtonComponent:u,iconButtonProps:{tooltipProps:{title:!v&&"Menu",placement:"top"},onClick:(C=o(t.mark((function o(n){return t.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return z(n.currentTarget),o.next=3,w(!0);case 3:O(!0);case 4:case"end":return o.stop()}}),o)}))),function(o){return C.apply(this,arguments)})},classes:{iconButton:m.iconButton},menuProps:{anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"},getContentAnchorEl:null,onClick:E,onClose:E,open:A,anchorEl:q},children:[y.map((function(o){return f(i,{className:m.menuItem,"data-testid":"".concat(h,"_").concat(o.title),onClick:function(){N(o.onClick),o.to&&b.push(o.to)},component:"li",to:o.to,children:["string"==typeof o.icon?I(c,{className:m.muiIcon,children:o.icon}):o.icon,I(r,{primary:o.title})]},o.title)})),!k&&f(i,{className:m.menuItem,"data-testid":"".concat(h,"_fullScreenMenuItem"),onClick:function(){return N(M)},children:[I(l,{}),"Full Screen"]}),f(i,{className:m.menuItem,"data-testid":"".concat(h,"_settings"),onClick:function(){return N(x)},children:[I(d,{}),"Settings"]})]})};j.propTypes={toggleAppSettingsDialog:e.func.isRequired,isMaximized:e.bool.isRequired,isMobileView:e.bool,setIsMaximized:e.func.isRequired,devCenterRouter:e.shape({push:e.func}).isRequired,menuItems:e.arrayOf(e.shape({onClick:e.func,to:e.oneOfType([e.string,e.shape({})]),icon:e.string,title:e.string}))},j.defaultProps={menuItems:[],isMobileView:!1};export{j as default};
