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