"use strict";var e=require('./../../ext-esm/tslib/tslib.es6.js'),i=require("react/jsx-runtime"),r=require("react"),a=require("classnames"),n=require("lodash"),t=require("@material-ui/core"),l=require("./RealTimeValuesBox/RealTimeBoxEditDialog.js"),s=require("./RealTimeSidebarStyles.js"),o=require("./enums.js"),d=require("./RealTimeSidebarContext.js"),u=require("./SidebarFooter.js"),c=require("./RealTimeValuesBox/RealTimeBoxList.js"),S=require("./SidebarTitle.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=h(a);var g=t.withTheme(r.memo((function(a){var t,h,g,p,T=a.isSidebarOpen,b=a.handleOpenCloseSidebar,f=a.isResponsive,v=a.theme,j=a.sourceArray,x=a.findSource,C=a.onAppSettingChange,q=a.appSettings,O=a.assetKey,R=a.setting,y=a.realTimeTypes,H=a.isDialogOpen,E=a.paramToEdit,z=a.handleOpenCloseDialog,N=a.handleChangeParamToEdit,_=a.sidebarHorizontalHeight,A=void 0===_?400:_,D=a.onLayoutChange,B=void 0===D?n.noop:D,I=r.useRef(null),F=s.useStyles({sidebarHorizontalHeight:A}),L=f?o.ORIENTATIONS.horizontal:o.ORIENTATIONS.vertical,P=m.default(T&&"fullSize",((t={})[F.rtSidebarWhiteTheme]=v.isLightTheme,t[F.rtSidebarVertical]=!f,t[F.rtSidebarHorizontal]=f,t)),V=m.default(F.rtSidebarContent,L,((h={})[F.rtSidebarContentFullSize]=T,h)),K=m.default([F.rtSidebarHandler],((g={})[F.rtSidebarHandlerFullSize]=T,g));return r.useEffect((function(){var e;(null===(e=null==I?void 0:I.current)||void 0===e?void 0:e.clientHeight)&&B(I.current.clientHeight)}),[null===(p=null==I?void 0:I.current)||void 0===p?void 0:p.clientHeight,T]),i.jsx(d.Provider,e.__assign({value:{isSidebarOpen:T,onAppSettingChange:C,appSettings:q,assetKey:O,setting:R,realTimeTypes:y,orientation:L,handleOpenCloseSidebar:b,handleChangeParamToEdit:N,handleOpenCloseDialog:z}},{children:i.jsxs("div",e.__assign({className:P,ref:I},{children:[i.jsx("div",{className:K,onClick:function(){return b(!0)}}),i.jsx(S,{}),i.jsxs("div",e.__assign({className:V},{children:[i.jsx(c,{sourceArray:j,findSource:x}),i.jsx(l,{isDialogOpen:H,paramToEdit:E,handleCloseRealTimeDialog:function(){return z(!1)}})]})),i.jsx(u,{onSidebarOpened:function(){return b(!0)},onSidebarClosed:function(){return b(!1)}})]}))}))})));module.exports=g;
