"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),l=require("react/jsx-runtime"),s=require("react"),t=require("classnames"),i=require("@material-ui/core"),r=require("../../utils/getIsImperial.js"),n=require("../Filter/Filter.js");require("../Filter/components/MultiFilterSelect/MultiFilterSelect.js"),require("../Filter/components/SingleFilterSelect/SingleFilterSelect.js"),require("../Filter/components/StatusFilterSelect/StatusFilterSelect.js"),require("../Filter/components/PeriodFilterSelect/PeriodFilterSelect.js"),require("../Filter/components/WellSectionSelect/WellSectionSelect.js");var a=require("../OffsetWellsTable/OffsetWellsTable.js"),c=require("../OffsetWellsTable/components/OffsetWellsTableHead/OffsetWellsTableHead.js"),o=require("../OffsetWellsTable/AdvancedSearch/AdvancedSearch.js"),d=require("../OffsetWellsTable/OffsetWellsTable.module.css.js"),u=require("../../OffsetWellPickerV5.module.css.js");function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=f(e),W=f(t);exports.TableSection=function(e){var t=e.isMobile,f=e.isViewOnly,S=e.isFilterExpanded,b=e.isVScrollMoved,h=e.isTableFullLoading,j=e.isLimitedOffsetWells,p=e.isWellSectionColumnVisible,O=e.isAllWellsSelected,g=e.indeterminate,v=e.subjectWellId,C=e.selectedWellIds,x=e.selectedWellSection,T=e.sortedWells,F=e.tableWells,I=e.tableRowsCount,q=e.wellSections,y=e.metricsKeys,A=e.setMetricsKeys,w=e.columnsWithDict,N=e.taScores,R=e.filterOptions,M=e.loadingWellIds,k=e.loadingAssetIds,H=e.filters,V=e.sortBy,D=e.setSortBy,L=e.sortDirection,K=e.setSortDirection,P=e.maxOffsetWellNumber,G=e.handleChangeOffsetWell,B=e.handleChangeAllOffsetWells,E=e.handleChangeWellSection,_=e.handleAddRemoveAssets,U=e.handleScroll,z=e.setActiveWellId,J=e.setIsAdvancedSearchHidden,Q=e.wellsMapRef,X=e.headTableRef,Y=e.rightColumnRef,Z=e.isAnimatingRef,$=s.useMemo((function(){return r.getIsImperial()}),[]),ee=s.useCallback((function(){J(!0)}),[J]),le=s.useCallback((function(e,l){A((function(s){return s.map((function(s){return s===e?l:s}))}))}),[A]),se=s.useCallback((function(e,l){D(e),K(l)}),[D,K]);return l.jsxs("div",{className:u.rightColumn,ref:Y,onScroll:U,children:[!t&&l.jsx(n.Filter,{isHidden:!S,filterOptions:R,wellSections:null!=q?q:[],selectedWellSection:x,onChangeExternalOffsets:E}),l.jsx("div",{className:d.stickyTableWrapper,children:l.jsxs(i.Table,{"aria-label":"ows table head",innerRef:X,className:d.stickyTable,children:[l.jsx(i.TableHead,{children:l.jsx(c.OffsetWellsTableHead,{columnsWithDict:w,metricsKeys:y,sortBy:V,sortDirection:L,indeterminate:g,isAllWellsSelected:O,onChangeSort:se,onUpdateMetricsKey:le,handleChangeAllOffsetWells:B,wellNameStyle:d.wellNameFixed,isImperial:$,isTaColumnVisible:!!N.length,isWellSectionColumnVisible:p})}),f&&l.jsx("div",{className:W.default(u.topGradient,m.default({},u.topGradientScrolled,b))})]})}),!f&&l.jsxs("div",{className:W.default(d.searchCellWrapper),children:[l.jsx("div",{className:d.searchCell,children:l.jsx(o.AdvancedSearch,{companyIds:null,subjectWellId:v,onChange:_,selectedWellIds:C,onHideAdvancedSearch:ee,loadingAssetIds:k,filters:H,isLimitedOffsetWells:j})}),l.jsx("div",{className:W.default(u.topGradient,m.default({},u.topGradientScrolled,b))})]}),l.jsx(a.OffsetWellsTable,{isTableLoading:h,subjectWellId:v,columnsWithDict:w,wells:F,metricsKeys:y,handleChangeOffsetWell:G,isLastWell:null!=T&&T.length<=I,isLimitedOffsetWells:j,maxOffsetWellNumber:P,wellSections:q,setActiveWellId:z,onRowClick:function(e){var l;return null===(l=Q.current)||void 0===l?void 0:l.flyToWell(e)},taScores:N,isWellSectionColumnVisible:p,loadingWellIds:M,scrollContainerRef:Y,isAnimatingRef:Z})]})};
//# sourceMappingURL=TableSection.js.map
