"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("prop-types"),i=require("classnames"),r=require("@material-ui/core"),o=require("@material-ui/icons/AddCircle"),n=require("@material-ui/icons/ExpandLess"),l=require("@material-ui/icons/ExpandMore"),a=require("../IconButton/index.js"),s=require("react/jsx-runtime"),d=require("./components/FolderIcon.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=c(e),p=c(t),f=c(i),b=c(o),g=c(n),m=c(l);function h(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function j(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?h(Object(i),!0).forEach((function(t){u.default(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):h(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var v=r.makeStyles((function(e){return{folderMenuItem:{alignItems:"center",backgroundColor:e.palette.background.b8,color:"#FFFFFF",cursor:"pointer",display:"flex",fontSize:"0.875rem",fontWeight:"500",height:36,justifyContent:"space-between",paddingLeft:48,paddingRight:4,position:"relative",width:"100%",boxSizing:"border-box","&:hover":{backgroundColor:"rgba(3, 188, 212, 0.07)"},"&:hover svg":{visibility:"visible"},"&:hover $addIcon":{visibility:"visible"},"&:hover $toggleIcon":{visibility:"visible"}},addIcon:{visibility:"hidden"},toggleIcon:{visibility:"hidden"},folderMenuItemSelected:{backgroundColor:"rgba(3, 188, 212, 0.15) !important","&::before":{left:0,height:"100%",width:4,backgroundColor:e.palette.primary.main,position:"absolute",content:'""',borderRadius:"4px 0 0 4px"}},addCircleIcon:{visibility:"hidden"},actions:{display:"flex",alignItems:"center"},folderIcon:{position:"absolute",left:24,top:8},folderName:{overflow:"hidden",marginRight:4,height:"36px",lineHeight:"36px",whiteSpace:"nowrap",textOverflow:"ellipsis",userSelect:"none"}}})),x=function(e){var t=e.folderColor,i=e.isCreatable,o=e.isOpen,n=e.isSelected,l=e.name,c=e.onAdd,p=e.onClick,h=e.onToggle,x=v();return s.jsxs("div",{className:f.default(x.folderMenuItem,u.default({},x.folderMenuItemSelected,n)),onClick:p,children:[s.jsx(d,{color:t,isOpen:o,className:x.folderIcon}),s.jsx("div",{className:x.folderName,children:l}),s.jsxs("div",{className:x.actions,children:[i&&s.jsx(r.Tooltip,{title:"Add Page",placement:"bottom-end",children:s.jsx(a,{className:x.addIcon,size:"small",onClick:function(e){e.stopPropagation(),c()},children:s.jsx(b.default,{fontSize:"small"})})}),s.jsx(a,{className:x.toggleIcon,size:"small",onClick:function(e){e.stopPropagation(),h()},children:s.jsx((function(e){return s.jsx(r.Tooltip,{title:o?"Collapse":"Expand",placement:"bottom-end",children:o?s.jsx(g.default,j({},e)):s.jsx(m.default,j({},e))})}),{fontSize:"small"})})]})]})};x.propTypes={folderColor:p.default.string.isRequired,isCreatable:p.default.bool,isOpen:p.default.bool,isSelected:p.default.bool,name:p.default.string.isRequired,onAdd:p.default.func.isRequired,onClick:p.default.func.isRequired,onToggle:p.default.func.isRequired},x.defaultProps={isCreatable:!1,isOpen:!1,isSelected:!1},module.exports=x;
