Liferay.Loader.define("@liferay/content-dashboard-web@2.0.85/js/components/Sidebar",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/layout","@liferay/frontend-js-react-web","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$react"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.SidebarContext=void 0;var n=a("@frontend-taglib-clay$clayui/button"),r=_interopRequireDefault(a("@frontend-taglib-clay$clayui/layout")),l=a("@liferay/frontend-js-react-web"),o=_interopRequireDefault(a("liferay!frontend-js-react-web$classnames")),c=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var l=n?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(a,r,l):a[r]=e[r]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const e=c.default.createContext();t.SidebarContext=e;const noop=()=>{},SidebarBody=({children:e,className:t})=>c.default.createElement("div",{className:(0,o.default)("sidebar-body",t)},e),SidebarHeader=({actionsSlot:t,children:a,title:l})=>{const{onClose:o}=(0,c.useContext)(e);return c.default.createElement("section",{className:"is-sticky sidebar-header"},c.default.createElement(r.default.ContentRow,{className:"sidebar-section"},c.default.createElement(r.default.ContentCol,{className:"justify-content-center",expand:!0},c.default.createElement("p",{className:"font-weight-bold mb-0 pr-2"},l)),t&&c.default.createElement(r.default.ContentCol,null,t),c.default.createElement(r.default.ContentCol,null,c.default.createElement(n.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("close"),className:"component-action text-secondary","data-tooltip-align":"bottom",displayType:"unstyled",onClick:o,symbol:"times",title:Liferay.Language.get("close")}))),a)},Sidebar=({children:t,fetchData:a,onClose:n=noop,open:r=!0})=>{const[o,i]=(0,c.useState)(!1),d=(0,l.useTimeout)();return(0,c.useEffect)((()=>{!1!==r?d((()=>i(!0)),100):i(!1)}),[d,r]),(0,c.useEffect)((()=>{o?document.body.classList.add("sidebar-open"):document.body.classList.remove("sidebar-open")}),[o]),c.default.createElement("div",{className:"cadmin"},c.default.createElement("div",{className:"content-dashboard sidebar sidebar-light sidebar-sm"},c.default.createElement(e.Provider,{value:{fetchData:a,onClose:n}},t)))};Sidebar.Body=SidebarBody,Sidebar.Header=SidebarHeader;var i=Sidebar;t.default=i}}));
//# sourceMappingURL=Sidebar.js.map